public void WidgetTest()
        {
            var positionReport         = new PositionReport();
            var positionReportListPage = new PagedList <PositionReport>(new [] { positionReport }, 1, 1, 1);

            _positionReportRepositoryMock.Expect(r => r.ListPublished(1, 1)).Return(positionReportListPage);


            var result = TestedController.Widget();


            VerifyViewResult(result, "LatestPositionsWidget", typeof(PositionReport), positionReport);
        }
예제 #2
0
        public void IndexTest(
            [Values(10, 10, 10, 10, 10)] int pages,
            [Values(null, 10, 12, null, 10, 12)] int?requestedPage,
            [Values(1, 10, 10, 1, 10, 10)] int expectedPage)
        {
            var expectedPageSize      = TestedController.DefaultPageSize;
            var expectedRequestedPage = requestedPage == null ? 1 : requestedPage.Value;

            var positionReportListPage = new PagedList <PositionReport>(new PositionReport [] { }, expectedPage, expectedPageSize, pages);

            _positionReportRepositoryMock.Expect(r => r.List(expectedRequestedPage, expectedPageSize)).Return(positionReportListPage);


            var result = TestedController.Index(requestedPage);


            VerifyViewResult(result, "List", typeof(PagedList <PositionReport>), positionReportListPage);
        }