Example #1
0
        public void GameGoToNextShouldMoveCurrentSetToNextSet()
        {
            var game = new PingPongGame();

            game.GenerateSets(7);
            game.Start();

            var expected = 1;
            var actual   = game.CurrentSet.Number;

            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            expected = 2;
            actual   = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            expected = 3;
            actual   = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            expected = 4;
            actual   = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);
        }
        public void GameGoToNextShouldMoveCurrentSetToNextSet()
        {
            var game = new PingPongGame();

            game.GenerateSets(7);
            game.Start();

            var expected = 1;
            var actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            expected = 2;
            actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            expected = 3;
            actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            expected = 4;
            actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void GameGoToNextSetShouldThrowIfArgumentIsGreaterThanIndexOfLastSet()
        {
            var game = new PingPongGame();

            game.GenerateSets(1);
            game.Start();

            game.GoToNextSet();
        }
        public void GameGoToNextSetShouldThrowIfArgumentIsGreaterThanIndexOfLastSet()
        {
            var game = new PingPongGame();

            game.GenerateSets(1);
            game.Start();

            game.GoToNextSet();
        }
Example #5
0
        public void GoToNextSet()
        {
            _game.GoToNextSet();

            RaisePropertyChanged("CurrentSet");
        }