diff --git a/Assets/Scripts/Shop/Tests/ShopUnitTests.cs b/Assets/Scripts/Shop/Tests/ShopUnitTests.cs index 65432a9..29404c6 100644 --- a/Assets/Scripts/Shop/Tests/ShopUnitTests.cs +++ b/Assets/Scripts/Shop/Tests/ShopUnitTests.cs @@ -89,14 +89,14 @@ namespace Tests yield return null; Item item = shopView.ShopModel.GetSelectedItem(); + var highlight = shopView.transform.Find("Highlight"); // Conveniently this will only return an active object named Highlight. The name's hardcoded which is bad though. //Creates a delegate that call gridBuyView.ShopModel.SelectItemByIndex(-1), the test runner will run the function, and //check if an ArgumentOutOfRangeException is thrown, the unit test would fail if no ArgumentOutOfRangeException //was thrown - Assert.Throws(delegate - { - //shopView.OnSelected(item); // TODO: check items for selection in here - },"Error selecting specified item"); - Assert.IsFalse(true,"Previous item is still selected!"); + shopView.ShopModel.SelectItemByIndex(shopView.ShopModel.GetSelectedItemIndex() + 1); + var newHighlight = shopView.transform.Find("Highlight"); + + Assert.IsTrue(highlight != newHighlight,"Previous item is still selected!"); } } } \ No newline at end of file