コード例 #1
0
        public void ResetingWillReturnSwappedItemsToInitialPlaces()
        {
            Vector2      initialItemAbovePosition     = Vector2.up;
            Vector2      selectedItemInitialPosition  = Vector2.zero;
            Vector2      expectedSelectedItemPosition = selectedItemInitialPosition;
            Item         itemAbove    = CreateItem(initialItemAbovePosition);
            Item         selectedItem = CreateItem(selectedItemInitialPosition);
            ItemSearcher itemSearcher = CreateUpMockItemSearcher(() => itemAbove);
            Swapper      swapper      = CreateSwapper(itemSearcher);

            swapper.Initialize(selectedItem);

            swapper.SwapUp();
            swapper.Reset();
            Vector2 selectedItemPosition = selectedItem.Position;
            Vector2 itemAbovePosition    = itemAbove.Position;

            Assert.AreEqual(expectedSelectedItemPosition, selectedItemPosition);
            Assert.AreEqual(initialItemAbovePosition, itemAbovePosition);
        }
コード例 #2
0
 public void OnInitialPosition()
 {
     swapper.Reset();
 }