示例#1
0
        public void AdPanelVisible_IfQuestNotAvailable()
        {
            IRepeatableQuestProgress progress = Substitute.For <IRepeatableQuestProgress>();

            progress.IsQuestAvailable().Returns(false);
            progress.GetMissionData().Returns(GetMockMission());
            RepeatableQuestModel model = new RepeatableQuestModel(progress, Substitute.For <IAdManager>());

            Assert.AreEqual(1f, model.ViewModel.GetPropertyValue <float>(RepeatableQuestModel.AD_VISIBLE_PROPERTY));
        }
示例#2
0
        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));
        }
示例#3
0
 private void SetMissionVisibilityProperties()
 {
     Mission.ViewModel.SetProperty(MISSION_VISIBLE_PROPERTY, mProgress.IsQuestAvailable() && !mProgress.IsDone() ? 1f : 0f);
 }