Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -344,7 +344,7 @@ namespace System.Globalization.Tests
// Day is invalid
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, month, -1, hour, minute, second, millisecond, era));
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, month, 0, hour, minute, second, millisecond, era));
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, month, calendar.GetDaysInMonth(year, month, era) + 1, minute, second, millisecond, era));
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, month, calendar.GetDaysInMonth(year, month, era) + 1, hour, minute, second, millisecond, era));
// Hour is invalid
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, month, day, -1, minute, second, millisecond, era));

View File

@@ -11,7 +11,17 @@ namespace System.Globalization.Tests
[Fact]
public void Eras()
{
Assert.Equal(new int[] { 4, 3, 2, 1 }, new JapaneseCalendar().Eras);
int[] eras = new JapaneseCalendar().Eras;
int noOfEras = eras.Length;
Assert.True(noOfEras >= 4);
// eras should be [ noOfEras, noOfEras - 1, ..., 1 ]
Assert.Equal(noOfEras, eras[0]);
for (int i = 0; i < noOfEras; i++)
{
Assert.Equal(noOfEras - i, eras[i]);
}
}
}
}

View File

@@ -40,7 +40,7 @@ namespace System.Globalization.Tests
public static void JapaneseTest()
{
JapaneseCalendar jCal = new JapaneseCalendar();
DateTime dTest = jCal.ToDateTime(1, 1, 8, 0, 0, 0, 0);
DateTime dTest = jCal.ToDateTime(1, 1, 8, 0, 0, 0, 0, 4);
Assert.Equal(dTest, new DateTime(1989, 1, 8));
}
}