public ActionResult DeleteConfirmed(int id) { SOAL sOAL = db.SOAL.Find(id); db.SOAL.Remove(sOAL); db.SaveChanges(); return(RedirectToAction("Index")); }
public void TestMethod1() { int id = 0; //SOAL expectedResult = null; //nama model //bisa pakai .isNull SOAL result = soal.detail(id); Assert.IsNotNull(result); }
public void TestMethod2() { // SoalDAO soal = new SoalDAO(); //nama DAO int id = 1; //SOAL expectedResult = null; //nama model SOAL result = soal.detail(id); Assert.IsNotNull(result); //jika sudah diisi akan ceklist }
public void TestMethodDetail() { int id = 0; SOAL expectedResult = null; //nama model //bisa pakai .isNull SUBTES result = sub.detail(id); //Assert.IsNull(result); Assert.AreEqual(expectedResult, result); }
public ActionResult Edit([Bind(Include = "ID_SOAL,ID_KELOMPOKSOAL,ID_TIPESOAL,ISI_SOAL,NILAI_SOAL,Created_by,Created_date,Modified_by,ID_SUBTES")] SOAL sOAL) { if (ModelState.IsValid) { db.Entry(sOAL).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_KELOMPOKSOAL = new SelectList(db.KELOMPOK_SOAL, "ID_KELOMPOKSOAL", "NAMA_KELOMPOKSOAL", sOAL.ID_KELOMPOKSOAL); ViewBag.ID_TIPESOAL = new SelectList(db.TIPE_SOAL, "ID_TIPESOAL", "NAMA_TIPE", sOAL.ID_TIPESOAL); ViewBag.ID_SUBTES = new SelectList(db.SUBTES, "ID_SUBTES", "Created_by", sOAL.ID_SUBTES); return(View(sOAL)); }
// GET: SOAL/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SOAL sOAL = db.SOAL.Find(id); if (sOAL == null) { return(HttpNotFound()); } return(View(sOAL)); }
public void TestMethod3() { //SoalDAO soalDAO = new SoalDAO(); //nama DAO SOAL s = new SOAL(); s.ID_SOAL = 1; int x = soal.add(s); //SOAL result = soal.add(soal); //SOAL expectedResult = soal.detail(id); //nama model //bisa pakai .isNull //SOAL result = soal.detail(id); Assert.AreEqual(1, x); }
// GET: SOAL/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SOAL sOAL = db.SOAL.Find(id); if (sOAL == null) { return(HttpNotFound()); } ViewBag.ID_KELOMPOKSOAL = new SelectList(db.KELOMPOK_SOAL, "ID_KELOMPOKSOAL", "NAMA_KELOMPOKSOAL", sOAL.ID_KELOMPOKSOAL); ViewBag.ID_TIPESOAL = new SelectList(db.TIPE_SOAL, "ID_TIPESOAL", "NAMA_TIPE", sOAL.ID_TIPESOAL); ViewBag.ID_SUBTES = new SelectList(db.SUBTES, "ID_SUBTES", "Created_by", sOAL.ID_SUBTES); return(View(sOAL)); }