public void TryGetPropertyValue_ReturnsFalse_IfPropertyDoesNotExist() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); var edmObject = new TestEdmStructuredObject(edmType); object propertyValue; bool result = edmObject.TryGetPropertyValue("NotPresentProperty", out propertyValue); Assert.False(result); }
public void TryGetPropertyValue_ReturnsTrue_IfPropertyExists() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty("Property", EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); object propertyValue; bool result = edmObject.TryGetPropertyValue("Property", out propertyValue); Assert.True(result); }
public void TryGetPropertyValue_Without_TrySetPropertyValue_ReturnsDefault() { string propertyName = "Property"; EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty(propertyName, EdmPrimitiveTypeKind.Int32, isNullable: false); var edmObject = new TestEdmStructuredObject(edmType); object result; edmObject.TryGetPropertyValue(propertyName, out result); Assert.Equal(0, 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_Without_TrySetPropertyValue_ReturnsDefault() { string propertyName = "Property"; EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty(propertyName, EdmPrimitiveTypeKind.Int32, isNullable: false); var edmObject = new TestEdmStructuredObject(edmType); object result; edmObject.TryGetPropertyValue(propertyName, out result); Assert.Equal(0, 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_ReturnsFalse_IfPropertyDoesNotExist() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); var edmObject = new TestEdmStructuredObject(edmType); object propertyValue; bool result = edmObject.TryGetPropertyValue("NotPresentProperty", out propertyValue); Assert.False(result); }
public void TryGetPropertyValue_ReturnsTrue_IfPropertyExists() { EdmComplexType edmType = new EdmComplexType("NS", "Complex"); edmType.AddStructuralProperty("Property", EdmPrimitiveTypeKind.Int32); var edmObject = new TestEdmStructuredObject(edmType); object propertyValue; bool result = edmObject.TryGetPropertyValue("Property", out propertyValue); Assert.True(result); }