public void WhenTotalIsNonZero_AndAmountAdded_TotalIsIncreased()
        {
            var service = new StubTrackingService();
            service.Total = 10;

            ProteinTrackerController controller = new ProteinTrackerController(service);
            ViewResult result = controller.AddProtein(15) as ViewResult;
            Assert.AreEqual(25, result.ViewBag.Total);
            Assert.AreEqual(0, result.ViewBag.Goal);
        }
Esempio n. 2
0
        public void WhenTotalIsNonZero_AndAmountAdded_ToTalIsIncreased()
        {
            var service = new StubTrackingService();

            service.Total = 10;
            ProteinTrackerController controller = new ProteinTrackerController(service);

            ViewResult result = controller.AddProtein(15) as ViewResult;

            Assert.AreEqual(25, result.ViewBag.Total);
            Assert.AreEqual(0, result.ViewBag.Goal);
        }