public void TestCreateG() { var controller = new expenditureController(); var result = controller.Create() as ViewResult; Assert.IsNotNull(result); }
public void TestIndex() { var db = new AnchoiEntities(); var controller = new expenditureController(); var result = controller.Index() as ViewResult; Assert.IsNotNull(result); var model = result.Model as List <expenditure>; Assert.AreEqual(db.expenditures.Count(), (model.Count)); }
public void TestEditG() { var controller = new expenditureController(); var result0 = controller.Edit(0); Assert.IsInstanceOfType(result0, typeof(HttpNotFoundResult)); var db = new AnchoiEntities(); var item = db.expenditures.First(); var result1 = controller.Edit(item.id) as ViewResult; Assert.IsNotNull(result1); var model = result1.Model as expenditure; Assert.AreEqual(item.id, model.id); //TMMLLLLL dit me m de an choi }