public void IsSatisfiedByWithMessagesTest2() { var left = new ExpressionSpecification <String>(x => true); var right = new ExpressionSpecification <String>(x => false); var target = new XOrSpecification <String>(left, right); var actaul = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Equal(0, actaul.Count); }
public void IsSatisfiedByWithMessagesTest6() { var left = new ExpressionSpecification <String>(x => true, "msgLeft"); var right = new ExpressionSpecification <String>(x => false, "msgRight"); var target = new XOrSpecification <String>(left, right); var actaul = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Empty(actaul); }
public void IsSatisfiedByWithMessagesTest4() { var left = new ExpressionSpecification <String>(x => true, "msgLeft"); var right = new ExpressionSpecification <String>(x => true, "msgRight"); var target = new XOrSpecification <String>(left, right); var actaul = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Single(actaul); Assert.Equal("The given object matches both specifications.", actaul[0]); }
public void IsSatisfiedByWithMessagesTest() { var left = new ExpressionSpecification <String>(x => true); var right = new ExpressionSpecification <String>(x => true); var target = new XOrSpecification <String>(left, right); var actaul = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Equal(1, actaul.Count); Assert.Equal(actaul[0], "The given object matches both specifications."); }
public void IsSatisfiedByWithMessagesTest7() { var left = new ExpressionSpecification <String>(x => false, "msgLeft"); var right = new ExpressionSpecification <String>(x => false, "msgRight"); var target = new XOrSpecification <String>(left, right); var actaul = target.IsSatisfiedByWithMessages(String.Empty) .ToList(); Assert.Equal(2, actaul.Count); Assert.Equal(1, actaul.Count(x => x == "msgLeft")); Assert.Equal(1, actaul.Count(x => x == "msgRight")); }
public void IsSatisfiedByWithMessagesTestCase7() { var left = new ExpressionSpecification<String>( x => false, "msgLeft" ); var right = new ExpressionSpecification<String>( x => false, "msgRight" ); var target = new XOrSpecification<String>( left, right ); var actaul = target.IsSatisfiedByWithMessages( String.Empty ) .ToList(); Assert.AreEqual( 2, actaul.Count ); Assert.AreEqual( 1, actaul.Count( x => x == "msgLeft" ) ); Assert.AreEqual( 1, actaul.Count( x => x == "msgRight" ) ); }
public void IsSatisfiedByWithMessagesTestCase4() { var left = new ExpressionSpecification<String>( x => true, "msgLeft" ); var right = new ExpressionSpecification<String>( x => true, "msgRight" ); var target = new XOrSpecification<String>( left, right ); var actaul = target.IsSatisfiedByWithMessages( String.Empty ) .ToList(); Assert.AreEqual( 1, actaul.Count ); Assert.AreEqual( actaul[0], "The given object matches both specifications." ); }
public void IsSatisfiedByWithMessagesTestCase3() { var left = new ExpressionSpecification<String>( x => false ); var right = new ExpressionSpecification<String>( x => false ); var target = new XOrSpecification<String>( left, right ); var actaul = target.IsSatisfiedByWithMessages( String.Empty ) .ToList(); Assert.AreEqual( 2, actaul.Count ); Assert.IsNull( actaul[0] ); Assert.IsNull( actaul[1] ); }