Пример #1
0
 public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece)
 {
     correctlyPositionedPieces.Add(piece);
     if (correctlyPositionedPieces.Count == maximumPiecesToPlace)
     {
         winEventController.TriggerEvent();
     }
 }
Пример #2
0
        public void AddCorrectlyPositionedPiece()
        {
            List <PiecePlaceInGrid> correctlyPositionedPieces = CreateCorrectPositionedPieceList();
            WinController           winController             = CreateWinController(correctlyPositionedPieces);
            PiecePlaceInGrid        piece = CreatePiecePlaceInGrid();

            winController.AddCorrectlyPositionedPiece(piece);

            Assert.Contains(piece, correctlyPositionedPieces);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public void RemoveCorrectlyPositionedPiece(PiecePlaceInGrid piece)
 {
     winController.RemoveCorrectlyPositionedPiece(piece);
 }
Пример #5
0
 public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece)
 {
     winController.AddCorrectlyPositionedPiece(piece);
 }
Пример #6
0
 public void RemoveCorrectlyPositionedPiece(PiecePlaceInGrid piece)
 {
     correctlyPositionedPieces.Remove(piece);
 }
Пример #7
0
 public void AddCorrectlyPositionedPiece(PiecePlaceInGrid piece)
 {
 }