Пример #1
0
        public void CanBuildAddressFromXml()
        {
            // Address to compare against
            var correctAddress = new Address
            {
                Id     = 1,
                Street = "667 Massachusetts Avenue",
                City   = "Cambridge",
                State  = "MA",
                Zip    = "02139"
            };

            // Generate an address from an XML string using the factory method
            var address = AddressParser.ParseAddressFromXml
                          (
                @"<Address>
            <UniqueId>1</UniqueId>
            <Street>667 Massachusetts Avenue</Street>
            <City>Cambridge</City>
            <State>MA</State>
            <Zip>02139</Zip>
          </Address>"
                          );

            Assert.True(address.Equals(correctAddress));
        }