Exemplo n.º 1
0
        public void TestAbstractResourceGroupBy()
        {
            var resource = new PersonResource();
            resource.SetGroupBy("cpr");

            var result = resource.Build();

            Assert.That(resource.GetCount() == 1);
            Assert.That(resource.GetCountTotal() == 1);
        }
Exemplo n.º 2
0
        public void TestAbstractResourceGroupBy()
        {
            var resource = new PersonResource();

            resource.SetGroupBy("cpr");

            var result = resource.Build();

            Assert.That(resource.GetCount() == 1);
            Assert.That(resource.GetCountTotal() == 1);
        }
Exemplo n.º 3
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");
        }
Exemplo n.º 4
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");
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        public void TestPersonResource()
        {
            var resource = new PersonResource();

            resource.SetFirstname("Henrik");
            resource.SetLastname("Haugbølle");
            resource.SetCpr("0123456789");
            resource.SetVoterId(3306);
            resource.SetPollingVenue("Venue of Awesome");
            resource.SetPollingTable("Table of Win");

            var result = resource.Build();

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

            Assert.That(result[0].Firstname == "Henrik");
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        public void TestPersonResource()
        {
            var resource = new PersonResource();
            resource.SetFirstname("Henrik");
            resource.SetLastname("Haugbølle");
            resource.SetCpr("0123456789");
            resource.SetVoterId(3306);
            resource.SetPollingVenue("Venue of Awesome");
            resource.SetPollingTable("Table of Win");

            var result = resource.Build();

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

            Assert.That(result[0].Firstname == "Henrik");
        }