public void WordRepositoryTest_Words_Save_validModel() { var model = new Word { WordId = 1, Category = "Category", Original = "Original", Translate = "Translate", Transcription = "Transcription" }; var result = rep.Edit(model); Assert.AreEqual(true, result, string.Format("result != expected")); }
public bool Edit(Word word) { if (!word.Validate(true)) { throw new Exception("Invalid model"); } return(rep.Edit(word)); }
public ActionResult Edit(Word word) { if (ModelState.IsValid) { db.Edit(word); return(RedirectToAction("Index")); } return(View(word)); }
public void WordServiceTest_Edit_valid() { var model = new Word { WordId = 1, Category = "Category" + 1, Original = "Original" + 1, Translate = "Translate" + 1, Transcription = "Transcription" + 1 }; var expected = rep.Edit(model); var actual = service.Edit(model); Assert.AreEqual(expected, actual); }
public void Edit(Word word) { _wordRepository.Edit(word); }