public void GetEntityTypeData_InvalidMap() { // Arrange & Act & Asset Assert.Throws <ArgumentOutOfRangeException>(() => { EntityTypeDataFactory.GetEntityTypeData <AddressInvalidMap>(); }); }
public void GetEntityTypeData_InvalidPropertyMap() { // Act & Assert Assert.Throws <ArgumentException>(() => { var map = EntityTypeDataFactory.GetEntityTypeData <AddressInvalidProperty>(); }); }
public void GetEntityTypeData_IgnorePropertyMap() { // Arrange & Act var map = EntityTypeDataFactory.GetEntityTypeData <AddressIgnoreProperties>(); // Assert Assert.NotNull(map.NameChanges); Assert.Equal(2, map.NameChanges.Count); Assert.Equal("PartitionKey", map.NameChanges["Country"]); Assert.Equal("RowKey", map.NameChanges["Street"]); var entity = (DynamicTableEntity)map.GetEntity(new AddressIgnoreProperties()); Assert.Equal(8, entity.Properties.Count); }
public void CreateEntityTypeDataWithFactory() { // Arrange & Act IEntityTypeData <Country> entityTypeData = EntityTypeDataFactory.GetEntityTypeData <Country>(); // Assert Assert.NotNull(entityTypeData); // Check name changes Assert.NotNull(entityTypeData.NameChanges); Assert.True(entityTypeData.NameChanges.ContainsKey("Continent")); Assert.Equal(entityTypeData.NameChanges["Continent"], "PartitionKey"); Assert.True(entityTypeData.NameChanges.ContainsKey("Continent")); Assert.Equal(entityTypeData.NameChanges["Name"], "RowKey"); }
/// <summary> /// Constructor. /// </summary> public TableEntityConverter() { _typeData = EntityTypeDataFactory.GetEntityTypeData <T>(); }