Exemplo n.º 1
0
        public void UserDictionaryRepositoryTest_UserWords_Add_validModel()
        {
            var model = new UserWord
            {
                Id     = 0,
                UserId = 1,
                WordId = 105
            };
            var result = rep.Add(1, model);

            Assert.AreEqual(true, result, string.Format("result != expected"));
        }
Exemplo n.º 2
0
 public bool Add(int id, UserWord word)
 {
     if (!id.Validate() && !word.Validate())
     {
         throw new Exception("Invalid model");
     }
     return(rep.Add(id, word));
 }
Exemplo n.º 3
0
        public void UserDictionaryServiceTest_Add_valid()
        {
            var model = new UserWord
            {
                Id     = 1,
                UserId = 1,
                WordId = 1
            };
            var expected = rep.Add(1, model);
            var actual   = service.Add(1, model);

            Assert.AreEqual(expected, actual);
        }