Example #1
0
        public void WhenEnteringGauntlet_KeyIsConsumedFromInventory()
        {
            EnterGauntletPM systemUnderTest = CreateSystem();

            systemUnderTest.Index = 0;

            systemUnderTest.EnterGauntlet(0);

            MockInventory.Received().ConsumeGauntletKeyForIndex(0);
        }
Example #2
0
        public void WhenEnteringGauntlet_CurrentIndexSetOnManager()
        {
            EnterGauntletPM systemUnderTest = CreateSystem();

            systemUnderTest.Index = 11;

            systemUnderTest.EnterGauntlet(0);

            MockGauntletManager.Received().CurrentGauntletIndex = 11;
        }
Example #3
0
        public void WhenEnteringGauntlet_SystemHidesItself()
        {
            EnterGauntletPM systemUnderTest = CreateSystem();

            systemUnderTest.ViewModel.SetProperty(EnterGauntletPM.VISIBLE_PROPERTY, true);

            systemUnderTest.EnterGauntlet(0);

            Assert.IsFalse(systemUnderTest.ViewModel.GetPropertyValue <bool>(EnterGauntletPM.VISIBLE_PROPERTY));
        }
Example #4
0
        public void WhenEnteringGauntlet_DungeonLoaderLoadsWithExpectedValues()
        {
            EnterGauntletPM systemUnderTest = CreateSystem();

            systemUnderTest.Index = 0;

            systemUnderTest.EnterGauntlet(2);

            MockDungeonLoader.Received().LoadDungeon(EnterGauntletPM.GAUNTLET_GAME_TYPE, 0, 2);
        }
Example #5
0
        public void CanEnterProperty_IsFalse_WhenKeyCount_IsZero()
        {
            CreateMockKeyWithCountForIndex(0, 1);
            EnterGauntletPM systemUnderTest = CreateSystem();

            systemUnderTest.SetIndex(1);

            bool canEnter = systemUnderTest.ViewModel.GetPropertyValue <bool>(EnterGauntletPM.CAN_ENTER_GAUNTLET_PROPERTY);

            Assert.IsFalse(canEnter);
        }
Example #6
0
        public void WhenSettingIndex_KeyCountIsExpected()
        {
            IMyItemInstance mockKey         = CreateMockKeyWithCountForIndex(3, 1);
            EnterGauntletPM systemUnderTest = CreateSystem();

            systemUnderTest.SetIndex(1);

            int keyCount = systemUnderTest.ViewModel.GetPropertyValue <int>(EnterGauntletPM.KEY_COUNT_PROPERTY);

            Assert.AreEqual(3, keyCount);
        }
Example #7
0
        private EnterGauntletPM CreateSystem()
        {
            EnterGauntletPM systemUnderTest = new EnterGauntletPM(MockGauntletManager, MockInventory, MockDungeonLoader);

            return(systemUnderTest);
        }