Skip to content

Commit bb74d23

Browse files
committed
Add test for missing Utc field
1 parent ed98519 commit bb74d23

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,4 +388,26 @@ public void iOSNotification_CalendarTrigger_ReturnsSameKindDateTime()
388388
Assert.AreEqual(trigger2.Minute, retTrigger.Minute);
389389
Assert.AreEqual(trigger2.UtcTime, retTrigger.UtcTime);
390390
}
391+
392+
[Test]
393+
public void iOSNotificationCalendarTrigger_HandlesMissingUtcField()
394+
{
395+
var original = new iOSNotificationCalendarTrigger()
396+
{
397+
Day = 5,
398+
};
399+
400+
var notification = new iOSNotification()
401+
{
402+
Trigger = original,
403+
};
404+
405+
// clear UserInfo, where UTC flag is stored
406+
notification.UserInfo.Clear();
407+
408+
Assert.AreEqual(iOSNotificationTriggerType.Calendar, notification.Trigger.Type);
409+
var result = (iOSNotificationCalendarTrigger)notification.Trigger;
410+
Assert.AreEqual(5, result.Day);
411+
Assert.IsFalse(result.UtcTime);
412+
}
391413
}

0 commit comments

Comments
 (0)