private static void AssertAddressCleaned(AreaAddress address) { Assert.AreEqual("a1", address.Address1); Assert.AreEqual("a2", address.Address2); Assert.AreEqual("a3", address.Address3); Assert.AreEqual("a4", address.Address4); Assert.AreEqual("cb1", address.Postcode); }
private static AreaAddress AreaAddress() { var address = new AreaAddress { Address1 = "a", Address2 = "b", Address3 = "c", Address4 = "d" }; return address; }
public void TestCleanAddressOfTrailingCommas() { AreaAddress address = new AreaAddress { Address1 = "a1,", Address2 = "a2,", Address3 = "a3,", Address4 = "a4,", Postcode = "cb1," }; address.CleanAddress(); AssertAddressCleaned(address); }
public void TestCleanAddressOfLeadingAndTrailingSpaces() { AreaAddress address = new AreaAddress { Address1 = " a1 ", Address2 = " a2 ", Address3 = " a3 ", Address4 = " a4 ", Postcode = " cb1 " }; address.CleanAddress(); AssertAddressCleaned(address); }
public AddressStringifier(AreaAddress areaAddress) { this.address = areaAddress; }
private static void ExpectString(AreaAddress address, string expectedAddressString) { var addressString = new AddressStringifier(address).AddressWithoutPostcode; Assert.AreEqual(expectedAddressString, addressString); }