Exemplo n.º 1
0
        public void PlaceMines_WithBadLuck_ResultsInClickedLocationIsNoMine(uint clickedLocationX, uint clickedLocationY)
        {
            Location clickedLocation = new(clickedLocationX, clickedLocationY);
            LocationShufflerToTest locationShuffler   = new(mineLocations);
            IMinelayer             minelayerUnderTest = new SafeMinelayer(locationShuffler);
            IEnumerable <Location> placedMines        = minelayerUnderTest.PlaceMines(field, (uint)mineLocations.Length, clickedLocation);

            placedMines.Should().NotContain(clickedLocation);
        }
Exemplo n.º 2
0
        public void PlaceMines_RemovesClickedLocation(uint clickedLocationX, uint clickedLocationY, int mineCountChange)
        {
            Location clickedLocation = new(clickedLocationX, clickedLocationY);
            LocationShufflerToTest locationShuffler   = new(mineLocations);
            IMinelayer             minelayerUnderTest = new SafeMinelayer(locationShuffler);
            IEnumerable <Location> placedMines        = minelayerUnderTest.PlaceMines(field, (uint)mineLocations.Length, clickedLocation);

            placedMines.Should().HaveCount(mineLocations.Length + mineCountChange);
            placedMines.Should().BeEquivalentTo(mineLocations.Except(new[] { clickedLocation }));
        }