[TestMethod]//okpass public void TestMethodDetailBenar() { int id = 1; ASPEK asp = aDAO.Detail(id); Assert.AreEqual("ubah lagi ya", asp.NAMA_ASPEK); }
[TestMethod]//oktes+db public void TestTampilDetailbenar() { int id = 1; ASPEK result = aDAO.Detail(id); Assert.IsNotNull(result); }
public ActionResult DeleteConfirmed(int id) { ASPEK aSPEK = db.ASPEK.Find(id); db.ASPEK.Remove(aSPEK); db.SaveChanges(); return(RedirectToAction("Index")); }
public void TestTampilDetailSalah() { int id = 0; ASPEK expectResult = null; ASPEK result = aDAO.Detail(id); Assert.AreEqual(expectResult, result); }
[TestMethod]//oktes+db public void TesDeleteAspekbenar() { ASPEK aspek = aDAO.Detail(17); Assert.IsNotNull(aspek); bool isPermanent = false; var a = aDAO.Delete(17, false); }
public ActionResult Edit([Bind(Include = "ID_ASPEK,NAMA_ASPEK,DIBUAT_OLEH,DIBUAT_PADA,DIUBAH_OLEH,DIUBAH_PADA,STATUS_AKTIF")] ASPEK aSPEK) { if (ModelState.IsValid) { db.Entry(aSPEK).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aSPEK)); }
public ActionResult Create([Bind(Include = "ID_ASPEK,NAMA_ASPEK,DIBUAT_OLEH,DIBUAT_PADA,DIUBAH_OLEH,DIUBAH_PADA,STATUS_AKTIF")] ASPEK aSPEK) { if (ModelState.IsValid) { db.ASPEK.Add(aSPEK); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aSPEK)); }
[TestMethod]//oktes+db public void TestTambahAspekbenar() { ASPEK Asp = new ASPEK(); Asp.NAMA_ASPEK = "aspek"; Asp.DIBUAT_OLEH = "Zakki"; Asp.DIBUAT_PADA = DateTime.Now; Asp.STATUS_AKTIF = true; int a = aDAO.Add(Asp); Assert.IsNotNull(a); }
[TestMethod]//oktess+db public void TesEditAspectSalah() { ASPEK aspek = aDAO.Detail(0); Assert.IsNotNull(aspek); aspek.NAMA_ASPEK = "Komplit pake banget"; aspek.DIUBAH_OLEH = "suci"; aspek.DIUBAH_PADA = DateTime.Now; aspek.STATUS_AKTIF = true; var a = aDAO.Edit(0, aspek); Assert.AreEqual(0, a); }
[TestMethod]//oktess+db public void TesEditAspectbenar() { ASPEK aspek = aDAO.Detail(2); Assert.IsNotNull(aspek); aspek.NAMA_ASPEK = "ubah lagi ya"; aspek.DIUBAH_OLEH = "suci f"; aspek.DIUBAH_PADA = DateTime.Now; aspek.STATUS_AKTIF = true; var a = aDAO.Edit(2, aspek); Assert.AreEqual(1, a); }
protected void Button1_Click(object sender, EventArgs e) { ASPEK aspek = new ASPEK { NAMA_ASPEK = TextBox1.Text, DIBUAT_OLEH = TextBox2.Text, DIBUAT_PADA = DateTime.Now, STATUS_AKTIF = CheckBox1.Checked }; AspekDAO aspdao = new AspekDAO(); aspdao.Add(aspek); }
// GET: ASPEKs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ASPEK aSPEK = db.ASPEK.Find(id); if (aSPEK == null) { return(HttpNotFound()); } return(View(aSPEK)); }
public static void Main(String[] args) { AspekDAO aDAO = new AspekDAO(); ASPEK aspek = aDAO.Detail(2); //aspek.NAMA_ASPEK = "Try it "; //aspek.DIUBAH_OLEH = "Zakki"; //aspek.DIUBAH_PADA = DateTime.Now; ////aDAO.Edit(1, aspek); //aDAO.Edit(2, aspek); Console.WriteLine(aspek.DIBUAT_OLEH); Console.ReadLine(); }