示例#1
0
        public void AddWordToLibrary(TestModel model)
        {
            wordService.AddWord(model.word);
            wordService.CheckWord(model.word, model.GameId);
            userSerivce.AddPointToCurrentUser(wordService.GetPoints(model.word), model.GameId);
            var c = userSerivce.GetCurrentUser(model.GameId);

            game.UpdateMainModel(model.NewCell, model.GameId);
            userSerivce.NextUser(model.GameId);
        }
示例#2
0
        public void Setup()
        {
            var kernel = new StandardKernel(new TestDIModule());

            wordService = kernel.Get <WordService>();
            wordService.ClearState();
            wordService.AddWord(existWord);
            var service = wordService.GetUserService();

            service.SetPlayers(new List <string>()
            {
                "player1", "player2"
            }, testGameId);
            service.SetCurrentUser("player1", testGameId);
        }
示例#3
0
        public void AddWord_WhenGivenAString_ShouldCallFileWrapperWithSameStringOnce()
        {
          

            var moqFileWrapper = new Mock<IFileWrapper>();

            moqFileWrapper.Setup(m => m.AppendText(It.IsAny<string>(),
                                                   It.IsAny<string>()));

            WordService target = new WordService(moqFileWrapper.Object);

            target.AddWord(string.Empty, string.Empty);

            moqFileWrapper.Verify(m => m.AppendText(It.IsAny<string>(), 
                                                    It.IsAny<string>()), Times.Once);
        }
示例#4
0
 public void IfAddNotExistThenItExist()
 {
     wordService.AddWord(notExistWord);
     Assert.IsTrue(wordService.CheckWord(notExistWord, testGameId));
 }