public void LimitTest() { const Int32 EXPECTED = 10; StretchrRequest<String> target = new StretchrRequest<String>(new StretchrClient(), response => { }, (request, statusCode, exception) => { }); target.Limit(EXPECTED); Int32 actual = target.QueryPagingFunctionParameterLimit; Assert.AreEqual(EXPECTED, actual); }
public void ConstructQueryPaginationTestLimit() { const Int32 PAGINATION_LIMIT = 10; IStretchrRequest target = new StretchrRequest<String>(new StretchrClient(), response => { }, (request, statusCode, exception) => { }); target.Limit(PAGINATION_LIMIT); const String EXPECTED = "limit=10"; IList<String> expected = new List<String>(); expected.Add(EXPECTED); PrivateObject privateTarget = new PrivateObject(target); privateTarget.Invoke("ConstructQueryPagination"); IList<String> actual = (IList<String>)privateTarget.GetField("_queryStringFieldValuesList"); Assert.IsNotNull(actual); Assert.AreEqual(expected[0], actual[0]); }