コード例 #1
0
 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);
 }
コード例 #2
0
 private static AreaAddress AreaAddress()
 {
     var address = new AreaAddress
     {
         Address1 = "a",
         Address2 = "b",
         Address3 = "c",
         Address4 = "d"
     };
     return address;
 }
コード例 #3
0
        public void TestCleanAddressOfTrailingCommas()
        {
            AreaAddress address = new AreaAddress
            {
                Address1 = "a1,",
                Address2 = "a2,",
                Address3 = "a3,",
                Address4 = "a4,",
                Postcode = "cb1,"
            };

            address.CleanAddress();

            AssertAddressCleaned(address);
        }
コード例 #4
0
        public void TestCleanAddressOfLeadingAndTrailingSpaces()
        {
            AreaAddress address = new AreaAddress
            {
                Address1 = " a1 ",
                Address2 = " a2 ",
                Address3 = " a3 ",
                Address4 = " a4 ",
                Postcode = " cb1 "
            };

            address.CleanAddress();

            AssertAddressCleaned(address);
        }
コード例 #5
0
 public AddressStringifier(AreaAddress areaAddress)
 {
     this.address = areaAddress;
 }
コード例 #6
0
 private static void ExpectString(AreaAddress address, string expectedAddressString)
 {
     var addressString = new AddressStringifier(address).AddressWithoutPostcode;
     Assert.AreEqual(expectedAddressString, addressString);
 }