public void AchievementReportProgressIsRevealNoMapping()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.ReportProgress("achievement", 0.00000001, SentinelCallback);

            Assert.AreEqual("achievement", mockClient.RevealedId);
        }
        public void AchievementReportProgressUnknownAchievementTreatedAsNonIncremental()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.ReportProgress("unknown", 50, SentinelCallback);

            Assert.IsNull(mockClient.UnlockedId);
            Assert.IsNull(mockClient.UnlockedCallback);
        }
Exemplo n.º 3
0
        static void IncrementViaReportProgress(AchievementClient mockClient, PlayGamesPlatform platform,
                                               int current, int total, double progress)
        {
            Achievement incremental = new Achievement();

            incremental.IsIncremental     = true;
            incremental.CurrentSteps      = current;
            incremental.TotalSteps        = total;
            mockClient.CurrentAchievement = incremental;
            platform.ReportProgress("incremental", progress, SentinelCallback);
        }
        public void AchievementReportProgressFailsWhenNotAuthenticated()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            mockClient.Authenticated = false;
            var result = new CapturingAction <bool>();

            platform.ReportProgress("achievement", 0.0, result.invoke);

            Assert.IsFalse(result.Captured);
        }
Exemplo n.º 5
0
        public void AchievementReportProgressNonIncremental()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            Achievement nonIncremental = new Achievement();

            mockClient.CurrentAchievement = nonIncremental;

            platform.ReportProgress("nonIncremental", 50, SentinelCallback);

            Assert.IsNull(mockClient.UnlockedId);
            Assert.IsNull(mockClient.UnlockedCallback);
        }
        public void AchievementReportProgressIsRevealWithMapping()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.AddIdMapping("mappedId", "realId");
            Achievement achievemnt = new Achievement();

            achievemnt.Id = "realId";
            mockClient.CurrentAchievement = achievemnt;

            platform.ReportProgress("mappedId", 0.00000001, SentinelCallback);

            Assert.AreEqual("realId", mockClient.RevealedId);
        }
Exemplo n.º 7
0
 internal void IncrementCoreAchievements()
 {
     playGamesPlatform.ReportProgress(GPGSIds.achievement_new_core, 100f, null);
     playGamesPlatform.IncrementAchievement(GPGSIds.achievement_variety_is_key, 1, null);
     playGamesPlatform.IncrementAchievement(GPGSIds.achievement_the_collector, 1, null);
 }