File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
com.unity.mobile.notifications/Tests/Runtime/Android Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,10 @@ public IEnumerator SendNotification_CanReschedule()
317
317
int id = AndroidNotificationCenter . SendNotification ( n , kDefaultTestChannel ) ;
318
318
yield return new WaitForSeconds ( 0.2f ) ;
319
319
320
+ // temporary null the manager, cause that's what we have in reality
321
+ var manager = managerClass . GetStatic < AndroidJavaObject > ( "mUnityNotificationManager" ) ;
322
+ managerClass . SetStatic < AndroidJavaObject > ( "mUnityNotificationManager" , null ) ;
323
+
320
324
// simulate reboot by directly cancelling scheduled alarms preserving saves
321
325
managerClass . CallStatic ( "cancelPendingNotificationIntent" , context , id ) ;
322
326
yield return new WaitForSeconds ( 0.2f ) ;
@@ -327,6 +331,8 @@ public IEnumerator SendNotification_CanReschedule()
327
331
328
332
Debug . LogWarning ( "SendNotification_CanReschedule completed" ) ;
329
333
334
+ // restore manager (to not ruin other tests)
335
+ managerClass . SetStatic ( "mUnityNotificationManager" , manager ) ;
330
336
Assert . AreEqual ( 1 , currentHandler . receivedNotificationCount ) ;
331
337
}
332
338
}
You can’t perform that action at this time.
0 commit comments