示例#1
0
 public RegisterWordResponse RegisterWord(TestModel model)
 {
     try
     {
         if (wordService.CheckWord(model.word, model.GameId))
         {
             game.UpdateMainModel(model.NewCell, model.GameId);
             userSerivce.AddPointToCurrentUser(wordService.GetPoints(model.word), model.GameId);
             userSerivce.NextUser(model.GameId);
             return(new RegisterWordResponse()
             {
                 Status = "success", Word = model.word
             });
         }
         else
         {
             return(new RegisterWordResponse()
             {
                 Status = "not exist", Word = model.word
             });
         }
     }
     catch (Exception)
     {
         return(new RegisterWordResponse()
         {
             Status = "was used", Word = model.word
         });
     }
 }
示例#2
0
        public void TestCheckService()
        {
            var result = wordService.CheckWord(existWord, testGameId);

            Assert.IsTrue(result);
        }