示例#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));
        }
示例#2
0
        public void CanGetUsedInventory()
        {
            var repo     = new InventoryRepositoryADO();
            var usedList = repo.GetUsedInventory().ToList();

            Assert.AreEqual(5, usedList.Count());
            Assert.AreEqual(2, usedList[0].MakeID);
            Assert.AreEqual(5, usedList[2].ModelID);
            Assert.AreEqual("Chevy", usedList[1].MakeName);
            Assert.AreEqual("Aura", usedList[2].ModelName);
            Assert.AreEqual(1, usedList[0].Count);
            Assert.AreEqual(2007, usedList[2].Year);
            Assert.AreEqual(8564, usedList[1].StockValue);
        }