public void TargetOnEntitySetReturnsCorrectExpandRestrictionsValue(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 // Act ExpandRestrictions expand = new ExpandRestrictions(); bool result = expand.Load(model, calendars); // Assert Assert.True(result); VerifyExpandRestrictions(expand); }
public void UnknownAnnotatableTargetReturnsDefaultExpandRestrictionsValues() { // Arrange ExpandRestrictions expand = new ExpandRestrictions(); EdmEntityType entityType = new EdmEntityType("NS", "Entity"); // Act bool result = expand.Load(EdmCoreModel.Instance, entityType); // Assert Assert.False(result); Assert.Equal(CapabilitesTermKind.ExpandRestrictions, expand.Kind); Assert.True(expand.IsExpandable); Assert.Null(expand.Expandable); Assert.Null(expand.NonExpandableProperties); }