Пример #1
0
        public void AllowsCollectionToBeFilteredBySpecificationWithAllOperator()
        {
            var testObject = new TestObject()
            {
                Collection = new List <TestObject>()
                {
                    new TestObject()
                    {
                        BooleanProperty = true
                    },
                    new TestObject()
                    {
                        BooleanProperty = true
                    }
                }
            };

            var specification = new TestObjectSpecification()
                                .CollectionAny(p => p.BooleanProperty(true))
                                .CollectionAll(p => p.BooleanProperty(true));

            var expectedResult = true;

            EFSpecificationTester.TestSpecification(specification, testObject, expectedResult);
        }
Пример #2
0
        public void WhenSpecificationForCollectionAllIsEmptyOmitSpecification()
        {
            var testObject = new TestObject();

            var specification = new TestObjectSpecification()
                                .CollectionAll(p => { });

            var expectedResult = true;

            EFSpecificationTester.TestSpecification(specification, testObject, expectedResult);
        }
Пример #3
0
        public void WhenSpecificationForPropertyIsEmptyOmitSpecification()
        {
            var testObject = new TestObject();

            var specification = new TestObjectSpecification()
                                .ByProperty(p => {});

            var expectedResult = true;

            EFSpecificationTester.TestSpecification(specification, testObject, expectedResult);
        }
Пример #4
0
        public void AllowsPropertyToBeFilteredBySpecification()
        {
            var testObject = new TestObject()
            {
                Property = new TestObject()
                {
                    BooleanProperty = true
                }
            };

            var specification = new TestObjectSpecification()
                                .ByProperty(p => p.BooleanProperty(true));

            var expectedResult = true;

            EFSpecificationTester.TestSpecification(specification, testObject, expectedResult);
        }