public void IndexTest() { var ctrl = new OsobyController(); var index = ctrl.Index(null); Assert.IsInstanceOf(typeof(ViewResult), index); }
public void AddGetTest() { using (var db = new db_context()) { var ctrl = new OsobyController(); var add = ctrl.Add(); Assert.IsInstanceOf(typeof(ViewResult), add); } }
public void EditGetTest() { using (var db = new db_context()) { int id = db.Osoby.First().ID; var ctrl = new OsobyController(); var edit = ctrl.Edit(id); Assert.IsInstanceOf(typeof(ViewResult), edit); } }
public void RemoveTypeTest() { using (var db = new db_context()) { var model = db.Osoby.First(); var ctrl = new OsobyController(); var remove = ctrl.Remove(model); Assert.IsInstanceOf(typeof(ActionResult), remove); } }
public void EditPostTypeTest() { using (var db = new db_context()) { Osoba model = db.Osoby.First(); model.Imie = "Zacheusz"; model.Nazwisko = "Olek"; model.Wiek = 99; var ctrl = new OsobyController(); var edit = ctrl.Edit(model); Assert.IsInstanceOf(typeof(ActionResult), edit); } }
public void AddPostTypeTest() { using (var db = new db_context()) { Osoba model = new Osoba(); model.Imie = "Zbyszek"; model.Nazwisko = "Erbal"; model.Wiek = 94; var ctrl = new OsobyController(); var add = ctrl.Add(model); Assert.IsInstanceOf(typeof(ActionResult), add); } }
public void EditPostTest() { using (var db = new db_context()) { Osoba model = db.Osoby.First(); model.Imie = "Zacheusz"; model.Nazwisko = "Olek"; model.Wiek = 99; var ctrl = new OsobyController(); var edit = ctrl.Edit(model); var modelUpdated = db.Osoby.First(x => x.ID == model.ID); Assert.IsTrue(modelUpdated.Imie == model.Imie && modelUpdated.Nazwisko == model.Nazwisko && modelUpdated.Wiek == model.Wiek); } }
public void AddPostTest() { using (var db = new db_context()) { Osoba model = new Osoba(); model.Imie = "Zbyszek"; model.Nazwisko = "Erbal"; model.Wiek = 94; var ctrl = new OsobyController(); var add = ctrl.Add(model); bool exist = db.Osoby.Any(x => x.Imie == model.Imie && x.Nazwisko == model.Nazwisko && x.Wiek == model.Wiek); Assert.IsTrue(exist); } }