public void Can_Paginate() { // create a controller and make the page size 3 items StaffController staffController = new StaffController(mock.Object, queryProc); staffController.PageSize = 3; // Action //TicketsListViewModel result = (TicketsListViewModel)staffController.ViewTickets().Model; var result = staffController.ViewTickets("",-1,2); var resultModel = ((ViewResult)result).Model; TicketsListViewModel model = (TicketsListViewModel)resultModel; // Assert Tickets[] prodArray = model.Tickets.ToArray(); Assert.IsTrue(prodArray.Length > 0); Assert.AreEqual(prodArray[0].Id, 3); }
public void Find_Correct_Reference_InTickets() { StaffController staffController = new StaffController(mock.Object, queryProc); var result = staffController.ViewTickets("AAA-000001"); var resultModel = ((ViewResult)result).Model; TicketsListViewModel model = (TicketsListViewModel)resultModel; Assert.IsTrue(model.Tickets.ToList().Count() > 0); }