예제 #1
0
        public void OrFluentWithThreeOperators(int number, bool result)
        {
            // arrange
            var a = new Specification<int>(x => x < 10);
            var b = new Specification<int>(y => y < 20);
            var c = new Specification<int>(z => z == 30);
            var d = new Specification<int>(w => w == 40);

            // act
            var isSatisfiedBy =
                a
                .Or(b)
                .Or(c)
                .Or(d)
                .IsSatisfiedBy().Compile().Invoke(number);

            // assert
            Assert.Equal(result, isSatisfiedBy);
        }
예제 #2
0
        public void OrFluentWithSpecificationIsSatisfiedByTest(int number, bool result)
        {
            // arrange
            var sut = new Specification<int>(x => x < 10);
            var main = new Specification<int>(y => y < 7);

            // act
            var isSatisfiedBy = sut.Or(main).IsSatisfiedBy().Compile().Invoke(number);

            // assert
            Assert.Equal(result, isSatisfiedBy);
        }