public void Convert_IfOtherPropertyIsNotPresentInDictionary_DoesNotPopulateOtherProperty() { // Arrange const string expectedPartitionKey = "PK"; IConverter <TableEntity, PocoWithPartitionKeyAndOtherProperty> product = CreateProductUnderTest <PocoWithPartitionKeyAndOtherProperty>(); TableEntity entity = new TableEntity { PartitionKey = expectedPartitionKey }; // Act PocoWithPartitionKeyAndOtherProperty actual = product.Convert(entity); // Assert Assert.NotNull(actual); Assert.Null(actual.OtherProperty); Assert.AreSame(expectedPartitionKey, actual.PartitionKey); }
public void Convert_IfWriteEntityReturnsNull_DoesNotPopulateOtherProperties() { // Arrange const string expectedPartitionKey = "PK"; IConverter <TableEntity, PocoWithPartitionKeyAndOtherProperty> product = CreateProductUnderTest <PocoWithPartitionKeyAndOtherProperty>(); TableEntity entity = new TableEntity { PartitionKey = expectedPartitionKey, }; // TODO: //Assert.Null(entity.WriteEntity(operationContext: null)); // Guard // Act PocoWithPartitionKeyAndOtherProperty actual = product.Convert(entity); // Assert Assert.NotNull(actual); Assert.Null(actual.OtherProperty); Assert.AreSame(expectedPartitionKey, actual.PartitionKey); }