Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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]);
        }