Esempio n. 1
0
        public void WhenAllPiecesAreInCorretPlaceWinEventIsTriggered()
        {
            int maximumPiecesToPlace = 2;
            List <PiecePlaceInGrid> correctlyPositionedPieces = CreateCorrectPositionedPieceList();
            WinEventController      winEventController        = CreateWinEventController();
            WinController           winController             = CreateWinController(correctlyPositionedPieces, winEventController, maximumPiecesToPlace);
            PiecePlaceInGrid        firstPiece  = CreatePiecePlaceInGrid();
            PiecePlaceInGrid        secondPiece = CreatePiecePlaceInGrid();
            bool wasEventTriggered = false;

            winEventController.AddListener(() => wasEventTriggered = true);
            winController.AddCorrectlyPositionedPiece(firstPiece);
            winController.AddCorrectlyPositionedPiece(secondPiece);

            Assert.IsTrue(wasEventTriggered);
        }
Esempio n. 2
0
        public void AddCorrectlyPositionedPiece()
        {
            List <PiecePlaceInGrid> correctlyPositionedPieces = CreateCorrectPositionedPieceList();
            WinController           winController             = CreateWinController(correctlyPositionedPieces);
            PiecePlaceInGrid        piece = CreatePiecePlaceInGrid();

            winController.AddCorrectlyPositionedPiece(piece);

            Assert.Contains(piece, correctlyPositionedPieces);
        }
Esempio n. 3
0
 public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece)
 {
     winController.AddCorrectlyPositionedPiece(piece);
 }