コード例 #1
0
        public void TestAbstractResourceLimitAndOffset()
        {
            var resource = new PersonResource();
            resource.SetOffset(1);
            resource.SetLimit(1);
            resource.SetOrder("id", "asc");

            var result = resource.Build();

            Assert.That(resource.GetCount() == 1);
            Assert.That(resource.GetCountTotal() == 3);

            Assert.That(result[0].Firstname == "Christian");
        }
コード例 #2
0
        public void TestAbstractResourceLimitAndOffset()
        {
            var resource = new PersonResource();

            resource.SetOffset(1);
            resource.SetLimit(1);
            resource.SetOrder("id", "asc");

            var result = resource.Build();

            Assert.That(resource.GetCount() == 1);
            Assert.That(resource.GetCountTotal() == 3);

            Assert.That(result[0].Firstname == "Christian");
        }
コード例 #3
0
        public void TestAbstractResourceOrderAndLimit()
        {
            var resource = new PersonResource();

            resource.SetOrder("id", "desc");
            resource.SetLimit(2);

            var result = resource.Build();

            Assert.That(resource.GetCount() == 2);
            Assert.That(resource.GetCountTotal() == 3);

            Assert.That(result[0].DbId == 3);
            Assert.That(result[1].DbId == 2);
        }
コード例 #4
0
        public void TestAbstractResourceOrderAndLimit()
        {
            var resource = new PersonResource();
            resource.SetOrder("id", "desc");
            resource.SetLimit(2);

            var result = resource.Build();

            Assert.That(resource.GetCount() == 2);
            Assert.That(resource.GetCountTotal() == 3);

            Assert.That(result[0].DbId == 3);
            Assert.That(result[1].DbId == 2);
        }