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

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

            game.GoToPreviousSet();
        }
Example #2
0
        public void GameGoToPreviousShouldMoveCurrentSetToPreviousSet()
        {
            var game = new PingPongGame();

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

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

            Assert.AreEqual(expected, actual);

            game.GoToNextSet();
            game.GoToNextSet();
            game.GoToNextSet();
            game.GoToNextSet();

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

            game.GoToPreviousSet();
            expected = 4;
            actual   = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

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

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

            game.GoToPreviousSet();
            expected = 1;
            actual   = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);
        }
        public void GameGoToPreviousShouldMoveCurrentSetToPreviousSet()
        {
            var game = new PingPongGame();

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

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

            game.GoToNextSet();
            game.GoToNextSet();
            game.GoToNextSet();
            game.GoToNextSet();

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

            game.GoToPreviousSet();
            expected = 4;
            actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);

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

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

            game.GoToPreviousSet();
            expected = 1;
            actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void GoToPreviousSet()
        {
            _game.GoToPreviousSet();

            RaisePropertyChanged("CurrentSet");
        }
        public void GameGoToPreviousShouldThrowIfArgumentIsLesserThanZero()
        {
            var game = new PingPongGame();

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

            game.GoToPreviousSet();
        }