Exemplo n.º 1
0
        public async void GetUserProfile_ForValidToken_ReturnsUserUserActivity()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetUserProfileAsync();

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <Promotion>(response.Data);
        }
Exemplo n.º 2
0
        public async void GetUserProfile_ForInvalidToken_ReturnsError()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetUserProfileAsync();

            Assert.NotNull(response);
            Assert.Null(response.Data);
            Assert.NotNull(response.Error);
        }
Exemplo n.º 3
0
        public async void GetRequestDetails_ForValidParameters_ReturnsError()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetRequestDetailsAsync("INVALID");

            Assert.NotNull(response);
            Assert.Null(response.Data);
            Assert.NotNull(response.Error);
        }
Exemplo n.º 4
0
        public async void GetUserActivity_ForInvalidParameters_ReturnsError()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetUserActivityAsync(0, -1);

            Assert.NotNull(response);
            Assert.Null(response.Data);
            Assert.NotNull(response.Error);
        }
Exemplo n.º 5
0
        public async void GetPromotion_ForInvalidParameters_ReturnsError()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetPromotionAsync(
                TestLocations.WhiteHouseLatitude, TestLocations.WhiteHouseLongitude,
                TestLocations.SouthPoleLatitude, TestLocations.SouthPoleLongitude);

            Assert.NotNull(response);
            Assert.Null(response.Data);
            Assert.NotNull(response.Error);
        }
Exemplo n.º 6
0
        public async void GetPromotion_ForValidParameters_ReturnsPromotion()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetPromotionAsync(
                TestLocations.WhiteHouseLatitude, TestLocations.WhiteHouseLongitude,
                TestLocations.CapitalLatitude, TestLocations.CapitalLongitude);

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <Promotion>(response.Data);
        }
Exemplo n.º 7
0
        public async void GetRequestDetails_ForValidParameters_ReturnsRequestDetails()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var allRequests = await uberClient.GetUserActivityAsync(0, 50);

            var response = await uberClient.GetRequestDetailsAsync(allRequests.Data.History.First().Id);

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <RequestDetails>(response.Data);
        }
Exemplo n.º 8
0
        public async void GetProducts_ForInvalidParameters_ReturnsEmptyList()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetProductsAsync(
                TestLocations.SouthPoleLatitude, TestLocations.SouthPoleLongitude);

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <ProductCollection>(response.Data);
            Assert.NotNull(response.Data.Products);
            Assert.Empty(response.Data.Products);
        }
Exemplo n.º 9
0
        public async void Request_ForValidParameters_ReturnsRequest()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.RequestAsync(
                "893b94af-ca9d-4f0f-9201-6d426cedaa5c",
                TestLocations.WhiteHouseLatitude, TestLocations.WhiteHouseLongitude,
                TestLocations.CapitalLatitude, TestLocations.CapitalLongitude);

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <Request>(response.Data);
        }
Exemplo n.º 10
0
        public async void GetTimeEstimate_ForValidDefaultParameters_ReturnsListOfPriceEstimates()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetTimeEstimateAsync(
                TestLocations.WhiteHouseLatitude, TestLocations.WhiteHouseLongitude);

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <TimeEstimateCollection>(response.Data);
            Assert.NotNull(response.Data.TimeEstimates);
            Assert.NotEmpty(response.Data.TimeEstimates);
            Assert.NotNull(response.Data.TimeEstimates[0].ProductId);
            Assert.NotEmpty(response.Data.TimeEstimates[0].ProductId);
        }
Exemplo n.º 11
0
        public async void GetProducts_ForValidParameters_ReturnsListOfProducts()
        {
            var uberClient = new ClientAuthenticatedUberRiderService(_clientToken, _sandboxUrl);

            var response = await uberClient.GetProductsAsync(
                TestLocations.WhiteHouseLatitude, TestLocations.WhiteHouseLongitude);

            Assert.NotNull(response);
            Assert.NotNull(response.Data);
            Assert.IsType <ProductCollection>(response.Data);
            Assert.NotNull(response.Data.Products);
            Assert.NotEmpty(response.Data.Products);
            Assert.NotNull(response.Data.Products[0].DisplayName);
            Assert.NotEmpty(response.Data.Products[0].DisplayName);
        }