public void GetAllReciepts_Should_Return_A_Previously_Saved_Reciept() { var reciepts = new RecieptManager(); //Add new reciept var reciept = new Reciept(); reciept.KingdomHallFund = 100; reciept.WorldWideWork = 100; reciept.Congregation = 200; reciepts.AddReciept(reciept); //list it back out var recieptsList = reciepts.GetAllReciepts(); //make sure its in the list foreach (var rec in recieptsList) { if (rec.ID == reciept.ID && rec.Congregation == reciept.Congregation && rec.KingdomHallFund == reciept.KingdomHallFund && rec.WorldWideWork == reciept.WorldWideWork && rec.Miscellaneous1 == reciept.Miscellaneous1 && rec.Miscellaneous1Name == reciept.Miscellaneous1Name && rec.Miscellaneous2 == reciept.Miscellaneous2 && rec.Miscellaneous2Name == reciept.Miscellaneous2Name && rec.Date == reciept.Date) { return; } } //If it wasnt in the list, then we didnt return. so we must not of //been able to find the recipet in the database. this test must FAIL Assert.Fail(); }
public ActionResult History() { var reciepts = new RecieptManager(); var viewModel = new HistoryViewModel(); viewModel.Reciepts = reciepts.GetAllReciepts(); return View(viewModel); }
public void GetAllReciepts_Should_Never_Return_Null() { var reciepts = new RecieptManager(); Assert.IsNotNull(reciepts.GetAllReciepts()); }