22 using NUnit.Framework;
24 namespace Deveel.Data.Routines {
30 Assert.DoesNotThrow(() => factory1 =
new Factory1());
33 Assert.DoesNotThrow(() =>
function = factory1.
ResolveFunction(
"user2"));
34 Assert.IsNotNull(
function);
37 Assert.DoesNotThrow(() => result =
function.Execute(
Query));
38 Assert.IsNotNull(result);
45 Assert.DoesNotThrow(() => factory2 =
new Factory2());
49 Assert.DoesNotThrow(() =>
function = factory2.
ResolveFunction(
"add2", args));
50 Assert.IsNotNull(
function);
53 Assert.DoesNotThrow(() => result =
function.Execute(args));
54 Assert.IsNotNull(result);
59 Assert.AreEqual(56, value);
65 public override string SchemaName {
70 Register(config => config.Named(
"user2")
72 .WhenExecute(context => context.Result(
DataObject.
String(context.Request.User().Name))));
81 public override string SchemaName {
86 Register(config => config.Named(
"add2")
87 .WithNumericParameter(
"a")
88 .WithNumericParameter(
"b")
90 .WhenExecute(context => {
91 var a = context.EvaluatedArguments[0];
92 var b = context.EvaluatedArguments[1];
93 return context.Result(a.Add(b));
void ScalarWithTwoArgument()
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
Defines a routine that is a function, that means it returns a value after its execution.
static DataObject Number(SqlNumber value)
void ScalarWithNoArguments()
ISqlObject Value
Gets the underlined value that is handled.
static DataObject String(string s)
Represents the result of the execution of a routine.
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
DataObject ReturnValue
If the context of the result is a function, gets the return value of the function.
long IConvertible. ToInt64(IFormatProvider provider)
IFunction ResolveFunction(Invoke invoke, IQuery query)
static DataObject BigInt(long value)
static StringType String()