public void DontMoveAndReceiveIfCantReceive() { SlotSelection slotSelection = CreateSlotSelection(); StubSlotSelectionServer slotSelectionServer1 = CreateSlotSelectionServer(true, true) as StubSlotSelectionServer; StubSlotSelectionServer slotSelectionServer2 = CreateSlotSelectionServer(true, false) as StubSlotSelectionServer; slotSelection.SelectSlot(slotSelectionServer1); slotSelection.SelectSlot(slotSelectionServer2); Assert.IsFalse(slotSelectionServer1.TakePieceWasCalled); Assert.IsFalse(slotSelectionServer2.ReceivePieceWasCalled); }
public void SelectingTwoSlotsWillCheckIfTheyCanMoveAndReceivePiece() { SlotSelection slotSelection = CreateSlotSelection(); StubSlotSelectionServer slotSelectionServer1 = CreateSlotSelectionServer(true, true) as StubSlotSelectionServer; StubSlotSelectionServer slotSelectionServer2 = CreateSlotSelectionServer(true, true) as StubSlotSelectionServer; slotSelection.SelectSlot(slotSelectionServer1); slotSelection.SelectSlot(slotSelectionServer2); Assert.IsTrue(slotSelectionServer1.CanMovePieceWasCalled); Assert.IsTrue(slotSelectionServer2.CanReceivePieceWasCalled); }
public void FirstIsMovableAndSecondIsEmpty() { PieceDestinationController firstPieceDestinationController = CreatePieceDestinationController(); PieceDestinationController secondPieceDestinationController = CreatePieceDestinationController(); firstPieceDestinationController.SetMovable(); secondPieceDestinationController.SetEmpty(); SlotSelectionServer slotSelectionServer = new StubSlotSelectionServer(true, false, CreatePieceObject()); Assert.IsTrue(firstPieceDestinationController.CanMovePiece()); Assert.IsTrue(secondPieceDestinationController.CanReceivePiece()); firstPieceDestinationController.TakePiece(); secondPieceDestinationController.ReceivePieceFromSlot(slotSelectionServer); Assert.IsTrue(secondPieceDestinationController.State is MovableState); Assert.IsTrue(firstPieceDestinationController.State is EmptyState); }