Ejemplo n.º 1
0
        public void GetAll_ShouldListAllItems(int count)
        {
            // Act
            List <TruckViewModel> trucksViewModel = TruckService.GetAll();

            // Assert
            Assert.AreEqual(count, trucksViewModel.Count(), "It should return the correct count");
        }
Ejemplo n.º 2
0
        public ActionResult Index(TruckListFiltersModel filters)
        {
            int pageTotal;

            var trucks = _truckService.GetAll("CreatedDate", "DESC", filters.Criteria, filters.Page, DefaultPageSize, out pageTotal);

            var pagedList = new StaticPagedList <TruckDto>(trucks, filters.Page, DefaultPageSize, pageTotal);

            var listModel = new TruckListModel(pagedList, filters);

            return(View(listModel));
        }
Ejemplo n.º 3
0
        // GET: Truck
        public ActionResult Index()
        {
            var trucksViewModels = TruckService.GetAll();

            return(View(trucksViewModels));
        }