本文整理汇总了C#中ExpressionSpecification.And方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionSpecification.And方法的具体用法?C# ExpressionSpecification.And怎么用?C# ExpressionSpecification.And使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionSpecification
的用法示例。
在下文中一共展示了ExpressionSpecification.And方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AndTestCase3
public void AndTestCase3()
{
var left = new ExpressionSpecification<String>( x => false );
var target = left.And( x => false );
var actual = target.IsSatisfiedBy( String.Empty );
Assert.IsFalse( actual );
}
示例2: AndTestCaseNullCheck
public void AndTestCaseNullCheck()
{
var target = new ExpressionSpecification<String>( x => false );
ExpressionSpecification<String> other = null;
Action test = () => target.And( other );
test.ShouldThrow<ArgumentNullException>();
}
示例3: AndTestCase3
public void AndTestCase3()
{
var target = new ExpressionSpecification<String>( x => false );
var other = new ExpressionSpecification<String>( x => false );
var actual = target.And( other );
var result = actual.IsSatisfiedBy( String.Empty );
Assert.IsFalse( result );
}
示例4: AndTestCase1
public void AndTestCase1()
{
var left = new ExpressionSpecification<String>( x => true );
var target = left.And( x => false );
var actual = target.IsSatisfiedBy( String.Empty );
actual.Should()
.BeFalse();
}
示例5: AndTestCase11
public void AndTestCase11()
{
var left = new ExpressionSpecification<String>( x => false, "msgLeft" );
var target = left.And( x => false, "msgRight" );
var actual = target.IsSatisfiedByWithMessages( String.Empty )
.ToList();
actual.Should()
.HaveCount( 2 );
actual.Should()
.Contain( "msgLeft", "msgRight" );
}
示例6: AndTestCase5
public void AndTestCase5()
{
var left = new ExpressionSpecification<String>( x => true );
var target = left.And( x => false );
var actual = target.IsSatisfiedByWithMessages( String.Empty )
.ToList();
Assert.AreEqual( 1, actual.Count() );
Assert.IsNull( actual[0] );
}
示例7: AndTestCase4
public void AndTestCase4()
{
var left = new ExpressionSpecification<String>( x => true );
var target = left.And( x => true );
var actual = target.IsSatisfiedByWithMessages( String.Empty );
Assert.AreEqual( 0, actual.Count() );
}
示例8: AndTestCaseNullCheck1
public void AndTestCaseNullCheck1()
{
var left = new ExpressionSpecification<String>( x => true );
Func<String, Boolean> expression = null;
Action test = () => left.And( expression );
test.ShouldThrow<ArgumentNullException>();
}