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); }
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); }
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); }
public void IfAddNotExistThenItExist() { wordService.AddWord(notExistWord); Assert.IsTrue(wordService.CheckWord(notExistWord, testGameId)); }