Beispiel #1
0
        public void LeaderBoard()
        {
            var clientRequest = new ClientModels.GetLeaderboardRequest();

            clientRequest.MaxResultsCount = 3;
            clientRequest.StatisticName   = TEST_STAT_NAME;
            var clientTask = PlayFabClientAPI.GetLeaderboardAsync(clientRequest);

            clientTask.Wait();
            UUnitAssert.Null(clientTask.Result.Error, "Failed to get client leaderboard");
            UUnitAssert.NotNull(clientTask.Result.Result, "Failed to get client leaderboard");
            UUnitAssert.NotNull(clientTask.Result.Result.Leaderboard, "Failed to get client leaderboard");
            UUnitAssert.True(clientTask.Result.Result.Leaderboard.Count > 0, "Leaderboard does not contain enough entries.");

            var serverRequest = new ServerModels.GetLeaderboardRequest();

            serverRequest.MaxResultsCount = 3;
            serverRequest.StatisticName   = TEST_STAT_NAME;
            var serverTask = PlayFabServerAPI.GetLeaderboardAsync(serverRequest);

            clientTask.Wait();
            UUnitAssert.Null(serverTask.Result.Error, "Failed to get server leaderboard");
            UUnitAssert.NotNull(serverTask.Result.Result, "Failed to get server leaderboard");
            UUnitAssert.NotNull(serverTask.Result.Result.Leaderboard, "Failed to get server leaderboard");
            UUnitAssert.True(serverTask.Result.Result.Leaderboard.Count > 0, "Leaderboard does not contain enough entries.");
        }
Beispiel #2
0
        public void LeaderBoard()
        {
            var clientRequest = new ClientModels.GetLeaderboardRequest();

            clientRequest.MaxResultsCount = 3;
            clientRequest.StatisticName   = TEST_STAT_NAME;
            PlayFabClientAPI.GetLeaderboard(clientRequest, GetClientLbCallback, SharedErrorCallback);
            WaitForApiCalls();

            UUnitAssert.StringEquals("Get Client Leaderboard Successful", lastReceivedMessage);
            // Testing anything more would be testing actual functionality of the Leaderboard, which is outside the scope of this test.

            var serverRequest = new ServerModels.GetLeaderboardRequest();

            serverRequest.MaxResultsCount = 3;
            serverRequest.StatisticName   = TEST_STAT_NAME;
            PlayFabServerAPI.GetLeaderboard(serverRequest, GetServerLbCallback, SharedErrorCallback);
            WaitForApiCalls();

            UUnitAssert.StringEquals("Get Server Leaderboard Successful", lastReceivedMessage);
        }
Beispiel #3
0
        public void LeaderBoard()
        {
            var clientRequest = new GetLeaderboardRequest
            {
                MaxResultsCount = 3,
                StatisticName   = TEST_STAT_NAME,
            };
            var clientTask = PlayFabClientAPI.GetLeaderboardAsync(clientRequest);

            WaitForResultSuccess(clientTask, "Failed to get client leaderboard");
            UUnitAssert.True(clientTask.Result.Result.Leaderboard.Count > 0, "Leaderboard does not contain enough entries.");

            var serverRequest = new ServerModels.GetLeaderboardRequest
            {
                MaxResultsCount = 3,
                StatisticName   = TEST_STAT_NAME,
            };
            var serverTask = PlayFabServerAPI.GetLeaderboardAsync(serverRequest);

            WaitForResultSuccess(serverTask, "Failed to get server leaderboard");
            UUnitAssert.True(serverTask.Result.Result.Leaderboard.Count > 0, "Leaderboard does not contain enough entries.");
        }
Beispiel #4
0
 public void ServerLeaderBoard(UUnitTestContext testContext)
 {
     var serverRequest = new ServerModels.GetLeaderboardRequest();
     serverRequest.MaxResultsCount = 3;
     serverRequest.StatisticName = TEST_STAT_NAME;
     PlayFabServerAPI.GetLeaderboard(serverRequest, PlayFabUUnitUtils.ApiCallbackWrapper<ServerModels.GetLeaderboardResult>(testContext, GetServerLbCallback), SharedErrorCallback, testContext);
 }
        public void LeaderBoard()
        {
            var clientRequest = new GetLeaderboardRequest();
            clientRequest.MaxResultsCount = 3;
            clientRequest.StatisticName = TEST_STAT_NAME;
            PlayFabClientAPI.GetLeaderboard(clientRequest, GetClientLbCallback, SharedErrorCallback);
            WaitForApiCalls();

            UUnitAssert.StringEquals("Get Client Leaderboard Successful", lastReceivedMessage);
            // Testing anything more would be testing actual functionality of the Leaderboard, which is outside the scope of this test.

            var serverRequest = new ServerModels.GetLeaderboardRequest();
            serverRequest.MaxResultsCount = 3;
            serverRequest.StatisticName = TEST_STAT_NAME;
            PlayFabServerAPI.GetLeaderboard(serverRequest, GetServerLbCallback, SharedErrorCallback);
            WaitForApiCalls();

            UUnitAssert.StringEquals("Get Server Leaderboard Successful", lastReceivedMessage);
        }