コード例 #1
0
ファイル: PlayFabApiTest.cs プロジェクト: zH4x/SDKGenerator
        public void MultiplePlayerApiCall(UUnitTestContext testContext)
        {
            if (authenticationContext1?.ClientSessionTicket == null || authenticationContext2?.ClientSessionTicket == null)
            {
                testContext.Skip("To run this test MultipleLoginWithStaticMethods test should be passed and store authenticationContext values");
            }

            var getPlayerProfileRequest = new GetPlayerProfileRequest()
            {
                AuthenticationContext = authenticationContext1,
                PlayFabId             = authenticationContext1.PlayFabId
            };
            var getPlayerProfileRequest2 = new GetPlayerProfileRequest()
            {
                AuthenticationContext = authenticationContext2,
                PlayFabId             = authenticationContext2.PlayFabId
            };

            var getPlayerProfileTask  = clientApi.GetPlayerProfileAsync(getPlayerProfileRequest, null, testTitleData.extraHeaders).Result;
            var getPlayerProfileTask2 = clientApi.GetPlayerProfileAsync(getPlayerProfileRequest2, null, testTitleData.extraHeaders).Result;

            testContext.NotNull(getPlayerProfileTask.Result, "GetPlayerProfile Failed for getPlayerProfileRequest");
            testContext.NotNull(getPlayerProfileTask2.Result, "GetPlayerProfile Failed for getPlayerProfileRequest2");
            testContext.IsNull(getPlayerProfileTask.Error, "GetPlayerProfile error occured for getPlayerProfileRequest: " + getPlayerProfileTask.Error?.ErrorMessage ?? string.Empty);
            testContext.IsNull(getPlayerProfileTask2.Error, "GetPlayerProfile error occured for getPlayerProfileRequest2: " + getPlayerProfileTask2.Error?.ErrorMessage ?? string.Empty);

            testContext.EndTest(UUnitFinishState.PASSED, null);
        }