コード例 #1
0
        public void AddAddress()
        {
            var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null);

            var addressId = Guid.NewGuid();

            sut.AddPopularAddress(new PopularAddress
            {
                Id      = addressId,
                Address = new Address
                {
                    FriendlyName = "Chez François Cuvelier le bg popular",
                    Apartment    = "39398",
                    FullAddress  = "1234 rue Saint-Hubert",
                    RingCode     = "3131",
                    BuildingName = "Hôtel de Ville",
                    Latitude     = 45.515065,
                    Longitude    = -73.558064
                }
            });

            var addresses = sut.GetPopularAddresses();

            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);
        }
コード例 #2
0
        public override void Setup()
        {
            base.Setup();
            CreateAndAuthenticateTestAdminAccount().Wait();
            var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null);

            sut.AddPopularAddress(new PopularAddress
            {
                Id      = (_knownAddressId = Guid.NewGuid()),
                Address = new Address
                {
                    FriendlyName = "La Boite à Jojo le barjo popular",
                    FullAddress  = "1234 rue Saint-Denis",
                    Latitude     = 45.515065,
                    Longitude    = -73.558064
                }
            });
        }
コード例 #3
0
        public void AddInvalidAddress()
        {
            var sut = new AdministrationServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null);

            Assert.Throws <WebServiceException>(() => sut.AddPopularAddress(new PopularAddress()));
        }