public void TrySetPropertyValue_IfPropertyDoesNotExist_DoesNotUpdateGetChangedPropertyNames() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); var edmObject = new TestEdmStructuredObject(edmType); edmObject.TrySetPropertyValue("NotPresentProperty", 42); Assert.DoesNotContain("Property", edmObject.GetChangedPropertyNames()); }
public void TrySetPropertyValue_ReturnsFalse_IfPropertyDoesNotExist() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); var edmObject = new TestEdmStructuredObject(edmType); bool result = edmObject.TrySetPropertyValue("NotPresentProperty", 42); Assert.False(result); }
public void TrySetPropertyValue_IfPropertyExists_UpdatesGetChangedPropertyNames() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty("Property", EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); edmObject.TrySetPropertyValue("Property", 42); Assert.Contains("Property", edmObject.GetChangedPropertyNames()); }
public void TrySetPropertyValue_ReturnsTrue_IfPropertyExists() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty("Property", EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); bool result = edmObject.TrySetPropertyValue("Property", 42); Assert.True(result); }
public void TryGetPropertyValue_After_TrySetPropertyValue() { string propertyName = "Property"; EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty(propertyName, EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); object propertyValue = new object(); object result; edmObject.TrySetPropertyValue(propertyName, propertyValue); edmObject.TryGetPropertyValue(propertyName, out result); Assert.Same(propertyValue, result); }
public void TryGetPropertyValue_After_TrySetPropertyValue() { string propertyName = "Property"; EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty(propertyName, EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); object propertyValue = new object(); object result; edmObject.TrySetPropertyValue(propertyName, propertyValue); edmObject.TryGetPropertyValue(propertyName, out result); Assert.Same(propertyValue, result); }
public void TrySetPropertyValue_IfPropertyDoesNotExist_DoesNotUpdateGetChangedPropertyNames() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); var edmObject = new TestEdmStructuredObject(edmType); edmObject.TrySetPropertyValue("NotPresentProperty", 42); Assert.DoesNotContain("Property", edmObject.GetChangedPropertyNames()); }
public void TrySetPropertyValue_ReturnsFalse_IfPropertyDoesNotExist() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); var edmObject = new TestEdmStructuredObject(edmType); bool result = edmObject.TrySetPropertyValue("NotPresentProperty", 42); Assert.False(result); }
public void TrySetPropertyValue_IfPropertyExists_UpdatesGetChangedPropertyNames() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty("Property", EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); edmObject.TrySetPropertyValue("Property", 42); Assert.Contains("Property", edmObject.GetChangedPropertyNames()); }
public void TrySetPropertyValue_ReturnsTrue_IfPropertyExists() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty("Property", EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); bool result = edmObject.TrySetPropertyValue("Property", 42); Assert.True(result); }