@@ -28,7 +28,7 @@ var PlayFabApiTests = {
28
28
testNumber : null // Used by several tests
29
29
} ,
30
30
testConstants : {
31
- TEST_KEY : "testCounter" ,
31
+ TEST_DATA_KEY : "testCounter" ,
32
32
TEST_STAT_NAME : "str" ,
33
33
CHAR_TEST_TYPE : "Fighter"
34
34
} ,
@@ -44,7 +44,7 @@ var PlayFabApiTests = {
44
44
} ,
45
45
46
46
LoginTests : function ( ) {
47
- // All tests run completely synchronously , which is a bit tricky.
47
+ // All tests run in parallel , which is a bit tricky.
48
48
// Some test rely on data loaded from other tests, and there's no super easy to force tests to be sequential/dependent
49
49
// In fact, most of the tests return here before they're done, and report back success/fail in some arbitrary future
50
50
@@ -147,6 +147,8 @@ var PlayFabApiTests = {
147
147
var invalidDone = assert . async ( ) ;
148
148
149
149
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
150
152
TitleId : PlayFab . settings . titleId ,
151
153
Email : PlayFabApiTests . titleData . userEmail ,
152
154
Password : PlayFabApiTests . titleData . userPassword + "INVALID"
@@ -270,10 +272,10 @@ var PlayFabApiTests = {
270
272
var getDataCallback2 = function ( result , error ) {
271
273
PlayFabApiTests . VerifyNullError ( result , error , assert , "Testing GetUserData result" ) ;
272
274
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" ) ;
274
276
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 ) ;
277
279
278
280
var now = Date . now ( ) ;
279
281
var testMin = now - ( 1000 * 60 * 5 ) ;
@@ -292,16 +294,16 @@ var PlayFabApiTests = {
292
294
PlayFabApiTests . VerifyNullError ( result , error , assert , "Testing GetUserData result" ) ;
293
295
assert . ok ( result . data . Data != null , "Testing GetUserData Data" ) ;
294
296
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 ) ;
297
299
PlayFabApiTests . testData . testNumber = ( PlayFabApiTests . testData . testNumber + 1 ) % 100 ; // This test is about the expected value changing - but not testing more complicated issues like bounds
298
300
299
301
var updateDataRequest = {
300
302
// Currently, you need to look up the correct format for this object in the API-docs:
301
303
// https://api.playfab.com/Documentation/Client/method/UpdateUserData
302
304
Data : { } // Can't pre-define properties because the param-name is in a string
303
305
} ;
304
- updateDataRequest . Data [ PlayFabApiTests . testConstants . TEST_KEY ] = PlayFabApiTests . testData . testNumber ;
306
+ updateDataRequest . Data [ PlayFabApiTests . testConstants . TEST_DATA_KEY ] = PlayFabApiTests . testData . testNumber ;
305
307
PlayFabClientSDK . UpdateUserData ( updateDataRequest , PlayFabApiTests . CallbackWrapper ( "updateDataCallback" , updateDataCallback , assert ) ) ;
306
308
get1Done ( ) ;
307
309
} ;
0 commit comments