예제 #1
0
        public void Not_IsFalse()
        {
            // arrange
            var target = new Person {
                Age = 21, Name = "Mike", Gender = "M", MembershipNumber = "1234"
            };
            var isMale       = new IsMale();
            var isClubMember = new IsClubMember();

            // act
            var spec = isClubMember.Not(isMale); // isMale is irrelevant
            var isFemaleOrClubMember = spec.IsSatisfiedBy(target);

            // assert
            Assert.False(isFemaleOrClubMember);
        }
예제 #2
0
        public void Not_IsTrue()
        {
            // arrange
            var target = new Person {
                Age = 21, Name = "Jenn", Gender = "F"
            };
            var isMale       = new IsMale();
            var isClubMember = new IsClubMember();

            // act
            var spec = isClubMember.Not(isMale); // isMale is irrelevant
            var isFemaleOrClubMember = spec.IsSatisfiedBy(target);

            // assert
            Assert.True(isFemaleOrClubMember);
        }