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"); }
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); }