Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
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));
        }