Esempio n. 1
0
        public void UnknownAnnotatableTargetReturnsDefaultDeleteRestrictionsValues()
        {
            // Arrange
            DeleteRestrictions delete     = new DeleteRestrictions();
            EdmEntityType      entityType = new EdmEntityType("NS", "Entity");

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

            // Assert
            Assert.False(result);
            Assert.True(delete.IsDeletable);
            Assert.Null(delete.Deletable);
            Assert.Null(delete.NonDeletableNavigationProperties);
        }
Esempio n. 2
0
        public void TargetOnEntitySetReturnsCorrectDeleteRestrictionsValue(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
            DeleteRestrictions delete = new DeleteRestrictions();
            bool result = delete.Load(model, calendars);

            // Assert
            Assert.True(result);
            VerifyDeleteRestrictions(delete);
        }