public void Test_EngineUpdateFieldWithValidPositionAndOneMineShouldCallRendererGameOver() { var firstPosition = new Position(0, 0); var setOfPosition = new HashSet<Position>(); setOfPosition.Add(firstPosition); var mockedRenderer = new Mock<IRenderer>(); var mockedDamageHandler = new Mock<ICellDamageHandler>(); var mockedRandomGenerator = new Mock<IRandomGenerator>(); mockedRandomGenerator.Setup(x => x.GetUniquePointsBetween(It.IsAny<int>(), It.IsAny<Position>(), It.IsAny<Position>())).Returns(setOfPosition); mockedRandomGenerator.Setup(x => x.GetRandomBetween(It.IsAny<int>(), It.IsAny<int>())).Returns(1); var gameField = new GameField(mockedRandomGenerator.Object, new RandomMineFactory(), 8); var engine = new Engine(mockedRenderer.Object, mockedDamageHandler.Object); engine.Init(gameField); engine.UpdateField(firstPosition); mockedRenderer.Verify(x => x.ShowGameOver(It.IsAny<GameData>()), Times.Once()); }