public void Convert_IfOtherPropertyIsPrivate_Ignores() { // Arrange const string expectedPartitionKey = "PK"; IConverter <TableEntity, PocoWithPrivateOtherProperty> product = CreateProductUnderTest <PocoWithPrivateOtherProperty>(); TableEntity entity = new TableEntity { PartitionKey = expectedPartitionKey, ["OtherProperty"] = 456 }; // Act PocoWithPrivateOtherProperty actual = product.Convert(entity); // Assert Assert.NotNull(actual); Assert.Null(actual.OtherPropertyPublic); Assert.AreSame(expectedPartitionKey, actual.PartitionKey); }
public void Convert_IfOtherPropertyIsPrivate_Ignores() { // Arrange const string expectedPartitionKey = "PK"; IConverter <PocoWithPrivateOtherProperty, TableEntity> product = CreateProductUnderTest <PocoWithPrivateOtherProperty>(); PocoWithPrivateOtherProperty input = new PocoWithPrivateOtherProperty { PartitionKey = expectedPartitionKey, OtherPropertyPublic = 456 }; // Act TableEntity actual = product.Convert(input); // Assert Assert.NotNull(actual); Assert.NotNull(actual); Assert.False(actual.ContainsKey("OtherProperty")); Assert.AreSame(expectedPartitionKey, actual.PartitionKey); }
public void Convert_IfOtherPropertyIsPrivate_Ignores() { // Arrange const string expectedPartitionKey = "PK"; IConverter <ITableEntity, PocoWithPrivateOtherProperty> product = CreateProductUnderTest <PocoWithPrivateOtherProperty>(); DynamicTableEntity entity = new DynamicTableEntity { PartitionKey = expectedPartitionKey, Properties = new Dictionary <string, EntityProperty> { { "OtherProperty", new EntityProperty(456) } } }; // Act PocoWithPrivateOtherProperty actual = product.Convert(entity); // Assert Assert.NotNull(actual); Assert.Null(actual.OtherPropertyPublic); Assert.Same(expectedPartitionKey, actual.PartitionKey); }
public void Convert_IfOtherPropertyIsPrivate_Ignores() { // Arrange const string expectedPartitionKey = "PK"; IConverter <PocoWithPrivateOtherProperty, ITableEntity> product = CreateProductUnderTest <PocoWithPrivateOtherProperty>(); PocoWithPrivateOtherProperty input = new PocoWithPrivateOtherProperty { PartitionKey = expectedPartitionKey, OtherPropertyPublic = 456 }; // Act ITableEntity actual = product.Convert(input); // Assert Assert.NotNull(actual); IDictionary <string, EntityProperty> properties = actual.WriteEntity(operationContext: null); Assert.NotNull(properties); Assert.False(properties.ContainsKey("OtherProperty")); Assert.Same(expectedPartitionKey, actual.PartitionKey); }