Beispiel #1
0
        public void WhenAwardingPromoOnClient_ClientSaveDataIsUpdated()
        {
            MockBackend.GetTimeInMs().Returns(1000);
            ILoginPromotionData mockData = Substitute.For <ILoginPromotionData>();
            ISingleLoginPromoProgressSaveData mockProgress = Substitute.For <ISingleLoginPromoProgressSaveData>();

            LoginPromoPopupHelper systemUnderTest = CreateSystem();

            systemUnderTest.AwardPromoOnClient(mockProgress, mockData);

            mockProgress.Received().OnAwarded(1000);
        }
        public void AwardPromoOnClient(ISingleLoginPromoProgressSaveData i_promoProgress, ILoginPromotionData i_promoData)
        {
            i_promoProgress.OnAwarded(mBackend.GetTimeInMs());

            IGameRewardData rewardData = i_promoData.GetRewardDataForDay(i_promoProgress.GetCollectCount());
            IDungeonReward  reward     = mRewardSpawner.Create(rewardData);

            if (reward != null)
            {
                reward.Award();
            }
        }