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 ); }
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() ); }
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] ); }
public void XOrTest9() { var left = new ExpressionSpecification <String>(x => true, "msgLeft"); var target = left.XOr(x => false, "msgRight"); var actual = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Empty(actual); }
public void XOrTest4() { var left = new ExpressionSpecification <String>(x => true); var target = left.XOr(x => true); var actual = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Single(actual); Assert.Equal("The given object matches both specifications.", actual[0]); }
public void XOrTest11() { var left = new ExpressionSpecification <String>(x => false, "msgLeft"); var target = left.XOr(x => false, "msgRight"); var actual = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Equal(2, actual.Count); Assert.Equal(1, actual.Count(x => x == "msgLeft")); Assert.Equal(1, actual.Count(x => x == "msgRight")); }
public void XOrTest7() { var left = new ExpressionSpecification <String>(x => false); var target = left.XOr(x => false); var actual = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Equal(2, actual.Count); Assert.Null(actual[0]); Assert.Null(actual[1]); }
public void XOrTestCaseNullCheck1() { var left = new ExpressionSpecification<String>( x => true ); Func<String, Boolean> expression = null; Action test = () => left.XOr( expression ); test.ShouldThrow<ArgumentNullException>(); }
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] ); }
public void XOrTestCaseNullCheck() { var target = new ExpressionSpecification<String>( x => false ); ExpressionSpecification<String> other = null; Action test = () => target.XOr( other ); test.ShouldThrow<ArgumentNullException>(); }
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 ); }