Пример #1
0
        public async Task GetPagedSorted(NextApiTransport transport, OrderOperators firstOrderOperator, string firstProperty,
                                         OrderOperators secondOrderOperator, string secondProperty, int[] result)
        {
            await App.GenerateUsers();

            var userService = ResolveUserService(transport);

            var orders = new List <Order> {
                new Order(firstOrderOperator, firstProperty)
            };

            if (secondProperty != null)
            {
                orders.Add(new Order(secondOrderOperator, secondProperty));
            }

            var paged = new PagedRequest
            {
                Take   = 5,
                Expand = new [] { "City" },
                Orders = orders.ToArray()
            };

            var data = await userService.GetPaged(paged);

            Assert.Equal(15, data.TotalItems);

            for (int i = 0; i < data.Items.Count; i++)
            {
                Assert.Equal(result[i], data.Items[i].Id);
            }
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Order"/> class.
 /// </summary>
 public Order(OrderOperators orderOperator, string property)
 {
     OrderOperator = orderOperator;
     Property      = property;
 }