Skip to content

Commit 448ab31

Browse files
committed
Another attempt to make test more reliable and diagnozable
1 parent 2152cdb commit 448ab31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

com.unity.mobile.notifications/Tests/Runtime/iOS/iOSNotificationTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public void AfterEachTest()
7474
{
7575
receivedNotificationCount = 0;
7676
lastReceivedNotification = null;
77+
iOSNotificationCenter.RemoveAllScheduledNotifications();
7778
}
7879
#endif
7980

@@ -158,7 +159,7 @@ public IEnumerator SendNotificationWithUserInfo_NotificationIsReceivedWithSameUs
158159
IEnumerator SendNotificationUsingCalendarTrigger_NotificationIsReceived(string text, bool useUtc)
159160
{
160161
var dateTime = useUtc ? DateTime.UtcNow : DateTime.Now;
161-
var dt = dateTime.AddSeconds(3);
162+
var dt = dateTime.AddSeconds(5);
162163
var trigger = new iOSNotificationCalendarTrigger()
163164
{
164165
Year = dt.Year,
@@ -180,6 +181,7 @@ IEnumerator SendNotificationUsingCalendarTrigger_NotificationIsReceived(string t
180181
};
181182

182183
iOSNotificationCenter.ScheduleNotification(notification);
184+
Debug.Log($"SendNotificationUsingCalendarTrigger_NotificationIsReceived, Now: {dateTime}, Notification should arrive on: {dt}");
183185
yield return WaitForNotification(10.0f);
184186
Assert.AreEqual(1, receivedNotificationCount);
185187
Assert.IsNotNull(lastReceivedNotification);

0 commit comments

Comments
 (0)