@@ -28,7 +28,7 @@ var PlayFabApiTests = {
2828 testNumber : null // Used by several tests
2929 } ,
3030 testConstants : {
31- TEST_KEY : "testCounter" ,
31+ TEST_DATA_KEY : "testCounter" ,
3232 TEST_STAT_NAME : "str" ,
3333 CHAR_TEST_TYPE : "Fighter"
3434 } ,
@@ -44,7 +44,7 @@ var PlayFabApiTests = {
4444 } ,
4545
4646 LoginTests : function ( ) {
47- // All tests run completely synchronously , which is a bit tricky.
47+ // All tests run in parallel , which is a bit tricky.
4848 // Some test rely on data loaded from other tests, and there's no super easy to force tests to be sequential/dependent
4949 // In fact, most of the tests return here before they're done, and report back success/fail in some arbitrary future
5050
@@ -147,6 +147,8 @@ var PlayFabApiTests = {
147147 var invalidDone = assert . async ( ) ;
148148
149149 var invalidRequest = {
150+ // Currently, you need to look up the correct format for this object in the API-docs:
151+ // https://api.playfab.com/Documentation/Client/method/LoginWithEmailAddress
150152 TitleId : PlayFab . settings . titleId ,
151153 Email : PlayFabApiTests . titleData . userEmail ,
152154 Password : PlayFabApiTests . titleData . userPassword + "INVALID"
@@ -270,10 +272,10 @@ var PlayFabApiTests = {
270272 var getDataCallback2 = function ( result , error ) {
271273 PlayFabApiTests . VerifyNullError ( result , error , assert , "Testing GetUserData result" ) ;
272274 assert . ok ( result . data . Data != null , "Testing GetUserData Data" ) ;
273- assert . ok ( result . data . Data . hasOwnProperty ( PlayFabApiTests . testConstants . TEST_KEY ) , "Testing GetUserData DataKey" ) ;
275+ assert . ok ( result . data . Data . hasOwnProperty ( PlayFabApiTests . testConstants . TEST_DATA_KEY ) , "Testing GetUserData DataKey" ) ;
274276
275- var actualtestNumber = parseInt ( result . data . Data [ PlayFabApiTests . testConstants . TEST_KEY ] . Value , 10 ) ;
276- var timeUpdated = new Date ( result . data . Data [ PlayFabApiTests . testConstants . TEST_KEY ] . LastUpdated ) ;
277+ var actualtestNumber = parseInt ( result . data . Data [ PlayFabApiTests . testConstants . TEST_DATA_KEY ] . Value , 10 ) ;
278+ var timeUpdated = new Date ( result . data . Data [ PlayFabApiTests . testConstants . TEST_DATA_KEY ] . LastUpdated ) ;
277279
278280 var now = Date . now ( ) ;
279281 var testMin = now - ( 1000 * 60 * 5 ) ;
@@ -292,16 +294,16 @@ var PlayFabApiTests = {
292294 PlayFabApiTests . VerifyNullError ( result , error , assert , "Testing GetUserData result" ) ;
293295 assert . ok ( result . data . Data != null , "Testing GetUserData Data" ) ;
294296
295- var hasData = result . data . Data . hasOwnProperty ( PlayFabApiTests . testConstants . TEST_KEY ) ;
296- PlayFabApiTests . testData . testNumber = ! hasData ? 1 : parseInt ( result . data . Data [ PlayFabApiTests . testConstants . TEST_KEY ] . Value , 10 ) ;
297+ var hasData = result . data . Data . hasOwnProperty ( PlayFabApiTests . testConstants . TEST_DATA_KEY ) ;
298+ PlayFabApiTests . testData . testNumber = ! hasData ? 1 : parseInt ( result . data . Data [ PlayFabApiTests . testConstants . TEST_DATA_KEY ] . Value , 10 ) ;
297299 PlayFabApiTests . testData . testNumber = ( PlayFabApiTests . testData . testNumber + 1 ) % 100 ; // This test is about the expected value changing - but not testing more complicated issues like bounds
298300
299301 var updateDataRequest = {
300302 // Currently, you need to look up the correct format for this object in the API-docs:
301303 // https://api.playfab.com/Documentation/Client/method/UpdateUserData
302304 Data : { } // Can't pre-define properties because the param-name is in a string
303305 } ;
304- updateDataRequest . Data [ PlayFabApiTests . testConstants . TEST_KEY ] = PlayFabApiTests . testData . testNumber ;
306+ updateDataRequest . Data [ PlayFabApiTests . testConstants . TEST_DATA_KEY ] = PlayFabApiTests . testData . testNumber ;
305307 PlayFabClientSDK . UpdateUserData ( updateDataRequest , PlayFabApiTests . CallbackWrapper ( "updateDataCallback" , updateDataCallback , assert ) ) ;
306308 get1Done ( ) ;
307309 } ;
0 commit comments