コード例 #1
0
        public void UnknownAnnotatableTargetReturnsDefaultFilterRestrictionsValues()
        {
            // Arrange
            FilterRestrictions filter     = new FilterRestrictions();
            EdmEntityType      entityType = new EdmEntityType("NS", "Entity");

            //  Act
            bool result = filter.Load(EdmCoreModel.Instance, entityType);

            // Assert
            Assert.False(result);
            Assert.True(filter.IsFilterable);
            Assert.Null(filter.Filterable);
            Assert.Null(filter.RequiresFilter);
            Assert.Null(filter.RequiredProperties);
            Assert.Null(filter.NonFilterableProperties);
        }
コード例 #2
0
        public void TargetOnEntitySetReturnsCorrectFilterRestrictionsValue(EdmVocabularyAnnotationSerializationLocation location)
        {
            // Arrange
            const string template = @"
                <Annotations Target=""NS.Default/Calendars"">
                  {0}
                </Annotations>";

            IEdmModel model = GetEdmModel(template, location);

            Assert.NotNull(model); // guard

            IEdmEntitySet calendars = model.EntityContainer.FindEntitySet("Calendars");

            Assert.NotNull(calendars); // guard

            // Act
            FilterRestrictions filter = new FilterRestrictions();
            bool result = filter.Load(model, calendars);

            // Assert
            Assert.True(result);
            VerifyFilterRestrictions(filter);
        }