public void AdPanelVisible_IfQuestDone() { IRepeatableQuestProgress progress = Substitute.For <IRepeatableQuestProgress>(); progress.IsDone().Returns(true); progress.GetMissionData().Returns(GetMockMission()); RepeatableQuestModel model = new RepeatableQuestModel(progress, Substitute.For <IAdManager>()); Assert.AreEqual(1f, model.ViewModel.GetPropertyValue <float>(RepeatableQuestModel.AD_VISIBLE_PROPERTY)); }
public void QuestMissionNotVisible_IfQuestNotAvailable() { IRepeatableQuestProgress progress = Substitute.For <IRepeatableQuestProgress>(); progress.IsQuestAvailable().Returns(false); progress.GetMissionData().Returns(GetMockMission()); RepeatableQuestModel model = new RepeatableQuestModel(progress, Substitute.For <IAdManager>()); Assert.AreEqual(0f, model.Mission.ViewModel.GetPropertyValue <float>(RepeatableQuestModel.MISSION_VISIBLE_PROPERTY)); }
public void CountPropertyMatchesProgressCount() { int expectedCount = 111; IRepeatableQuestProgress progress = Substitute.For <IRepeatableQuestProgress>(); progress.GetCompletedCount().Returns(expectedCount); progress.GetMissionData().Returns(GetMockMission()); RepeatableQuestModel model = new RepeatableQuestModel(progress, Substitute.For <IAdManager>()); Assert.AreEqual(expectedCount, model.ViewModel.GetPropertyValue <int>(RepeatableQuestModel.CURRENT_COMPLETED_COUNT_PROPERTY)); }
public void AdPanelNotInteratable_IfQuestDoneButOtherwiseOk() { IRepeatableQuestProgress progress = Substitute.For <IRepeatableQuestProgress>(); progress.IsQuestAvailable().Returns(false); progress.IsDone().Returns(true); progress.GetMissionData().Returns(GetMockMission()); IAdManager ads = Substitute.For <IAdManager>(); ads.IsAdReady().Returns(true); RepeatableQuestModel model = new RepeatableQuestModel(progress, ads); Assert.IsFalse(model.ViewModel.GetPropertyValue <bool>(RepeatableQuestModel.AD_INTERACTABLE_PROPERTY)); }