-
Notifications
You must be signed in to change notification settings - Fork 514
/
CalendarTest.cs
46 lines (39 loc) · 1.32 KB
/
CalendarTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2013 Xamarin Inc. All rights reserved.
using System;
using System.Globalization;
using Foundation;
using NUnit.Framework;
namespace DontLink.Calendars {
[TestFixture]
// we want the tests to be available because we use the linker
[Preserve (AllMembers = true)]
public class CalendarTest {
// application must *NOT* be build with I18N.MidEast and I18N.Other (Thai)
[Test]
public void UmAlQura ()
{
var ci = CultureInfo.GetCultureInfo ("ar");
#if NET // https://github.com/dotnet/runtime/issues/50859
Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.GregorianCalendar"), "Calendar");
#else
Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.UmAlQuraCalendar"), "Calendar");
#endif
}
[Test]
public void Hijri ()
{
var ci = CultureInfo.GetCultureInfo ("ps");
#if NET // https://github.com/dotnet/runtime/issues/50859
Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.PersianCalendar"), "Calendar");
#else
Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.HijriCalendar"), "Calendar");
#endif
}
[Test]
public void ThaiBuddhist ()
{
var ci = CultureInfo.GetCultureInfo ("th");
Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.ThaiBuddhistCalendar"), "Calendar");
}
}
}