Ejemplo n.º 1
0
        public void NoteWillMoveLocation_WhenTimeElapses()
        {
            int currentNoteLocation = 5;

             TimeSpan elapsedTime = TimeSpan.FromSeconds( 3 );

             Game game = new InstrumentedGame( GameConfig.DefaultGameConfig, currentNoteLocation );
             currentNoteLocation = game.MoveNote( elapsedTime );

             Assert.AreEqual( 14, currentNoteLocation );
        }
Ejemplo n.º 2
0
        public void WillExtraLoseExtraPoints_WhenPressingWrongButtonAtWrongTime()
        {
            int currentNoteLocation = 4;
             var correctNoteType = NoteType.C;

             var userEnteredNoteType = NoteType.D;

             Game game = new InstrumentedGame( GameConfig.DefaultGameConfig, currentNoteLocation );
             game.ScoreUserInput( userEnteredNoteType, correctNoteType );

             Assert.AreEqual( -3, game.TotalScore );
        }
Ejemplo n.º 3
0
        public void WhenPressingWrongButton_WillReturnWrongNoteResult()
        {
            int currentNoteLocation = 10;
             var correctNoteType = NoteType.C;

             var userEnteredNoteType = NoteType.D;

             Game game = new InstrumentedGame( GameConfig.DefaultGameConfig, currentNoteLocation );
             ScoreResult result = game.ScoreUserInput( userEnteredNoteType, correctNoteType );

             Assert.AreEqual( ScoreResult.WrongNote, result );
        }
Ejemplo n.º 4
0
        public void WillHaveNegativeTotalScore_WhenPressingWrongButtonAtWrongTimeManyTimes()
        {
            int currentNoteLocation = 4;
             var correctNoteType = NoteType.C;

             var userEnteredNote = NoteType.D;

             Game game = new InstrumentedGame( GameConfig.DefaultGameConfig, currentNoteLocation );

             game.ScoreUserInput( userEnteredNote, correctNoteType );
             game.ScoreUserInput( userEnteredNote, correctNoteType );
             game.ScoreUserInput( userEnteredNote, correctNoteType );

             Assert.AreEqual( -9, game.TotalScore );
        }
Ejemplo n.º 5
0
        public void WillScorePoints_WhenPressingButtonAtTheRightTime()
        {
            int currentNoteLocation = 10;
             var userEnteredNoteType = NoteType.C;
             var correctNoteType = NoteType.C;

             Game game = new InstrumentedGame( GameConfig.DefaultGameConfig, currentNoteLocation );
             game.ScoreUserInput( userEnteredNoteType, correctNoteType );

             Assert.AreEqual( 3, game.TotalScore );
        }
Ejemplo n.º 6
0
        public void WillHaveProperTotalScore_WhenPressingGettingNoteRightAtRightTimeMultipleTimes()
        {
            int currentNoteLocation = 10;
             var correctNoteType = NoteType.C;

             var userEnteredNoteType = NoteType.C;

             Game game = new InstrumentedGame( GameConfig.DefaultGameConfig, currentNoteLocation );

             game.ScoreUserInput( userEnteredNoteType, correctNoteType );
             game.ScoreUserInput( userEnteredNoteType, correctNoteType );
             game.ScoreUserInput( userEnteredNoteType, correctNoteType );

             Assert.AreEqual( 9, game.TotalScore );
        }