public async void AddAddress()
        {
            var sut = new AccountServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);

            var addressId = Guid.NewGuid();
            await sut.AddFavoriteAddress(new SaveAddress
            {
                Id      = addressId,
                Address = new Address
                {
                    FriendlyName = "Chez François Cuvelier",
                    Apartment    = "3939",
                    FullAddress  = "1234 rue Saint-Hubert",
                    RingCode     = "3131",
                    BuildingName = "Hôtel de Ville",
                    Latitude     = 45.515065,
                    Longitude    = -73.558064
                }
            });

            var addresses = await sut.GetFavoriteAddresses();

            Assert.AreEqual(1, addresses.Count(x => x.Id == addressId));
            var address = addresses.Single(x => x.Id == addressId);

            Assert.AreEqual("3939", 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()
        {
            _knownAddressId = Guid.NewGuid();
            base.Setup();
            var sut = new AccountServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);

            sut.AddFavoriteAddress(new SaveAddress
            {
                Id      = _knownAddressId,
                Address = new Address
                {
                    FriendlyName = "La Boite à Jojo",
                    FullAddress  = "1234 rue Saint-Denis",
                    Latitude     = 45.515065,
                    Longitude    = -73.558064
                }
            }).Wait();
        }
        public void AddInvalidAddress()
        {
            var sut = new AccountServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);

            Assert.Throws <WebServiceException>(async() => await sut.AddFavoriteAddress(new SaveAddress()));
        }
        public async void when_save_a_favorite_address_with_an_historic_address_existing()
        {
            //Arrange
            var newAccount = await CreateAndAuthenticateTestAccount();

            var orderService = new OrderServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
            var sut          = new AccountServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
            var order        = new CreateOrderRequest
            {
                Id            = Guid.NewGuid(),
                PickupDate    = DateTime.Now,
                PickupAddress =
                    new Address
                {
                    FullAddress  = "1236 Rue St-Hubert, Montréal, QC H2L 2W1, Canada",
                    StreetNumber = "1236",
                    Street       = "Rue St-Hubert",
                    City         = "Montréal",
                    ZipCode      = "H2L 2W1",
                    State        = "QC",
                    Apartment    = "3939",
                    RingCode     = "3131",
                    Latitude     = 45.515065,
                    Longitude    = -73.558064,
                },
                DropOffAddress =
                    new Address
                {
                    FullAddress  = "426 Rue Saint Gabriel, Montréal, QC H2Y 2W1, Canada",
                    StreetNumber = "426",
                    Street       = "Rue Saint Gabriel",
                    City         = "Montréal",
                    ZipCode      = "H2Y 2W1",
                    State        = "QC",
                    Latitude     = 45.50643,
                    Longitude    = -73.554052
                },
                Settings = new BookingSettings
                {
                    ChargeTypeId  = ChargeTypes.PaymentInCar.Id,
                    VehicleTypeId = 1,
                    ProviderId    = Provider.ApcuriumIbsProviderId,
                    Phone         = "5145551212",
                    Country       = new CountryISOCode("CA"),
                    Passengers    = 6,
                    NumberOfTaxi  = 1,
                    Name          = "Joe Smith"
                },
                Estimate = new RideEstimate
                {
                    Distance = 3,
                    Price    = 10
                },
                ClientLanguageCode = "en"
            };
            await orderService.CreateOrder(order);

            //Act
            var addressId = Guid.NewGuid();
            await sut.AddFavoriteAddress(new SaveAddress
            {
                Id      = addressId,
                Address = new Address
                {
                    FriendlyName = "La Boite à Jojo",
                    FullAddress  = "1234 rue Saint-Denis",
                    Latitude     = 45.515065,
                    Longitude    = -73.558064,
                    Apartment    = "3939",
                    RingCode     = "3131"
                }
            });

            //Assert
            var addresses = await sut.GetHistoryAddresses(newAccount.Id);

            Assert.IsFalse(addresses.Any(x => x.Id.Equals(addressId)));
        }