Пример #1
0
        public void NotSpecificationTest(string name)
        {
            var trueSpec = new SpecificationBase <SimpleTestObject>(t => t.Name == name);

            var falseSpec = !trueSpec;

            Assert.True(trueSpec.IsSatisfiedBy(SimpleTestObject.Create_For_Test_Where_Count_Is_Five_And_Name_Is_Name()));
            Assert.False(falseSpec.IsSatisfiedBy(SimpleTestObject.Create_For_Test_Where_Count_Is_Five_And_Name_Is_Name()));

            Assert.True(trueSpec.IsSatisfiedBy(SimpleTestObject.Create_For_Test_Where_Count_Is_Five_And_Name_Is_Name()));
            Assert.False(trueSpec.Not().IsSatisfiedBy(SimpleTestObject.Create_For_Test_Where_Count_Is_Five_And_Name_Is_Name()));
        }