Exemplo n.º 1
0
        // GET: DistributionCentreStock
        public ActionResult DistributionCentreStock(int id, string name)
        {
            var distributionCentreStock = reportBLL.DistributionCentreStock(id);

            ViewBag.Name = name;
            ViewBag.Sum  = distributionCentreStock.Sum(c => c.Value);

            if (distributionCentreStock == null)
            {
                return(HttpNotFound());
            }

            return(View(distributionCentreStock));
        }
Exemplo n.º 2
0
        public void ManagerController_DistributionCentreStock_returnDistributionsStock()
        {
            //Arrange
            var mc        = new ManagerController();
            var reportBLL = new ReportBLL();



            //Act
            var result                   = mc.DistributionCentreStock(1, "Head Office") as ViewResult;
            var distributionstocks       = (List <MedicationTypeViewData>)result.ViewData.Model;
            var distributionCentreStocks = reportBLL.DistributionCentreStock(1);

            //Asert
            Assert.AreEqual("Head Office", result.ViewBag.Name);
            CollectionAssert.AllItemsAreNotNull(distributionstocks);
            Assert.AreEqual(distributionstocks.Count, distributionCentreStocks.Count);
            //// if medicationpackage is blank
            //Assert.AreEqual(0, result.ViewBag.Sum);
        }