private void UpdateCanEnter() { IMyItemInstance keys = mInventory.GetGauntletKeysFromIndex(Index); bool canEnter = keys.GetCount() > 0; SetCanEnterProperty(canEnter); }
private IMyItemInstance CreateMockKeyWithCountForIndex(int i_count, int i_index) { IMyItemInstance mockKey = Substitute.For <IMyItemInstance>(); mockKey.GetCount().Returns(i_count); MockInventory.GetGauntletKeysFromIndex(i_index).Returns(mockKey); return(mockKey); }
public void GetEffect_ReturnsItemCountMultipliedByDataEffect() { MockItemInstance.GetCount().Returns(3); MockCustomData.GetEffect("Test").Returns(5); MockCustomData.HasEffect("Test").Returns(true); BoostUnit systemUnderTest = CreateSystem(); Assert.AreEqual(15, systemUnderTest.GetEffect("Test")); }
public void GetItemCount_ReturnsExpected() { IMyItemInstance mockItem = Substitute.For <IMyItemInstance>(); mockItem.GetCount().Returns(111); systemUnderTest.Inventory = new Dictionary <string, IMyItemInstance>() { { "SomeItem", mockItem } }; Assert.AreEqual(111, systemUnderTest.GetItemCount("SomeItem")); }
private void UpdateKeyCount() { IMyItemInstance keys = mInventory.GetGauntletKeysFromIndex(Index); if (keys != null) { ViewModel.SetProperty(KEY_COUNT_PROPERTY, keys.GetCount()); } else { ViewModel.SetProperty(KEY_COUNT_PROPERTY, 0); } }