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 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)); }
private void SetMissionVisibilityProperties() { Mission.ViewModel.SetProperty(MISSION_VISIBLE_PROPERTY, mProgress.IsQuestAvailable() && !mProgress.IsDone() ? 1f : 0f); }