public void UpdateAddress() { var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null); sut.UpdatePopularAddress(new PopularAddress { Id = _knownAddressId, Address = new Address { FriendlyName = "Chez François Cuvelier popular", Apartment = "3939", FullAddress = "1234 rue Saint-Hubert", RingCode = "3131", BuildingName = "Le Manoir playboy", Latitude = 12, Longitude = 34 } }); var address = sut.GetPopularAddresses().Single(x => x.Id == _knownAddressId); Assert.AreEqual("Chez François Cuvelier popular", address.FriendlyName); Assert.AreEqual("3939", address.Apartment); Assert.AreEqual("1234 rue Saint-Hubert", address.FullAddress); Assert.AreEqual("3131", address.RingCode); Assert.AreEqual("Le Manoir playboy", address.BuildingName); Assert.AreEqual(12, address.Latitude); Assert.AreEqual(34, address.Longitude); }
public void UpdateAddressWithInvalidData() { var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null); var ex = Assert.Throws <WebServiceException>(() => sut.UpdatePopularAddress(new PopularAddress { Id = _knownAddressId, Address = new Address { FriendlyName = "Chez François Cuvelier", Apartment = "3939", FullAddress = "1234 rue Saint-Hubert", RingCode = "3131", Latitude = double.NaN, Longitude = double.NaN } })); Assert.AreEqual("InclusiveBetween", ex.Message); }