Beispiel #1
0
        public void lostOneLifeShouldRemoveOneLife()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);
            int initialLives           = screen.livesLeft();

            screen.looseOneLive();
            Assert.AreEqual(initialLives - 1, screen.livesLeft());
        }
Beispiel #2
0
        public void checkNonExistingWordShoudlReturnFalse()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);

            screen.addWordToGame("test");
            screen.addWordToGame("another");
            Assert.False(screen.checkWordInGame("other"));
        }
Beispiel #3
0
        public void afterLoosingLastLiveShouldGameOver()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);

            while (screen.livesLeft() > 0)
            {
                Assert.False(screen.gameOver());
                screen.looseOneLive();
            }
            Assert.True(screen.gameOver());
        }
Beispiel #4
0
        public void checkAndRemoveExistingWordShoudlRemoveOneWord()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);

            screen.addWordToGame("test");
            screen.addWordToGame("another");
            screen.addWordToGame("other");
            Assert.AreEqual(3, screen.numberOfWordsInGame());
            screen.checkAndRemoveWordInGame("test");
            Assert.AreEqual(2, screen.numberOfWordsInGame());
        }
Beispiel #5
0
        public void drawGameOverShouldNotThrowException()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);

            Assert.DoesNotThrow(() => { screen.drawGameOver(); });
        }
Beispiel #6
0
        public void moveWordsOneRowShouldNotThrowException()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);

            Assert.DoesNotThrow(() => { screen.moveWordsOneRow(); });
        }
Beispiel #7
0
        public void addWordToGameShouldNotThrowException()
        {
            AnimatedWordsScreen screen = new AnimatedWordsScreen(60, 20);

            Assert.DoesNotThrow(() => { screen.addWordToGame("test"); });
        }