Ejemplo n.º 1
0
        public void OnSlidingRight()
        {
            if (isSwapping)
            {
                return;
            }

            isSwapping = true;
            swapper.SwapRight();
        }
Ejemplo n.º 2
0
        public void SwappingRightFromItemWillSwapItWithRightItem()
        {
            Vector2      expectedSelectedItemPosition = Vector2.up;
            Vector2      selectedItemInitialPosition  = Vector2.zero;
            Item         itemOnTheRight = CreateItem(expectedSelectedItemPosition);
            Item         selectedItem   = CreateItem(selectedItemInitialPosition);
            ItemSearcher itemSearcher   = CreateRightMockItemSearcher(() => itemOnTheRight);
            Swapper      swapper        = CreateSwapper(itemSearcher);

            swapper.Initialize(selectedItem);

            swapper.SwapRight();
            Vector2 selectedItemPosition = selectedItem.Position;

            Assert.AreEqual(expectedSelectedItemPosition, selectedItemPosition);
        }