Example #1
0
        public ActionResult Inventory()
        {
            var model    = new InventoryReportViewModel();
            var repo     = new InventoryRepositoryADO();
            var newRepo  = repo.GetNewInventory().ToList();
            var usedRepo = repo.GetUsedInventory().ToList();

            model.NewInventory  = newRepo;
            model.UsedInventory = newRepo;

            return(View(model));
        }
Example #2
0
        public void CanGetNewInventory()
        {
            var repo    = new InventoryRepositoryADO();
            var newList = repo.GetNewInventory().ToList();

            Assert.AreEqual(3, newList.Count());
            Assert.AreEqual(1, newList[0].MakeID);
            Assert.AreEqual(3, newList[2].ModelID);
            Assert.AreEqual("Chevy", newList[1].MakeName);
            Assert.AreEqual("F150", newList[2].ModelName);
            Assert.AreEqual(1, newList[0].Count);
            Assert.AreEqual(2017, newList[2].Year);
            Assert.AreEqual(11975, newList[1].StockValue);
        }