Ejemplo n.º 1
0
        public void Test_ScoreBoard_AddScore()
        {
            var scoreBoard = new ScoreBoard();
            scoreBoard.AddScore("test", 10);

            var actual = scoreBoard.TopScores.First();
            var expected = new KeyValuePair<string, int>("test", 10);

            Assert.AreEqual<KeyValuePair<string, int>>(expected, actual);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Minesweeper.Game.MinesweeperGame"/> class.
        /// </summary>
        /// <param name="uiManager">The <see cref="Minesweeper.Game.IUIManager"/> implementation used to read and write.</param>
        public MinesweeperGame(IUIManager uiManager)
        {
            this.minefieldRows = 5;
            this.minefieldCols = 10;
            this.uiManager = uiManager;

            this.prompt = Messages.EnterRowCol;
            this.scoreBoard = new ScoreBoard();

            // Show game
            this.uiManager.DisplayIntro(Messages.Intro);
            this.uiManager.DrawTable(this.minefieldRows, this.minefieldCols);
            this.GenerateMinefield();
        }