public void Convert_PopulatesOtherProperty() { // Arrange int?expectedOtherProperty = 123; IConverter <PocoWithOtherProperty, ITableEntity> product = CreateProductUnderTest <PocoWithOtherProperty>(); PocoWithOtherProperty input = new PocoWithOtherProperty { OtherProperty = expectedOtherProperty }; // Act ITableEntity actual = product.Convert(input); // Assert Assert.NotNull(actual); IDictionary <string, EntityProperty> properties = actual.WriteEntity(operationContext: null); Assert.NotNull(properties); Assert.True(properties.ContainsKey("OtherProperty")); EntityProperty otherProperty = properties["OtherProperty"]; Assert.NotNull(otherProperty); Assert.Equal(EdmType.Int32, otherProperty.PropertyType); Assert.Equal(expectedOtherProperty, otherProperty.Int32Value); }
public void Convert_PopulatesOtherProperty() { // Arrange int?expectedOtherProperty = 123; IConverter <TableEntity, PocoWithOtherProperty> product = CreateProductUnderTest <PocoWithOtherProperty>(); TableEntity entity = new TableEntity { ["OtherProperty"] = expectedOtherProperty }; // Act PocoWithOtherProperty actual = product.Convert(entity); // Assert Assert.NotNull(actual); Assert.AreEqual(expectedOtherProperty, actual.OtherProperty); }
public void Convert_PopulatesOtherProperty() { // Arrange int?expectedOtherProperty = 123; IConverter <ITableEntity, PocoWithOtherProperty> product = CreateProductUnderTest <PocoWithOtherProperty>(); DynamicTableEntity entity = new DynamicTableEntity { Properties = new Dictionary <string, EntityProperty> { { "OtherProperty", new EntityProperty(expectedOtherProperty) } } }; // Act PocoWithOtherProperty actual = product.Convert(entity); // Assert Assert.NotNull(actual); Assert.Equal(expectedOtherProperty, actual.OtherProperty); }
public void Convert_PopulatesOtherProperty() { // Arrange int?expectedOtherProperty = 123; IConverter <PocoWithOtherProperty, TableEntity> product = CreateProductUnderTest <PocoWithOtherProperty>(); PocoWithOtherProperty input = new PocoWithOtherProperty { OtherProperty = expectedOtherProperty }; // Act TableEntity actual = product.Convert(input); // Assert Assert.NotNull(actual); Assert.NotNull(actual); Assert.True(actual.ContainsKey("OtherProperty")); var otherProperty = actual["OtherProperty"]; Assert.NotNull(otherProperty); Assert.AreEqual(expectedOtherProperty, otherProperty); }