Exemple #1
0
        private void UpdateCanEnter()
        {
            IMyItemInstance keys     = mInventory.GetGauntletKeysFromIndex(Index);
            bool            canEnter = keys.GetCount() > 0;

            SetCanEnterProperty(canEnter);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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"));
        }
Exemple #4
0
        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"));
        }
Exemple #5
0
        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);
            }
        }