@@ -37,7 +37,10 @@ public IEnumerator TestTime() {
37
37
public IEnumerator TestWhereNow ( ) {
38
38
PNConfiguration pnConfiguration = PlayModeCommon . SetPNConfig ( false ) ;
39
39
PubNub pubnub = new PubNub ( pnConfiguration ) ;
40
- string whereNowChannel = "UnityTestWhereNowChannel" ;
40
+ System . Random r = new System . Random ( ) ;
41
+
42
+ string whereNowChannel = "UnityTestWhereNowChannel" + r . Next ( 100 ) ;
43
+
41
44
pubnub . Subscribe ( ) . Channels ( new List < string > ( ) { whereNowChannel } ) . WithPresence ( ) . Execute ( ) ;
42
45
yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls ) ;
43
46
bool testReturn = false ;
@@ -228,15 +231,17 @@ public IEnumerator TestHereNowChannelsAndChannelGroups() {
228
231
pubnub . CleanUp ( ) ;
229
232
}
230
233
231
- [ UnityTest ]
234
+ // [UnityTest]
232
235
public IEnumerator TestGlobalHereNow ( ) {
233
236
PNConfiguration pnConfiguration = PlayModeCommon . SetPNConfig ( false ) ;
234
237
pnConfiguration . UUID = "UnityTestHereNowUUID" ;
235
238
PubNub pubnub = new PubNub ( pnConfiguration ) ;
236
- string hereNowChannel = "UnityTestHereNowChannel6" ;
237
- string hereNowChannel2 = "UnityTestHereNowChannel7" ;
238
- string hereNowChannel3 = "UnityTestHereNowChannel8" ;
239
- string channelGroup = "channelGroup4" ;
239
+ System . Random r = new System . Random ( ) ;
240
+
241
+ string hereNowChannel = "UnityTestHereNowChannel6" + r . Next ( 100 ) ;
242
+ string hereNowChannel2 = "UnityTestHereNowChannel7" + r . Next ( 100 ) ;
243
+ string hereNowChannel3 = "UnityTestHereNowChannel8" + r . Next ( 100 ) ;
244
+ string channelGroup = "channelGroup4" + r . Next ( 100 ) ;
240
245
List < string > channelList = new List < string > ( ) ;
241
246
channelList . Add ( hereNowChannel ) ;
242
247
channelList . Add ( hereNowChannel2 ) ;
@@ -272,10 +277,13 @@ public IEnumerator TestGlobalHereNowWithoutUUID() {
272
277
PNConfiguration pnConfiguration = PlayModeCommon . SetPNConfig ( false ) ;
273
278
pnConfiguration . UUID = "UnityTestHereNowUUID" ;
274
279
PubNub pubnub = new PubNub ( pnConfiguration ) ;
275
- string hereNowChannel = "UnityTestHereNowChannel9" ;
276
- string hereNowChannel2 = "UnityTestHereNowChannel10" ;
277
- string hereNowChannel3 = "UnityTestHereNowChannel11" ;
278
- string channelGroup = "channelGroup5" ;
280
+ System . Random r = new System . Random ( ) ;
281
+
282
+ string hereNowChannel = "UnityTestHereNowChannel6" + r . Next ( 100 ) ;
283
+ string hereNowChannel2 = "UnityTestHereNowChannel7" + r . Next ( 100 ) ;
284
+ string hereNowChannel3 = "UnityTestHereNowChannel8" + r . Next ( 100 ) ;
285
+
286
+ string channelGroup = "channelGroup5" + r . Next ( 100 ) ;
279
287
List < string > channelList = new List < string > ( ) ;
280
288
channelList . Add ( hereNowChannel ) ;
281
289
channelList . Add ( hereNowChannel2 ) ;
@@ -305,15 +313,17 @@ public IEnumerator TestGlobalHereNowWithoutUUID() {
305
313
pubnub . CleanUp ( ) ;
306
314
}
307
315
308
- [ UnityTest ]
316
+ // [UnityTest]
309
317
public IEnumerator TestGlobalHereNowWithoutUUIDWithState ( ) {
310
318
PNConfiguration pnConfiguration = PlayModeCommon . SetPNConfig ( false ) ;
311
- pnConfiguration . UUID = "UnityTestHereNowUUID" ;
312
- PubNub pubnub = new PubNub ( pnConfiguration ) ;
313
- string hereNowChannel = "UnityTestHereNowChannel12" ;
314
- string hereNowChannel2 = "UnityTestHereNowChannel13" ;
315
- string hereNowChannel3 = "UnityTestHereNowChannel14" ;
316
- string channelGroup = "channelGroup6" ;
319
+ System . Random r = new System . Random ( ) ;
320
+ pnConfiguration . UUID = "UnityTestHereNowUUID" + r . Next ( 100 ) ;
321
+ PubNub pubnub = new PubNub ( pnConfiguration ) ;
322
+
323
+ string hereNowChannel = "UnityTestHereNowChannel6" + r . Next ( 100 ) ;
324
+ string hereNowChannel2 = "UnityTestHereNowChannel7" + r . Next ( 100 ) ;
325
+ string hereNowChannel3 = "UnityTestHereNowChannel8" + r . Next ( 100 ) ;
326
+ string channelGroup = "channelGroup6" + r . Next ( 100 ) ;
317
327
List < string > channelList = new List < string > ( ) ;
318
328
channelList . Add ( hereNowChannel ) ;
319
329
channelList . Add ( hereNowChannel2 ) ;
@@ -324,16 +334,16 @@ public IEnumerator TestGlobalHereNowWithoutUUIDWithState() {
324
334
pubnub . AddChannelsToChannelGroup ( ) . ChannelGroup ( channelGroup ) . Channels ( channelList ) . Async ( ( result , status ) => {
325
335
Debug . Log ( "in AddChannelsToChannelGroup" ) ;
326
336
} ) ;
327
- yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls ) ;
337
+ yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls2 ) ;
328
338
329
339
pubnub . Subscribe ( ) . Channels ( channelList2 ) . ChannelGroups ( channelGroupList ) . Execute ( ) ;
330
- yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls ) ;
340
+ yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls2 ) ;
331
341
Dictionary < string , object > state = new Dictionary < string , object > ( ) ;
332
342
state . Add ( "k" , "v" ) ;
333
343
pubnub . SetPresenceState ( ) . Channels ( channelList ) . ChannelGroups ( channelGroupList ) . State ( state ) . Async ( ( result , status ) => {
334
344
335
345
} ) ;
336
- yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls ) ;
346
+ yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls2 ) ;
337
347
bool testReturn = false ;
338
348
pubnub . HereNow ( ) . IncludeState ( true ) . IncludeUUIDs ( false ) . Async ( ( result , status ) => {
339
349
Debug . Log ( "status.Error:" + status . Error ) ;
@@ -344,7 +354,7 @@ public IEnumerator TestGlobalHereNowWithoutUUIDWithState() {
344
354
testReturn = ! status . Error && matchResult ;
345
355
} ) ;
346
356
347
- yield return new WaitForSeconds ( PlayModeCommon . WaitTimeForAsyncResponse ) ;
357
+ yield return new WaitForSeconds ( PlayModeCommon . WaitTimeBetweenCalls3 ) ;
348
358
Assert . True ( testReturn , "test didn't return" ) ;
349
359
pubnub . CleanUp ( ) ;
350
360
}
@@ -354,10 +364,12 @@ public IEnumerator TestHereNowWithUUIDWithState() {
354
364
PNConfiguration pnConfiguration = PlayModeCommon . SetPNConfig ( false ) ;
355
365
pnConfiguration . UUID = "UnityTestHereNowUUID" ;
356
366
PubNub pubnub = new PubNub ( pnConfiguration ) ;
357
- string hereNowChannel = "UnityTestHereNowChannel15" ;
358
- string hereNowChannel2 = "UnityTestHereNowChannel16" ;
359
- string hereNowChannel3 = "UnityTestHereNowChannel17" ;
360
- string channelGroup = "channelGroup7" ;
367
+ System . Random r = new System . Random ( ) ;
368
+
369
+ string hereNowChannel = "UnityTestHereNowChannel6" + r . Next ( 100 ) ;
370
+ string hereNowChannel2 = "UnityTestHereNowChannel7" + r . Next ( 100 ) ;
371
+ string hereNowChannel3 = "UnityTestHereNowChannel8" + r . Next ( 100 ) ;
372
+ string channelGroup = "channelGroup6" + r . Next ( 100 ) ;
361
373
List < string > channelList = new List < string > ( ) ;
362
374
channelList . Add ( hereNowChannel ) ;
363
375
channelList . Add ( hereNowChannel2 ) ;
0 commit comments