Пример #1
0
        public async void ReadmeTest()
        {
            const int    someShopId = 123;
            const string someToken  = "4843094390fdskldgsfkldkljKLLKklfdkldsffds";

            _httpTest
            .RespondWithJson(Moqs.MockSearchResultWithManyOrder());

            var client = new EcwidClient();
            var result = await client.Configure(someShopId, someToken).Orders
                         .Limit(10)
                         .CreatedFrom(DateTime.Today)
                         .PaymentStatuses("PAID")
                         .GetAsync();

            Assert.Equal(10, result.Count);
        }
Пример #2
0
        public async void OrdersGetOrdersAsyncQueryOnePagesResult()
        {
            const int    count = 100;
            const string query = "limit=100&paymentStatus=paid";

            _httpTest
            .RespondWithJson(Moqs.MockSearchResultWithManyOrderAndPages(count, 0, count));

            var result = await _client.GetOrdersAsync(new { limit = count, paymentStatus = "paid" });


            _httpTest.ShouldHaveCalled($"{CheckOrdersUrl}&{query}")
            .WithVerb(HttpMethod.Get)
            .Times(1);

            _httpTest.ShouldNotHaveCalled($"{CheckOrdersUrl}&offset=*&{query}");

            Assert.Equal(count, result.Count);
        }