Пример #1
0
        public void WhenChestIsAvailable_NoCountdownCreated()
        {
            MockSaveData.IsChestAvailable(Arg.Any <string>()).Returns(true);

            TimedChestPM systemUnderTest = CreateSystem();

            MockCountdownSpawner.DidNotReceive().Create(Arg.Any <long>(), Arg.Any <ICountdownCallback>());
        }
Пример #2
0
        public void WhenShowingOpenReward_BusyIndicatorIsHidden()
        {
            TimedChestPM systemUnderTest = CreateSystem();

            systemUnderTest.ShowOpenReward(Substitute.For <IDungeonReward>());

            MockBusyIndicator.Received().Hide();
        }
Пример #3
0
        public void WhenCreated_CanOpenPropertyIsTrue_IfCanOpen()
        {
            MockSaveData.CanOpenChest(Arg.Any <ITimedChestData>()).Returns(true);

            TimedChestPM systemUnderTest = CreateSystem();

            Assert.IsTrue(systemUnderTest.ViewModel.GetPropertyValue <bool>(TimedChestPM.CAN_OPEN_PROPERTY));
        }
Пример #4
0
        public void WhenOpening_BusyIndicatorIsShown()
        {
            TimedChestPM systemUnderTest = CreateSystem();

            systemUnderTest.Open();

            MockBusyIndicator.Received().Show();
        }
Пример #5
0
        public void WhenOpening_SaveDatOpenIsCalled()
        {
            TimedChestPM systemUnderTest = CreateSystem();

            systemUnderTest.Open();

            MockSaveData.Received().OpenChest(MockData, systemUnderTest);
        }
Пример #6
0
        public void WhenChestNoAvailable_CountdownIsCreated()
        {
            MockSaveData.IsChestAvailable(Arg.Any <string>()).Returns(false);

            TimedChestPM systemUnderTest = CreateSystem();

            MockCountdownSpawner.Received().Create(Arg.Any <long>(), Arg.Any <ICountdownCallback>());
        }
Пример #7
0
        public void WhenChestIsAvailable_AvailablePropertiesAsExpected()
        {
            MockSaveData.IsChestAvailable(Arg.Any <string>()).Returns(true);

            TimedChestPM systemUnderTest = CreateSystem();

            Assert.IsTrue(systemUnderTest.ViewModel.GetPropertyValue <bool>(TimedChestPM.AVAILABLE_PROPERTY));
            Assert.IsFalse(systemUnderTest.ViewModel.GetPropertyValue <bool>(TimedChestPM.UNAVAILABLE_PROPERTY));
        }
Пример #8
0
        public void WhenCreated_NameProperty_IsExpected()
        {
            MockStringTable.Get("TestNameKey").Returns("TestName");
            MockData.GetNameKey().Returns("TestNameKey");

            TimedChestPM systemUnderTest = CreateSystem();

            Assert.AreEqual("TestName", systemUnderTest.ViewModel.GetPropertyValue <string>(TimedChestPM.NAME_PROPERTY));
        }
Пример #9
0
        public void WhenCreated_KeyProgress_IsExpected()
        {
            MockData.GetKeysRequired().Returns(10);
            MockSaveData.GetCurrentKeysForChest(Arg.Any <string>()).Returns(3);

            TimedChestPM systemUnderTest = CreateSystem();

            Assert.AreEqual("3", systemUnderTest.ViewModel.GetPropertyValue <string>(TimedChestPM.CURRENT_KEYS_PROPERTY));
            Assert.AreEqual("10", systemUnderTest.ViewModel.GetPropertyValue <string>(TimedChestPM.REQUIRED_KEYS_PROPERTY));
        }
Пример #10
0
        public void WhenShowingOpenReward_RewardPM_IsSet_AndUncovered()
        {
            IDungeonReward  mockReward      = Substitute.For <IDungeonReward>();
            ISingleRewardPM mockRewardPM    = Substitute.For <ISingleRewardPM>();
            TimedChestPM    systemUnderTest = CreateSystem();

            systemUnderTest.RewardPM = mockRewardPM;

            systemUnderTest.ShowOpenReward(mockReward);

            mockRewardPM.Received().SetReward(mockReward);
            mockRewardPM.Received().UncoverReward();
        }