コード例 #1
0
        public void GameGenerateSetsShouldThrowIfArgumentIsNegativeOrZero()
        {
            var game = new PingPongGame();

            game.GenerateSets(-1);
            game.GenerateSets(0);
        }
コード例 #2
0
        public void GameGenerateSetsShouldThrowIfArgumentIsNegativeOrZero()
        {
            var game = new PingPongGame();

            game.GenerateSets(-1);
            game.GenerateSets(0);
        }
コード例 #3
0
        public MainWindowViewModel()
        {
            _game = new PingPongGame();

            _game.GenerateSets(11);
            _game.Start();
        }
コード例 #4
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);
        }
コード例 #5
0
        public void GameGenerateSetsShouldBeCalledBeforeGameStart()
        {
            var game = new PingPongGame();

            game.Start();
            game.GenerateSets(11);
        }
コード例 #6
0
        public void GameGoToSetShouldMoveCurrentSetToGivenArgument()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.GoToSet(1);
            var expected = 1;
            var actual   = game.CurrentSet.Number;

            Assert.AreEqual(expected, actual);

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

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

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

            game.GoToSet(1);
            expected = 1;
            actual   = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);
        }
コード例 #7
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);
        }
コード例 #8
0
        public void GameGenerateSetsShouldBeCalledBeforeGameStart()
        {
            var game = new PingPongGame();

            game.Start();
            game.GenerateSets(11);
        }
コード例 #9
0
        public void GameGoToNextSetShouldThrowIfArgumentIsGreaterThanIndexOfLastSet()
        {
            var game = new PingPongGame();

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

            game.GoToNextSet();
        }
コード例 #10
0
        public void GameGoToPreviousShouldThrowIfArgumentIsLesserThanZero()
        {
            var game = new PingPongGame();

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

            game.GoToPreviousSet();
        }
コード例 #11
0
        public void GameGoToNextSetShouldThrowIfArgumentIsGreaterThanIndexOfLastSet()
        {
            var game = new PingPongGame();

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

            game.GoToNextSet();
        }
コード例 #12
0
        public void GameGoToSetShouldThrowIfArgumentIsOutsideOfNumberOfSetsBounds()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.GoToSet(-1);
            game.GoToSet(12);
        }
コード例 #13
0
        public void GameMarkSetAsFaultForTeamShouldThrowIfArgumentIsNegativeZeroOrGreaterThanTwo()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.MarkSetAsFaultForTeam(-1);
            game.MarkSetAsFaultForTeam(0);
            game.MarkSetAsFaultForTeam(3);
        }
コード例 #14
0
        public void GameMarkSetAsPointForTeamShouldMarkCurrentSetAsAPointForAGivenTeam()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.MarkSetAsPointForTeam(1);

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

            Assert.AreEqual(expected, actual);
        }
コード例 #15
0
 public void SetUp()
 {
     _game.GenerateSets(11);
     _game.Start();
 }
コード例 #16
0
        public void GameGoToSetShouldMoveCurrentSetToGivenArgument()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

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

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

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

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

            game.GoToSet(1);
            expected = 1;
            actual = game.CurrentSet.Number;
            Assert.AreEqual(expected, actual);
        }
コード例 #17
0
        public void GameGoToPreviousShouldThrowIfArgumentIsLesserThanZero()
        {
            var game = new PingPongGame();

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

            game.GoToPreviousSet();
        }
コード例 #18
0
        public void GameGoToSetShouldThrowIfArgumentIsOutsideOfNumberOfSetsBounds()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.GoToSet(-1);
            game.GoToSet(12);
        }
コード例 #19
0
        public void GameMarkSetAsPointForTeamShouldThrowIfArgumentIsNegativeZeroOrGreaterThanTwo()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.MarkSetAsPointForTeam(-1);
            game.MarkSetAsPointForTeam(0);
            game.MarkSetAsPointForTeam(3);
        }
コード例 #20
0
        public void GameMarkSetAsPointForTeamShouldMarkCurrentSetAsAPointForAGivenTeam()
        {
            var game = new PingPongGame();

            game.GenerateSets(11);
            game.Start();

            game.MarkSetAsPointForTeam(1);

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

            Assert.AreEqual(expected, actual);
        }