DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | List of all members
Deveel.Data.Routines.FunctionBuildTests Class Reference
Inheritance diagram for Deveel.Data.Routines.FunctionBuildTests:
Deveel.Data.ContextBasedTest

Classes

class  Factory1
 
class  Factory2
 

Public Member Functions

void ScalarWithNoArguments ()
 
void ScalarWithTwoArgument ()
 
- Public Member Functions inherited from Deveel.Data.ContextBasedTest
void TestSetUp ()
 
void TestFixtureSetUp ()
 
void TestTearDown ()
 
void TestFixtureTearDown ()
 

Additional Inherited Members

- Protected Member Functions inherited from Deveel.Data.ContextBasedTest
virtual void RegisterServices (ServiceContainer container)
 
virtual ISystem CreateSystem ()
 
virtual IDatabase CreateDatabase (ISystem system, IConfiguration configuration)
 
virtual ISession CreateAdminSession (IDatabase database)
 
virtual IQuery CreateQuery (ISession session)
 
ISession CreateUserSession (string userName, string password)
 
virtual void OnSetUp (string testName)
 
virtual void OnTearDown ()
 
- Protected Attributes inherited from Deveel.Data.ContextBasedTest
const string AdminUserName = "SA"
 
const string AdminPassword = "1234567890"
 
const string DatabaseName = "testdb"
 
- Properties inherited from Deveel.Data.ContextBasedTest
virtual bool SingleContext [get]
 
IQuery Query [get, private set]
 
ISystem System [get, private set]
 
IDatabase Database [get, private set]
 
ISession Session [get, private set]
 

Detailed Description

Definition at line 26 of file FunctionBuildTests.cs.

Member Function Documentation

void Deveel.Data.Routines.FunctionBuildTests.ScalarWithNoArguments ( )
inline

Definition at line 28 of file FunctionBuildTests.cs.

28  {
29  FunctionProvider factory1 = null;
30  Assert.DoesNotThrow(() => factory1 = new Factory1());
31 
32  IFunction function = null;
33  Assert.DoesNotThrow(() => function = factory1.ResolveFunction("user2"));
34  Assert.IsNotNull(function);
35 
36  InvokeResult result=null;
37  Assert.DoesNotThrow(() => result = function.Execute(Query));
38  Assert.IsNotNull(result);
39  Assert.AreEqual(AdminUserName, result.ReturnValue.Value.ToString());
40  }
void Deveel.Data.Routines.FunctionBuildTests.ScalarWithTwoArgument ( )
inline

Definition at line 43 of file FunctionBuildTests.cs.

43  {
44  Factory2 factory2 = null;
45  Assert.DoesNotThrow(() => factory2 = new Factory2());
46 
47  IFunction function = null;
48  var args = new DataObject[] {DataObject.BigInt(2), DataObject.Number(new SqlNumber(54))};
49  Assert.DoesNotThrow(() => function = factory2.ResolveFunction("add2", args));
50  Assert.IsNotNull(function);
51 
52  InvokeResult result = null;
53  Assert.DoesNotThrow(() => result = function.Execute(args));
54  Assert.IsNotNull(result);
55 
56  Assert.IsInstanceOf<SqlNumber>(result.ReturnValue.Value);
57 
58  var value = ((SqlNumber) result.ReturnValue.Value).ToInt64();
59  Assert.AreEqual(56, value);
60  }
static DataObject Number(SqlNumber value)
Definition: DataObject.cs:552
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Definition: DataObject.cs:35
long IConvertible. ToInt64(IFormatProvider provider)
Definition: SqlNumber.cs:305
static DataObject BigInt(long value)
Definition: DataObject.cs:580

The documentation for this class was generated from the following file: