Ejemplo n.º 1
0
        public virtual void Setup()
        {
            var authResponseTask = new AuthServiceClient(BaseUrl, null, new DummyPackageInfo(), null, null)
                                   .Authenticate(TestAccount.Email, TestAccountPassword);

            authResponseTask.Wait();
            SessionId = authResponseTask.Result.SessionId;
        }
Ejemplo n.º 2
0
        public new void TestFixtureSetup()
        {
            base.TestFixtureSetup();
            var container = UnityServiceLocator.Instance;

            _taxiHailNetworkServiceImplementation = container.Registrations
                                                    .FirstOrDefault(x => x.RegisteredType == typeof(ITaxiHailNetworkServiceClient))
                                                    .MappedToType;

            _orderId = Guid.NewGuid();

            var authTask = new AuthServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null).Authenticate(TestAccount.Email, TestAccountPassword);

            authTask.Wait();
            var auth = authTask.Result;

            SessionId = auth.SessionId;

            var sut   = new OrderServiceClient(BaseUrl, SessionId, new DummyPackageInfo(), null, null);
            var order = new CreateOrderRequest
            {
                Id             = _orderId,
                PickupAddress  = TestAddresses.GetAddress1(),
                DropOffAddress = TestAddresses.GetAddress2(),
                Estimate       = new RideEstimate
                {
                    Price    = 10,
                    Distance = 3
                },
                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",
                    LargeBags     = 1
                },
                ClientLanguageCode = SupportedLanguages.fr.ToString()
            };

            sut.CreateOrder(order).Wait();

            // Wait for IBS order Id to be assigned
            Thread.Sleep(10000);
        }
        public override void TestFixtureSetup()
        {
            base.TestFixtureSetup();

            var authResponseTask = new AuthServiceClient(BaseUrl, null, new DummyPackageInfo(), null, null).Authenticate(TestAccount.Email, TestAccountPassword);

            authResponseTask.Wait();
            var authResponse = authResponseTask.Result;

            _orderId = Guid.NewGuid();
            var sut   = new OrderServiceClient(BaseUrl, authResponse.SessionId, new DummyPackageInfo(), null, null);
            var order = new CreateOrderRequest
            {
                Id             = _orderId,
                PickupAddress  = TestAddresses.GetAddress1(),
                DropOffAddress = TestAddresses.GetAddress2(),
                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 = "fr"
            };

            sut.CreateOrder(order).Wait();
        }