Пример #1
0
        public void TargetOnEntityTypeReturnsCorrectSkipSupportedValue(EdmVocabularyAnnotationSerializationLocation location)
        {
            // Arrange
            const string template = @"
                <Annotations Target=""NS.Calendar"">
                  {0}
                </Annotations>";

            IEdmModel model = GetEdmModel(template, location);

            Assert.NotNull(model); // guard

            IEdmEntityType calendar = model.SchemaElements.OfType <IEdmEntityType>().First(c => c.Name == "Calendar");

            Assert.NotNull(calendar); // guard

            // Act
            SkipSupported skip   = new SkipSupported();
            bool          result = skip.Load(model, calendar);

            // Assert
            Assert.True(result);
            Assert.False(skip.IsSupported);
            Assert.NotNull(skip.Supported);
            Assert.False(skip.Supported.Value);
        }
Пример #2
0
        public void TargetOnEntitySetReturnsCorrectSkipSupportedValue(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
            SkipSupported skip   = new SkipSupported();
            bool          result = skip.Load(model, calendars);

            // Assert
            Assert.True(result);
            Assert.NotNull(skip.Supported);
            Assert.False(skip.Supported.Value);
        }
Пример #3
0
        public void UnknownAnnotatableTargetReturnsDefaultSkipSupportedValues()
        {
            // Arrange
            SkipSupported skip       = new SkipSupported();
            EdmEntityType entityType = new EdmEntityType("NS", "Entity");

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

            // Assert
            Assert.False(result);
            Assert.True(skip.IsSupported);
            Assert.Null(skip.Supported);
        }