Ejemplo n.º 1
0
        public void AchievementReportProgressIsRevealWithMapping()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.AddIdMapping("mappedId", "realId");

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

            Assert.AreEqual("realId", mockClient.RevealedId);
        }
        public void ShowLeaderboardUIWithIdIsWorksWhenMapped()
        {
            var mockClient = new LeaderboardClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.AddIdMapping("unmappedLeaderboard", "mappedLeaderboard");

            platform.ShowLeaderboardUI("unmappedLeaderboard");

            Assert.IsTrue(mockClient.UIShown);
            Assert.AreEqual("mappedLeaderboard", mockClient.ShownId);
        }
        public void ShowLeaderboardUIWorksWhenAuthenticatedAndMappedDefaultLeaderboard()
        {
            var mockClient = new LeaderboardClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.AddIdMapping("unmappedDefault", "mappedDefault");
            platform.SetDefaultLeaderboardForUI("unmappedDefault");

            platform.ShowLeaderboardUI();

            Assert.IsTrue(mockClient.UIShown);
            Assert.AreEqual("mappedDefault", mockClient.ShownId);
        }
        public void ReportScoreIsWorksWhenIdMapped()
        {
            var mockClient = new LeaderboardClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.AddIdMapping("unmappedLeaderboard", "mappedLeaderboard");

            platform.ReportScore(300L, "unmappedLeaderboard", SentinelCallback);

            Assert.AreEqual("mappedLeaderboard", mockClient.SubmittedId);
            Assert.AreEqual(300L, mockClient.SubmittedScore);
            Assert.AreSame(SentinelCallback, mockClient.SubmitCallback);
        }
        public void AchievementIncrementForMappedId()
        {
            var mockClient = new AchievementClient();
            var platform   = new PlayGamesPlatform(mockClient);

            platform.AddIdMapping("unmapped", "mapped");

            platform.SetStepsAtLeast("unmapped", 30, SentinelCallback);

            Assert.AreEqual("mapped", mockClient.IncrementedId);
            Assert.AreEqual(30, mockClient.NewSteps);
            Assert.AreSame(SentinelCallback, mockClient.IncrementedCallback);
        }