public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece) { correctlyPositionedPieces.Add(piece); if (correctlyPositionedPieces.Count == maximumPiecesToPlace) { winEventController.TriggerEvent(); } }
public void AddCorrectlyPositionedPiece() { List <PiecePlaceInGrid> correctlyPositionedPieces = CreateCorrectPositionedPieceList(); WinController winController = CreateWinController(correctlyPositionedPieces); PiecePlaceInGrid piece = CreatePiecePlaceInGrid(); winController.AddCorrectlyPositionedPiece(piece); Assert.Contains(piece, correctlyPositionedPieces); }
public void WhenNotAllPiecesAreInCorretPlaceWinEventIsNotTriggered() { int maximumPiecesToPlace = 2; List <PiecePlaceInGrid> correctlyPositionedPieces = CreateCorrectPositionedPieceList(); WinEventController winEventController = CreateWinEventController(); WinController winController = CreateWinController(correctlyPositionedPieces, winEventController, maximumPiecesToPlace); PiecePlaceInGrid firstPiece = CreatePiecePlaceInGrid(); bool wasEventTriggered = false; winEventController.AddListener(() => wasEventTriggered = true); winController.AddCorrectlyPositionedPiece(firstPiece); Assert.IsFalse(wasEventTriggered); }
public void RemoveCorrectlyPositionedPiece(PiecePlaceInGrid piece) { winController.RemoveCorrectlyPositionedPiece(piece); }
public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece) { winController.AddCorrectlyPositionedPiece(piece); }
public void RemoveCorrectlyPositionedPiece(PiecePlaceInGrid piece) { correctlyPositionedPieces.Remove(piece); }
public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece) { }