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