Example #1
0
        public void CheckWithNoSettings(UUnitTestContext testContext)
        {
            //It should work with static class only
            PlayFabServerInstanceAPI serverInstanceWithoutAnyParameter = new PlayFabServerInstanceAPI();

            serverInstanceWithoutAnyParameter.GetAllSegments(new GetAllSegmentsRequest(), PlayFabUUnitUtils.ApiActionWrapper <GetAllSegmentsResult>(testContext, CheckWithNoSettingsSuccessCallBack), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, SharedErrorCallback), testContext);
        }
Example #2
0
        public void CheckWithAuthContextAndWithoutAuthContext(UUnitTestContext testContext)
        {
            //IT will  use static developer key - Should has no error
            PlayFabServerInstanceAPI serverInstance1 = new PlayFabServerInstanceAPI();

            serverInstance1.GetAllSegments(new GetAllSegmentsRequest(), PlayFabUUnitUtils.ApiActionWrapper <GetAllSegmentsResult>(testContext, CheckWithAuthContextAndWithoutAuthContextSuccessCallBack), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, SharedErrorCallback), testContext);

            var apiSettings = new PlayFabApiSettings();

            apiSettings.DeveloperSecretKey = "WRONGKEYTOFAIL";

            //IT will  use context developer key - Should has error because of wrong key
            PlayFabServerInstanceAPI serverInstance2 = new PlayFabServerInstanceAPI(apiSettings);

            serverInstance2.GetAllSegments(new GetAllSegmentsRequest(), PlayFabUUnitUtils.ApiActionWrapper <GetAllSegmentsResult>(testContext, CheckWithAuthContextAndWithoutAuthContextSuccessCallBack), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, CheckWithAuthContextAndWithoutAuthContextExpectedErrorCallBack), testContext);
        }
Example #3
0
        public void ParallelRequest(UUnitTestContext testContext)
        {
            var settings1 = new PlayFabApiSettings();

            settings1.TitleId            = testTitleData.titleId;
            settings1.DeveloperSecretKey = testTitleData.developerSecretKey;

            var settings2 = new PlayFabApiSettings();

            settings2.TitleId            = testTitleData.titleId;
            settings2.DeveloperSecretKey = "TESTKEYERROR";

            PlayFabServerInstanceAPI serverInstance1 = new PlayFabServerInstanceAPI(settings1);
            PlayFabServerInstanceAPI serverInstance2 = new PlayFabServerInstanceAPI(settings2);

            serverInstance1.GetAllSegments(new GetAllSegmentsRequest(), PlayFabUUnitUtils.ApiActionWrapper <GetAllSegmentsResult>(testContext, ParallelRequestSuccessCallBack), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, ParallelRequestExpectedErrorCallBack), testContext);
            serverInstance2.GetAllSegments(new GetAllSegmentsRequest(), PlayFabUUnitUtils.ApiActionWrapper <GetAllSegmentsResult>(testContext, ParallelRequestSuccessCallBack), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, ParallelRequestExpectedErrorCallBack), testContext);
        }