Exemple #1
0
        public void TestOrdinality(int year, int month, int day, NSCalendarUnit smaller, NSCalendarUnit larger, int expected)
        {
            var cal        = new NSCalendar(NSCalendarType.Gregorian);
            var date       = new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Local);
            var ordinality = cal.Ordinality(smaller, larger, (NSDate)date);

            Assert.AreEqual(ordinality, expected);
        }
        public void TestOrdinality(int year, int month, int day, NSCalendarUnit smaller, NSCalendarUnit larger, int expected)
        {
            var cal  = new NSCalendar(NSCalendarType.Gregorian);
            var date = new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Utc);
            var dt   = (NSDate)date;

            cal.TimeZone = NSTimeZone.FromName("Europe/Madrid");
            Assert.AreEqual((nuint)expected, cal.Ordinality(smaller, larger, dt), $"Ordinality");
        }