public object MarshalNativeToManaged(IntPtr pNativeData) { if (pNativeData == IntPtr.Zero) { return(default(DateTime)); } return(ObjC.FromNSDate(pNativeData)); }
public void FromNSDate() { //UTC now without the milliseconds var date = DateTime.UtcNow; date = date.AddMilliseconds(-date.Millisecond); IntPtr handle = ObjC.ToNSDate(date); var actual = ObjC.FromNSDate(handle); Assert.AreEqual(date.ToShortDateString(), actual.ToShortDateString()); Assert.AreEqual(date.ToShortTimeString(), actual.ToShortTimeString()); }
public void FromNSDateNull() { var date = ObjC.FromNSDate(IntPtr.Zero); Assert.AreEqual(default(DateTime), date); }