public void CanBackPostDeliveryAgainstDispatchReport()
        {
            //ACT
            //TODO: Seed data into DeliveryAgainstDispatchViewModel before proceding with testing
            var viewModel  = new DeliveryAgainstDispatchViewModel {
            };
            var viewResult = _stockManagementController.DeliveryAgainstDispatchReport(viewModel) as ViewResult;

            //ASSERT
            Assert.NotNull(viewResult);
            Assert.IsInstanceOf <IEnumerable <Program> >(viewResult.ViewBag.Program);
            Assert.IsInstanceOf <IEnumerable <CommodityType> >(viewResult.ViewBag.CommodityTypes);
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="viewModel"></param>
 /// <returns></returns>
 public ActionResult DeliveryAgainstDispatchReport(DeliveryAgainstDispatchViewModel viewModel)
 {
     ViewBag.Program        = viewModel.ProgramId == null ? "All" : _programService.GetAllProgram().Where(c => c.ProgramID == viewModel.ProgramId).Select(c => c.Name).Single();
     ViewBag.CommodityTypes = viewModel.CommodityTypeId == null ? "All" : _commodityTypeService.GetAllCommodityType().Where(c => c.CommodityTypeID == viewModel.CommodityTypeId).Select(c => c.Name).Single();
     return(PartialView());
 }