Пример #1
0
        public void AndFluentIsSatisfiedByTest(int number, bool result)
        {
            // arrange
            var sut = new Specification<int>(x => x < 10);

            // act
            var isSatisfiedBy = sut.And(y => y > 5).IsSatisfiedBy().Compile().Invoke(number);

            // assert
            Assert.Equal(result, isSatisfiedBy);
        }
Пример #2
0
        public void AndFluentWithThreeOperators(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 == 5);
            var d = new Specification<int>(w => w > 4);

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

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