public void AddAddress() { var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null); var addressId = Guid.NewGuid(); sut.AddDefaultFavoriteAddress(new DefaultFavoriteAddress { Id = addressId, Address = new Address { FriendlyName = "Chez François Cuvelier le bg", Apartment = "39398", FullAddress = "1234 rue Saint-Hubert", RingCode = "3131", BuildingName = "Hôtel de Ville", Latitude = 45.515065, Longitude = -73.558064 } }); var addresses = sut.GetDefaultFavoriteAddresses(); Assert.AreEqual(1, addresses.Count(x => x.Id == addressId)); var address = addresses.Single(x => x.Id == addressId); Assert.AreEqual("39398", address.Apartment); Assert.AreEqual("3131", address.RingCode); Assert.AreEqual("1234 rue Saint-Hubert", address.FullAddress); Assert.AreEqual("Hôtel de Ville", address.BuildingName); Assert.AreEqual(45.515065, address.Latitude); Assert.AreEqual(-73.558064, address.Longitude); }
public override void Setup() { base.Setup(); CreateAndAuthenticateTestAdminAccount().Wait(); var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null); sut.AddDefaultFavoriteAddress(new DefaultFavoriteAddress { Id = (_knownAddressId = Guid.NewGuid()), Address = new Address { FriendlyName = "La Boite à Jojo le barjo", FullAddress = "1234 rue Saint-Denis", Latitude = 45.515065, Longitude = -73.558064 } }); }
public void AddInvalidAddress() { var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null); Assert.Throws <WebServiceException>(() => sut.AddDefaultFavoriteAddress(new DefaultFavoriteAddress())); }