Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SOAL sOAL = db.SOAL.Find(id);

            db.SOAL.Remove(sOAL);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public void TestMethod1()
        {
            int id = 0;
            //SOAL expectedResult = null; //nama model //bisa pakai .isNull
            SOAL result = soal.detail(id);

            Assert.IsNotNull(result);
        }
Exemplo n.º 3
0
        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
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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));
 }
Exemplo n.º 6
0
        // 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));
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        // 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));
        }