public void AddBombsToGrid_AddsCorrectNumberOfBombs(int width, int height, int totalBombs) { //arrange var sweeper = new Sweeper(width, height); //act sweeper.AddBombsToGrid(totalBombs); //assert var actualBombs = sweeper.GetTtotalBombs(); Assert.That(actualBombs, Is.EqualTo(totalBombs)); }
private static Sweeper SetupBoardBasedOnUserInput() { Console.Clear(); Console.WriteLine("Enter Length:"); int length = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter Height:"); int height = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter Total Bombs:"); int totalBombs = Int32.Parse(Console.ReadLine()); var sweeper = new Sweeper(length, height); sweeper.AddBombsToGrid(totalBombs); return(sweeper); }