The controller has a method for adding a new record to the database.
public ActionResult Create() { return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include = "Id,Cat")] Category category) // { if (ModelState.IsValid) { db.Categories.Add(category); db.SaveChanges(); TempData["message"] = string.Format("Добавление прошло успешно!"); return RedirectToAction("Index"); } return View(category); } How to perform a unit test to check the addition. All the examples I was looking for are based on code first, and are completely different from my controller.