コード例 #1
0
        public void AfterSelectingTwoSlotsSelectionResets()
        {
            SlotSelection       slotSelection        = CreateSlotSelection();
            SlotSelectionServer slotSelectionServer1 = CreateSlotSelectionServer(true, true);
            SlotSelectionServer slotSelectionServer2 = CreateSlotSelectionServer(true, true);

            slotSelection.SelectSlot(slotSelectionServer1);
            slotSelection.SelectSlot(slotSelectionServer2);

            Assert.AreEqual(0, slotSelection.SelectedSlotSevers.Count);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void SelectingThreeStartNewSelection()
        {
            SlotSelection       slotSelection        = CreateSlotSelection();
            SlotSelectionServer slotSelectionServer1 = CreateSlotSelectionServer(true, true);
            SlotSelectionServer slotSelectionServer2 = CreateSlotSelectionServer(true, true);
            SlotSelectionServer slotSelectionServer3 = CreateSlotSelectionServer(true, true);

            slotSelection.SelectSlot(slotSelectionServer1);
            slotSelection.SelectSlot(slotSelectionServer2);
            slotSelection.SelectSlot(slotSelectionServer3);

            Assert.AreEqual(1, slotSelection.SelectedSlotSevers.Count);
            Assert.AreEqual(slotSelectionServer3, slotSelection.SelectedSlotSevers[0]);
        }
コード例 #5
0
        public void SelectOneSlot()
        {
            SlotSelection       slotSelection       = CreateSlotSelection();
            SlotSelectionServer slotSelectionServer = CreateSlotSelectionServer(true, true);

            slotSelection.SelectSlot(slotSelectionServer);

            Assert.AreEqual(1, slotSelection.SelectedSlotSevers.Count);
        }
コード例 #6
0
 public void SelectSlot(SlotSelectionServer slotSelectionServer)
 {
     slotSelection.SelectSlot(slotSelectionServer);
 }