public void IndexTest() { var ctrl = new NieruchmoscController(); var index = ctrl.Index(); Assert.IsInstanceOf(typeof(ViewResult), index); }
public void GetJsonTest() { using (var db = new db_context()) { var ctrl = new NieruchmoscController(); int id = db.Osoby.First().ID; var json = ctrl.GetNieruchomosci(id); Assert.IsInstanceOf(typeof(JsonResult), json); } }
public void AddGetTest() { using (var db = new db_context()) { int id = db.Osoby.First().ID; var ctrl = new NieruchmoscController(); var add = ctrl.Add(id); //add Nie pobiera lczby argumentów Assert.IsInstanceOf(typeof(ViewResult), add); } }
public void MapPartialTest() { using (var db = new db_context()) { var ctrl = new NieruchmoscController(); int ID = 0; var nieruchomosc = db.Nieruchomosci.FirstOrDefault(x => x.ID == ID); var map = ctrl.MapPartial(ID); Assert.IsInstanceOf(typeof(PartialViewResult), map); } }
public void AddPostTest() { using (var db = new db_context()) { Nieruchomosc model = new Nieruchomosc { IDOsoby = 1, Nazwa = "Dom", Adres = "Orkana 27", lat = 21.00000, lng = 52.06543 }; var ctrl = new NieruchmoscController(); var add = ctrl.Add(model); bool exist = db.Nieruchomosci.Any(x => x.IDOsoby == model.IDOsoby && x.Nazwa == model.Nazwa && x.Adres == model.Adres && x.lat == model.lat && x.lng == model.lng); Assert.IsTrue(exist); } }