public void GetAbbreviatedEraName_Invalid() { var format = new CultureInfo("en-US").DateTimeFormat; Assert.Throws<ArgumentOutOfRangeException>("era", () => format.GetAbbreviatedEraName(-1)); // Era < 0 const int EnUSMaxEra = 1; Assert.Throws<ArgumentOutOfRangeException>("era", () => format.GetAbbreviatedEraName(EnUSMaxEra + 1)); // Era > max era for the culture }
public void GetAbbreviatedEraName_Invalid() { var format = new CultureInfo("en-US").DateTimeFormat; Assert.Throws <ArgumentOutOfRangeException>("era", () => format.GetAbbreviatedEraName(-1)); // Era < 0 const int EnUSMaxEra = 1; Assert.Throws <ArgumentOutOfRangeException>("era", () => format.GetAbbreviatedEraName(EnUSMaxEra + 1)); // Era > max era for the culture }
public void TestInvalidEra() { DateTimeFormatInfo info = new CultureInfo("en-us").DateTimeFormat; Assert.Throws <ArgumentOutOfRangeException>(() => { info.GetAbbreviatedEraName(-1); }); Assert.Throws <ArgumentOutOfRangeException>(() => { info.GetAbbreviatedEraName(2); }); }
public void GetAbbreviatedEraName_Invalid(int era) { var format = new CultureInfo("en-US").DateTimeFormat; AssertExtensions.Throws <ArgumentOutOfRangeException>("era", () => format.GetAbbreviatedEraName(era)); }