public void RemoveAnnotation_returns_false_if_annotation_not_found() { var entityType = new EntityType("E", "N", DataSpace.CSpace); var value = new object(); entityType.AddAnnotation("name", value); Assert.False(entityType.RemoveAnnotation("notfound")); }
public void RemoveAnnotation_throws_if_metadata_item_is_readonly() { var entityType = new EntityType("E", "N", DataSpace.CSpace); var value = new object(); entityType.AddAnnotation("name", value); entityType.SetReadOnly(); Assert.Equal( Strings.OperationOnReadOnlyCollection, Assert.Throws <InvalidOperationException>(() => entityType.RemoveAnnotation("name")) .Message); }
public void Can_remove_annotation() { var entityType = new EntityType("E", "N", DataSpace.CSpace); var value = new object(); entityType.AddAnnotation("name", value); Assert.NotEmpty(entityType.Annotations); Assert.True(entityType.RemoveAnnotation("name")); Assert.Empty(entityType.Annotations); }
public void Can_remove_annotation() { var entityType = new EntityType("E", "N", DataSpace.CSpace); var value = new object(); entityType.AddAnnotation("name", value); Assert.NotEmpty(entityType.Annotations); Assert.True(entityType.RemoveAnnotation("name")); Assert.Empty(entityType.Annotations); }
public void RemoveAnnotation_returns_false_if_annotation_not_found() { var entityType = new EntityType("E", "N", DataSpace.CSpace); var value = new object(); entityType.AddAnnotation("name", value); Assert.False(entityType.RemoveAnnotation("notfound")); }
public void RemoveAnnotation_throws_if_metadata_item_is_readonly() { var entityType = new EntityType("E", "N", DataSpace.CSpace); var value = new object(); entityType.AddAnnotation("name", value); entityType.SetReadOnly(); Assert.Equal( Strings.OperationOnReadOnlyCollection, Assert.Throws<InvalidOperationException>(() => entityType.RemoveAnnotation("name")) .Message); }