public void WhenChestIsAvailable_NoCountdownCreated() { MockSaveData.IsChestAvailable(Arg.Any <string>()).Returns(true); TimedChestPM systemUnderTest = CreateSystem(); MockCountdownSpawner.DidNotReceive().Create(Arg.Any <long>(), Arg.Any <ICountdownCallback>()); }
public void WhenShowingOpenReward_BusyIndicatorIsHidden() { TimedChestPM systemUnderTest = CreateSystem(); systemUnderTest.ShowOpenReward(Substitute.For <IDungeonReward>()); MockBusyIndicator.Received().Hide(); }
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)); }
public void WhenOpening_BusyIndicatorIsShown() { TimedChestPM systemUnderTest = CreateSystem(); systemUnderTest.Open(); MockBusyIndicator.Received().Show(); }
public void WhenOpening_SaveDatOpenIsCalled() { TimedChestPM systemUnderTest = CreateSystem(); systemUnderTest.Open(); MockSaveData.Received().OpenChest(MockData, systemUnderTest); }
public void WhenChestNoAvailable_CountdownIsCreated() { MockSaveData.IsChestAvailable(Arg.Any <string>()).Returns(false); TimedChestPM systemUnderTest = CreateSystem(); MockCountdownSpawner.Received().Create(Arg.Any <long>(), Arg.Any <ICountdownCallback>()); }
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)); }
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)); }
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)); }
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(); }