Esempio n. 1
0
        public void ToPagedResultMiddlePageHasFirstAndNextAndPreviousAndLastLink()
        {
            var accessor = GetActionContextAccessorWithLinkProvider();

            PageOptionsExtensions.Configure(accessor.Object);

            var pageOptions = new PageOptions()
            {
                Page = 2, PageSize = 10
            };
            var result = pageOptions.ToPagedResult(new List <Object>(), 40, "test", new object[] { });

            Assert.NotNull(result.Links.First);
            Assert.NotNull(result.Links.Previous);
            Assert.NotNull(result.Links.Next);
            Assert.NotNull(result.Links.Last);
        }
Esempio n. 2
0
        public void ToPagedResultWithoutCallingConfigureThrowsException()
        {
            var pageOptions = new PageOptions();

            Assert.Throws <TypeInitializationException>(() => pageOptions.ToPagedResult(new List <Object>(), 0, "test"));
        }