public void SentenceTaskRepositoryTest_SentenceTasks_Delete_validModel() { var model = new SentenceTask { SentenceTaskId = 1, Sentence = "Sentence", Category = "Category", Translate = "Translate" }; var result = rep.Delete(model.SentenceTaskId); Assert.AreEqual(model.SentenceTaskId, result, string.Format("result != expected")); }
public string Delete(int id) { if (!id.Validate()) { throw new Exception("Invalid model"); } return(rep.Delete(id) > 0 ? "Delete completed successful" : null); }