void Start() { mPM = new AllRewardsPM(SingleRewardsSpawner, Messenger, DungeonManager.Rewards); SetModel(mPM.ViewModel); CreateSingleRewardViews(); }
public void WhenCreating_CoveredRewardCount_EqualsIncomingRewardCount() { List <IDungeonReward> mockRewards = GetMockRewards(3); AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), Substitute.For <IMessageService>(), mockRewards); Assert.AreEqual(mockRewards.Count, systemUnderTest.CoveredRewardCount); }
public void WhenCreating_SingleRewardPMs_AreCreatedFromIncomingData() { List <IDungeonReward> mockRewards = GetMockRewards(3); AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), Substitute.For <IMessageService>(), mockRewards); Assert.AreEqual(3, systemUnderTest.SingleRewardPMs.Count); }
public void WhenCreating_ExpectedMessagesSubscribed() { IMessageService mockMessenger = Substitute.For <IMessageService>(); AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), mockMessenger, new List <IDungeonReward>()); mockMessenger.Received().AddListener(GameMessages.GAME_OVER, Arg.Any <Callback <bool> >()); }
public void WhenUncoveringReward_IfCoveredCountIsZero_CanContinueIsTrue() { List <IDungeonReward> mockRewards = GetMockRewards(1); AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), Substitute.For <IMessageService>(), mockRewards); systemUnderTest.RewardUncovered(); Assert.IsTrue(systemUnderTest.ViewModel.GetPropertyValue <bool>(AllRewardsPM.CAN_CONTINUE_PROPERTY)); }
public void WhenUncoveringReward_CoveredCountDecreases() { List <IDungeonReward> mockRewards = GetMockRewards(3); AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), Substitute.For <IMessageService>(), mockRewards); systemUnderTest.RewardUncovered(); Assert.AreEqual(mockRewards.Count - 1, systemUnderTest.CoveredRewardCount); }
public void WhenPlayerWins_IsVisible_IsTrue() { AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), Substitute.For <IMessageService>(), new List <IDungeonReward>()); systemUnderTest.ViewModel.SetProperty(AllRewardsPM.VISIBLE_PROPERTY, false); systemUnderTest.OnGameOver(true); Assert.IsTrue(systemUnderTest.ViewModel.GetPropertyValue <bool>(AllRewardsPM.VISIBLE_PROPERTY)); }
public void WhenCreating_Visibility_IsFalse() { AllRewardsPM systemUnderTest = new AllRewardsPM(Substitute.For <ISingleRewardPM_Spawner>(), Substitute.For <IMessageService>(), new List <IDungeonReward>()); Assert.IsFalse(systemUnderTest.ViewModel.GetPropertyValue <bool>(AllRewardsPM.VISIBLE_PROPERTY)); }