Пример #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 );
        }