public void op_ToMarketingFormat_KeyStringDictionary_emptyDDL() { var entry = new KeyStringDictionary { { "SBN", string.Empty }, { "BNA", string.Empty }, { "NUM", string.Empty }, { "DST", string.Empty }, { "STM", string.Empty }, { "DDL", string.Empty }, { "DLO", "Wide Area" }, { "PTN", "Postal Town" }, { "PCD", "AA1 2ZZ" }, }; var obj = BritishAddress.ToMarketingFormat(entry); Assert.Equal("Wide Area", obj["ADDRESS 1"]); Assert.Equal("Postal Town", obj["ADDRESS 2"]); Assert.Equal(string.Empty, obj["ADDRESS 3"]); Assert.Equal(string.Empty, obj["ADDRESS 4"]); Assert.Equal(string.Empty, obj["ADDRESS 5"]); Assert.Equal(string.Empty, obj["ADDRESS 6"]); Assert.Equal("AA1 2ZZ", obj["POSTCODE"]); }
public void op_ToMarketingFormat_KeyStringDictionary() { var entry = new KeyStringDictionary { { "SBN", "Flat 1" }, { "BNA", "Tall House" }, { "NUM", "123" }, { "DST", "Little Lane" }, { "STM", "High Street" }, { "DDL", "Local Wood" }, { "DLO", "Wide Area" }, { "PTN", "Postal Town" }, { "PCD", "AA1 2ZZ" }, }; var obj = BritishAddress.ToMarketingFormat(entry); Assert.Equal("Flat 1", obj["ADDRESS 1"]); Assert.Equal("Tall House", obj["ADDRESS 2"]); Assert.Equal("123 Little Lane", obj["ADDRESS 3"]); Assert.Equal("High Street", obj["ADDRESS 4"]); Assert.Equal("Local Wood", obj["ADDRESS 5"]); Assert.Equal("Wide Area", obj["ADDRESS 6"]); Assert.Equal("AA1 2ZZ", obj["POSTCODE"]); }
public void op_ToString() { var expected = string.Empty; var actual = new BritishAddress().ToString(); Assert.Equal(expected, actual); }
public void op_ToString_whenNoCounty() { var obj = new BritishAddress { BuildingName = "Big House", MainStreet = "High Street", PostTown = "Bigton", Postcode = "AB1 2ZZ" }; var expected = "Big House{0}High Street{0}Bigton{0}AB1 2ZZ{0}".FormatWith(Environment.NewLine); var actual = obj.ToString(); Assert.Equal(expected, actual); }
public void op_ToString_whenMainStreetNumber() { var obj = new BritishAddress { BuildingName = "Big House", BuildingNumber = "12", MainStreet = "High Street", PostTown = "Bigton", Postcode = "AB1 2ZZ", TraditionalCounty = "Countyshire" }; var expected = "Big House{0}12 High Street{0}Bigton{0}AB1 2ZZ{0}Countyshire{0}".FormatWith(Environment.NewLine); var actual = obj.ToString(); Assert.Equal(expected, actual); }
public void op_ToString_whenFull() { var obj = new BritishAddress { SubBuildingName = "Flat A", BuildingName = "Big House", PostOfficeBox = "PO Box 123", BuildingNumber = "12", DependentStreet = "Little Close", MainStreet = "High Street", DoubleDependentLocality = "Local Village", DependentLocality = "Locality", PostTown = "Bigton", Postcode = "AB1 2ZZ", TraditionalCounty = "Countyshire" }; var expected = "Flat A{0}Big House{0}PO Box 123{0}12 Little Close{0}High Street{0}Local Village{0}Locality{0}Bigton{0}AB1 2ZZ{0}Countyshire{0}".FormatWith(Environment.NewLine); var actual = obj.ToString(); Assert.Equal(expected, actual); }
public PostalAddressFileEntry() { Address = new BritishAddress(); Organization = new Organization(); }
public void op_ToMarketingFormat_KeyStringDictionaryNull() { Assert.Throws <ArgumentNullException>(() => BritishAddress.ToMarketingFormat(null)); }