コード例 #1
0
        public void OrTest3()
        {
            var left   = new ExpressionSpecification <String>(x => false);
            var right  = new ExpressionSpecification <String>(x => true);
            var target = new AndSpecification <String>(left, right);

            var actual = target.Or(new ExpressionSpecification <String>(x => false));
            var result = actual.IsSatisfiedBy(String.Empty);

            Assert.False(result);
        }
コード例 #2
0
        public void OrTestNullCheck()
        {
            var left   = new ExpressionSpecification <String>(x => false);
            var right  = new ExpressionSpecification <String>(x => true);
            var target = new AndSpecification <String>(left, right);

            ExpressionSpecification <String> other = null;

            // ReSharper disable once AssignNullToNotNullAttribute
            Action test = () => target.Or(other);

            test.ShouldThrow <ArgumentNullException>();
        }
コード例 #3
0
        public void OrTestCaseNullCheck()
        {
            var left = new ExpressionSpecification<String>( x => false );
            var right = new ExpressionSpecification<String>( x => true );
            var target = new AndSpecification<String>( left, right );

            ExpressionSpecification<String> other = null;
            Action test = () => target.Or( other );

            test.ShouldThrow<ArgumentNullException>();
        }
コード例 #4
0
        public void OrTestCase3()
        {
            var left = new ExpressionSpecification<String>( x => false );
            var right = new ExpressionSpecification<String>( x => true );
            var target = new AndSpecification<String>( left, right );

            var actual = target.Or( new ExpressionSpecification<String>( x => false ) );
            var result = actual.IsSatisfiedBy( String.Empty );
            Assert.IsFalse( result );
        }