示例#1
0
        public ViewResult ENodebList(int townId, int page = 1)
        {
            ENodebListViewModel viewModel
                = new ENodebListViewModel(_eNodebRepository, _townRepository, townId, page);

            return(View(viewModel));
        }
示例#2
0
 public ViewResult ENodebList(int townId, int page = 1)
 {
     ENodebListViewModel viewModel
         = new ENodebListViewModel(_townRepository, townId);
     viewModel.SetItems(page, pageSize);
     return View(viewModel);
 }
示例#3
0
        public void AssertTest(int townId, int expectedENodebs)
        {
            ViewResult          viewResult = controller.ENodebList(townId);
            ENodebListViewModel viewModel  = viewResult.Model as ENodebListViewModel;

            Assert.IsNotNull(viewModel);
            Assert.AreEqual(viewModel.TownId, townId);
            Assert.AreEqual(viewModel.Items.Count(), expectedENodebs);
            Assert.AreEqual(viewModel.QueryItems.Count(), expectedENodebs);
        }
 public void AssertTest(IENodebRepository repository, int townId, int page, int pageSize, int expectedSize)
 {
     Mock<ITownRepository> townRepository = new Mock<ITownRepository>();
     ENodebListViewModel viewModel
         = new ENodebListViewModel(repository, townRepository.Object, townId, page, pageSize);
     Assert.AreEqual(viewModel.TownId, townId);
     Assert.AreEqual(viewModel.PagingInfo.CurrentPage, page);
     Assert.AreEqual(viewModel.PagingInfo.ItemsPerPage, pageSize);
     Assert.AreEqual(viewModel.PagingInfo.TotalItems, expectedSize);
     Assert.AreEqual(viewModel.Items.Count(),
         page == (expectedSize / pageSize + 1) ? (expectedSize % pageSize) : pageSize);
     Assert.AreEqual(viewModel.QueryItems.Count(), expectedSize);
 }
示例#5
0
        public void AssertTest(IENodebRepository repository, int townId, int page, int pageSize, int expectedSize)
        {
            Mock <ITownRepository> townRepository = new Mock <ITownRepository>();
            ENodebListViewModel    viewModel
                = new ENodebListViewModel(repository, townRepository.Object, townId, page, pageSize);

            Assert.AreEqual(viewModel.TownId, townId);
            Assert.AreEqual(viewModel.PagingInfo.CurrentPage, page);
            Assert.AreEqual(viewModel.PagingInfo.ItemsPerPage, pageSize);
            Assert.AreEqual(viewModel.PagingInfo.TotalItems, expectedSize);
            Assert.AreEqual(viewModel.Items.Count(),
                            page == (expectedSize / pageSize + 1) ? (expectedSize % pageSize) : pageSize);
            Assert.AreEqual(viewModel.QueryItems.Count(), expectedSize);
        }
 public ViewResult ENodebList(int townId, int page = 1)
 {
     ENodebListViewModel viewModel
         = new ENodebListViewModel(_eNodebRepository, _townRepository, townId, page);
     return View(viewModel);
 }