-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/Predicate_reference_being_a_ContextScalarResolv…
…er_(#537)' into develop
- Loading branch information
Showing
7 changed files
with
136 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
NBi.Testing/Unit/NUnit/Builder/Helper/PredicateArgsBuilderTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using NBi.Core.Calculation.Predicate; | ||
using NBi.Core.Injection; | ||
using NBi.Core.Scalar.Resolver; | ||
using NBi.Core.Variable; | ||
using NBi.NUnit.Builder.Helper; | ||
using NBi.Xml.Constraints.Comparer; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NBi.Testing.Unit.NUnit.Builder.Helper | ||
{ | ||
public class PredicateArgsBuilderTest | ||
{ | ||
[Test] | ||
public void Build_VariableAndFunctions_FunctionScalarResolverArgs() | ||
{ | ||
var predicateXml = new MoreThanXml() | ||
{ | ||
Reference = "#12 | text-to-upper | text-to-first-chars([ColA])" | ||
}; | ||
|
||
var builder = new PredicateArgsBuilder(new ServiceLocator(), new Context(null)); | ||
var args = builder.Execute(Core.ResultSet.ColumnType.Text, predicateXml); | ||
Assert.That(args, Is.AssignableTo<ReferencePredicateArgs>()); | ||
|
||
var typedArgs = args as ReferencePredicateArgs; | ||
Assert.That(typedArgs.Reference, Is.TypeOf<FunctionScalarResolver<string>>()); | ||
|
||
var function = typedArgs.Reference as FunctionScalarResolver<string>; | ||
Assert.That(function.Args.Resolver, Is.TypeOf<ContextScalarResolver<object>>()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters