private void updateEmail() { UsersTableModel usersTableModel = new UsersTableModel(); string brugerId = "AndersAnd"; usersTableModel.getUser(brugerId); Assert.AreEqual(brugerId, usersTableModel.brugerId, "Kan ikke finde " + brugerId); Assert.AreEqual(andersAndEmail, usersTableModel.email, "Forkert email " + usersTableModel.email); usersTableModel.email = andersAndEmailNew; usersTableModel.updateUser(); usersTableModel.email = null; usersTableModel.getUser(brugerId); Assert.AreEqual(andersAndEmailNew, usersTableModel.email, "Forkert email " + usersTableModel.email); }
private void readEntry() { UsersTableModel usersTableModel = new UsersTableModel(); string brugerId = "AndersAnd"; usersTableModel.getUser(brugerId); Assert.AreEqual(brugerId, usersTableModel.brugerId, "Kan ikke finde " + brugerId); }
// GET: UsersTableModels/Edit/5 public ActionResult Edit(string id) { if (sessiondUserId() == null || sessiondUserId() == "") { return(RedirectToAction("logIn")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //UsersTableModel usersTableModel = db.UsersTableModel.Find(id); UsersTableModel usersTableModel = new UsersTableModel(); usersTableModel.getUser(id); if (usersTableModel == null) { return(HttpNotFound()); } return(View(usersTableModel)); }