public void SentenceTaskRepositoryTest_SentenceTasks_Add_validModel()
        {
            var model = new SentenceTask
            {
                SentenceTaskId = 0,
                Sentence       = "Sentence",
                Category       = "Category",
                Translate      = "Translate"
            };
            var result = rep.Add(model);

            Assert.AreEqual(true, result, string.Format("result != expected"));
        }
示例#2
0
 public bool Add(SentenceTask task)
 {
     if (!task.Validate())
     {
         throw new Exception("Invalid model");
     }
     return(rep.Add(task));
 }
        public void SentenceTaskServiceTest_Add_valid()
        {
            var model = new SentenceTask
            {
                SentenceTaskId = 1,
                Sentence       = "Sentence",
                Category       = "Category",
                Translate      = "Translate"
            };
            var expected = rep.Add(model);
            var actual   = service.Add(model);

            Assert.AreEqual(expected, actual);
        }