A few tests are currently ignored when running on a system where the default
culture isn't "en" or "en-US". This patch changes Culture attributes to
SetCulture attributes instead to make those tests run on all system and make
NUnit set the culture to the required one during the test run.
Also found and fixed a test failure in one of these methods,
DateTimeTest.ToUniversalTime_TimeZoneOffsetShouldNotOverflow(), which assumed
the minimum year is 0 while it's actually 1. Confirmed that this is the case
on .NET as well.
public void ToUniversalTime_TimeZoneOffsetShouldNotOverflow ()
{
var m = DateTime.MaxValue;
public void ToUniversalTime_TimeZoneOffsetShouldNotOverflow ()
{
var m = DateTime.MaxValue;
res = m.ToUniversalTime ();
// It does not matter which time zone but we should never overflow or have DateTime.MinValue
res = m.ToUniversalTime ();
// It does not matter which time zone but we should never overflow or have DateTime.MinValue
- Assert.AreEqual (0, res.Year, "#10");
+ Assert.AreEqual (1, res.Year, "#10");
Assert.AreEqual (1, res.Month, "#11");
Assert.AreEqual (1, res.Day, "#12");
Assert.AreEqual (DateTimeKind.Utc, res.Kind, "#13");
Assert.AreEqual (1, res.Month, "#11");
Assert.AreEqual (1, res.Day, "#12");
Assert.AreEqual (DateTimeKind.Utc, res.Kind, "#13");
public void TestParse()
{
// Boolean Decimal.TryParse(String, NumberStyles, IFormatProvider, Decimal)
public void TestParse()
{
// Boolean Decimal.TryParse(String, NumberStyles, IFormatProvider, Decimal)
public void TestToString()
{
// String Decimal.ToString()
public void TestToString()
{
// String Decimal.ToString()
public void TestNumberBufferLimit()
{
Decimal dE = 1234567890123456789012345.6785m;
public void TestNumberBufferLimit()
{
Decimal dE = 1234567890123456789012345.6785m;
public void Parse ()
{
int i = 0;
public void Parse ()
{
int i = 0;