public void When_StartPuzzleMessage_is_received_Should_set_the_GameId_property_on_the_PuzzleBoardViewModel()
        {
            var fakePuzzleService = new FakePuzzlesService();

            var puzzleBoardVm = new PuzzleBoardViewModel(fakePuzzleService, new TestSchedulers(), new FakeUserSevice());
            fakePuzzleService.AddWords(new Dictionary<string, string>
                                           {
                                               {"Bamidele", "Adetoro's first name"},
                                               {"station", "place where i fit get train"},
                                               {"india", "Origin of my favourite curry"},
                                           });

            var puzzleViewModel = new PuzzleViewModel() { PuzzleId = 1 };
            puzzleBoardVm.LoadState(puzzleViewModel, new Dictionary<string, object>());
            Assert.AreEqual(puzzleViewModel.PuzzleId, puzzleBoardVm.PuzzleViewModel.PuzzleId);
        }
        public async Task When_StartPauseCommand_is_executed_should_get_from_PuzzleService_words_for_the_provided_puzzleId()
        {
            var fakePuzzleService = new FakePuzzlesService();

            var puzzleBoardVm = new PuzzleBoardViewModel(fakePuzzleService, new TestSchedulers(), new FakeUserSevice());
            fakePuzzleService.AddWords(new Dictionary<string, string>
                                           {
                                               {"Bamidele", "Adetoro's first name"},
                                               {"station", "place where i fit get train"},
                                               {"india", "Origin of my favourite curry"},
                                           });

            var puzzleViewModel = new PuzzleViewModel() {PuzzleId = 1};
            puzzleBoardVm.LoadState(puzzleViewModel,new Dictionary<string, object>());
            puzzleBoardVm.StartPauseCommand.Execute(null);
            Assert.AreEqual(3, puzzleBoardVm.Words.Count);
        }
예제 #3
0
 public GameNotStartedState(PuzzleBoardViewModel puzzleBoardViewModel)
     : base(puzzleBoardViewModel)
 {
 }
예제 #4
0
 public GameFinishedState(PuzzleBoardViewModel puzzleBoardViewModel)
     : base(puzzleBoardViewModel)
 {
 }
예제 #5
0
 public GameInProgressState( PuzzleBoardViewModel puzzleBoardViewModel )
     : base(puzzleBoardViewModel)
 {
 }
예제 #6
0
 public GamePauseState(PuzzleBoardViewModel puzzleBoardViewModel)
     : base(puzzleBoardViewModel)
 {
 }
        public void Board_should_be_disabled_if_game_is_not_running()
        {
            var fakePuzzleService = new FakePuzzlesService();
            var puzzleBoardVm = new PuzzleBoardViewModel(fakePuzzleService, new TestSchedulers(), new FakeUserSevice());
            fakePuzzleService.AddWords(new Dictionary<string, string>
                                           {
                                               {"Bamidele", "Adetoro's first name"},
                                               {"station", "place where i fit get train"},
                                               {"india", "Origin of my favourite curry"},
                                           });

            var puzzleViewModel = new PuzzleViewModel() { PuzzleId = 1 };
            puzzleBoardVm.LoadState(puzzleViewModel, new Dictionary<string, object>());

            puzzleBoardVm.StartPauseCommand.Execute(null);
            Assert.IsTrue(puzzleBoardVm.GameIsRunning);
        }
예제 #8
0
 protected GameState(PuzzleBoardViewModel puzzleBoardViewModel)
 {
     PuzzleBoardViewModel = puzzleBoardViewModel;
 }
 public GameFinishedWithErrorsState(PuzzleBoardViewModel puzzleBoardViewModel)
     : base(puzzleBoardViewModel)
 {
 }