public ActionResult Summary() { var sessionService = new SessionService(); var actualSession = sessionService.GetActualSession(System.Web.HttpContext.Current); var reckoningService = new ReckoningCostsService(); var model = reckoningService.GetFiguredCostsUpList(actualSession); return(View(model)); }
public ActionResult SummaryForAdmin() { //TODO: it possible to take that from model var sessionService = new SessionService(); var actualSession = sessionService.GetActualSession(System.Web.HttpContext.Current); var reckoningService = new ReckoningCostsService(); var figuredUpList = reckoningService.GetFiguredCostsUpList(actualSession); sessionService.SetUpNewSession(System.Web.HttpContext.Current, figuredUpList); return(RedirectToAction("Summary")); }
public void CheckingPropertyOfReckoning3() { // Arrange var session = new SessionModel() { Entries = new List <EntryModel>() { new EntryModel() { ApplicationUserId = "A", Price = 1.00M, }, new EntryModel() { ApplicationUserId = "B", Price = 2.00M, }, new EntryModel() { ApplicationUserId = "C", Price = 3.20M, } } }; var correctResult = new List <FiguredCostsUpViewModel>() { new FiguredCostsUpViewModel() { Who = "A", Whom = "C", HowMuch = 1.07M }, new FiguredCostsUpViewModel() { Who = "B", Whom = "C", HowMuch = 0.07M }, }; var service = new ReckoningCostsService(); // Act var result = service.GetFiguredCostsUpList(session); // Assert CollectionAssert.AreEquivalent(result, correctResult); }