public void OnSlidingRight() { if (isSwapping) { return; } isSwapping = true; swapper.SwapRight(); }
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); }