Skip to content

Commit

Permalink
Merge pull request dotnet#2 from steveharter/cultureinfo
Browse files Browse the repository at this point in the history
base locale and formatting for linux
  • Loading branch information
ellismg committed Sep 1, 2015
2 parents ca7ac65 + 97ae6de commit 6b4daae
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public void TestNullCulture()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void TestInvalidCulture()
{
Assert.Throws<CultureNotFoundException>(() => { CultureInfo myCulture = new CultureInfo("NotAValidCulture"); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void TestInvariantCulture()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void TestEqualNameAndCultureIdentifier()
{
CultureInfo myCultureInfo = new CultureInfo("en");
Expand Down Expand Up @@ -65,7 +64,6 @@ public void TestEqualCultureIdentifier()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void TestUnequal()
{
CultureInfo myCultureInfo = new CultureInfo("en-US");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public void PosTest1()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
CultureInfo myCultureInfo = new CultureInfo("fr");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace System.Globalization.Tests
public class CultureInfoParent
{
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
CultureInfo myExpectParentCulture = new CultureInfo("en");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace System.Globalization.Tests
public class CultureInfoToString
{
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
string expectName = "en-US";
Expand All @@ -19,7 +18,6 @@ public void PosTest1()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
string expectName = "en";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace System.Globalization.Tests
public class CultureInfoTwoLetterISOLanguageName
{
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
CultureInfo myCultureInfo = new CultureInfo("de-DE");
Expand All @@ -19,7 +18,6 @@ public void PosTest1()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
CultureInfo myCultureInfo = new CultureInfo("en");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,47 @@ public class RegionInfoCtor1
{
// PosTest1:Initialize the RegionInfo 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
CultureInfo myCultur = new CultureInfo("en-US");
string culture = myCultur.Name;
RegionInfo myRegInfo = new RegionInfo(culture);
Assert.False(myRegInfo.Name != "en-US" && myRegInfo.Name != "US");
Assert.True(myRegInfo.Name == "en-US" || myRegInfo.Name == "US");
}

// PosTest2:Initialize the RegionInfo 2
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
CultureInfo myCultur = new CultureInfo("zh-CN");
string culture = myCultur.Name;
RegionInfo myRegInfo = new RegionInfo(culture);
Assert.False(myRegInfo.Name != "zh-CN" && myRegInfo.Name != "CN");
Assert.True(myRegInfo.Name == "zh-CN" || myRegInfo.Name == "CN");
}

// PosTest3:Initialize the RegionInfo 3
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
CultureInfo myCultur = new CultureInfo("en-IE");
string culture = myCultur.Name;
RegionInfo myRegInfo = new RegionInfo(culture);
Assert.False(myRegInfo.Name != "en-IE" && myRegInfo.Name != "IE");
Assert.True(myRegInfo.Name == "en-IE" || myRegInfo.Name == "IE");
}

// PosTest4:Initialize the RegionInfo 4
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest4()
{
CultureInfo myCultur = new CultureInfo("en-GB");
string culture = myCultur.Name;
RegionInfo myRegInfo = new RegionInfo(culture);
Assert.False(myRegInfo.Name != "en-GB" && myRegInfo.Name != "GB");
Assert.True(myRegInfo.Name == "en-GB" || myRegInfo.Name == "GB");
}

// NegTest1:culture specifies neutral culture 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void NegTest1()
{
CultureInfo myCultur = new CultureInfo("en");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ namespace System.Globalization.Tests
public class RegionInfoCtor2
{
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
string name = "en-US";
RegionInfo myRegInfo = new RegionInfo(name);
Assert.False(myRegInfo.Name != name && myRegInfo.Name != "US");
Assert.True(myRegInfo.Name == name || myRegInfo.Name == "US");
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
string name = "US";
Expand All @@ -28,16 +26,14 @@ public void PosTest2()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
string name = "zh-CN";
RegionInfo myRegInfo = new RegionInfo(name);
Assert.False(myRegInfo.Name != name && myRegInfo.Name != "CN");
Assert.True(myRegInfo.Name == name || myRegInfo.Name == "CN");
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest4()
{
string name = "CN";
Expand All @@ -46,16 +42,14 @@ public void PosTest4()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest5()
{
string name = "en-IE";
RegionInfo myRegInfo = new RegionInfo(name);
Assert.False(myRegInfo.Name != name && myRegInfo.Name != "IE");
Assert.True(myRegInfo.Name == name || myRegInfo.Name == "IE");
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest6()
{
string name = "IE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class RegionInfoCurrencySymbol
{
// PosTest1:Return the CurrencySymbol property in RegionInfo object 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
CultureInfo myCulture = new CultureInfo("en-US");
Expand All @@ -22,12 +21,13 @@ public void PosTest1()

// PosTest2:Return the CurrencySymbol property in RegionInfo object 2
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
RegionInfo regionInfo = new RegionInfo("zh-CN");
string strCurrencySymbol = regionInfo.CurrencySymbol;
Assert.Equal(strCurrencySymbol, "\u00A5");
Assert.True(strCurrencySymbol.Equals("\u00A5") || strCurrencySymbol.Equals("\uffe5"));
// \u00A5 is Latin-1 Supplement (Windows), \uffe5 is Halfwidth and Fullwidth Forms (ICU)
// String.Normalize(NormalizationForm.FormKD) could also be used if it was ported
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class RegionInfoEnglishName
{
// PosTest1:Return the property EngLishName in RegionInfo object 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
RegionInfo regionInfo = new RegionInfo("en-US");
Expand All @@ -21,7 +20,6 @@ public void PosTest1()

// PosTest2:Return the property EngLishName in RegionInfo object 2
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
RegionInfo regionInfo = new RegionInfo("US");
Expand All @@ -31,17 +29,15 @@ public void PosTest2()

// PosTest3:Return the property EngLishName in RegionInfo object 3
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
RegionInfo regionInfo = new RegionInfo("CN");
string strVal = regionInfo.EnglishName;
string strVal = regionInfo.EnglishName;
Assert.True(strVal == "China" || strVal == "People's Republic of China");
}

// PosTest4:Return the property EngLishName in RegionInfo object 4
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest4()
{
RegionInfo regionInfo = new RegionInfo("zh-CN");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public void PosTest1()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
RegionInfo regionInfo1 = new RegionInfo("en-US");
Expand All @@ -27,6 +26,7 @@ public void PosTest2()
}

[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
RegionInfo regionInfo1 = new RegionInfo("US");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class RegionInfoISOCurrencySymbol
{
// PosTest1:Return the property ISOCurrencySymbol in RegionInfo object 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
RegionInfo regionInfo = new RegionInfo("en-US");
Expand All @@ -21,7 +20,6 @@ public void PosTest1()

// PosTest2:Return the property ISOCurrencySymbol in RegionInfo object 2
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
RegionInfo regionInfo = new RegionInfo("zh-CN");
Expand All @@ -31,7 +29,6 @@ public void PosTest2()

// PosTest3:Return the property ISOCurrencySymbol in RegionInfo object 3
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
RegionInfo regionInfo = new RegionInfo("de-DE");
Expand All @@ -41,7 +38,6 @@ public void PosTest3()

// PosTest4:Return the property ISOCurrencySymbol in RegionInfo object 4
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest4()
{
RegionInfo regionInfo = new RegionInfo("it-IT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class RegionInfoIsMetric
{
// PosTest1:Return the property IsMetric in RegionInfo object 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
RegionInfo regionInfo = new RegionInfo("en-US");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void PosTest1()
{
RegionInfo regionInfo = new RegionInfo("en-US");
string strName = regionInfo.Name;
Assert.Equal(strName, "US");
Assert.Equal("US", strName); //note: this is not consistent with full .NET
}

// PosTest2:Return the property Name in RegionInfo object 2
Expand All @@ -26,12 +26,11 @@ public void PosTest2()
{
RegionInfo regionInfo = new RegionInfo("zh-CN");
string strName = regionInfo.Name;
Assert.Equal(strName, "CN");
Assert.Equal("CN", strName); //note: this is not consistent with full .NET
}

// PosTest3:Return the property Name in RegionInfo object 3
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
RegionInfo regionInfo = new RegionInfo("US");
Expand All @@ -41,7 +40,6 @@ public void PosTest3()

// PosTest4:Return the property Name in RegionInfo object 4
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest4()
{
RegionInfo regionInfo = new RegionInfo("CN");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class RegionInfoTwoLetterISORegionName
{
// PosTest1:Return the property TwoLetterISORegionName in RegionInfo object 1
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest1()
{
RegionInfo regionInfo = new RegionInfo("en-US");
Expand All @@ -21,7 +20,6 @@ public void PosTest1()

// PosTest2:Return the property TwoLetterISORegionName in RegionInfo object 2
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest2()
{
RegionInfo regionInfo = new RegionInfo("zh-CN");
Expand All @@ -31,7 +29,6 @@ public void PosTest2()

// PosTest3:Return the property TwoLetterISORegionName in RegionInfo object 3
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest3()
{
RegionInfo regionInfo = new RegionInfo("de-DE");
Expand All @@ -41,7 +38,6 @@ public void PosTest3()

// PosTest4:Return the property TwoLetterISORegionName in RegionInfo object 4
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void PosTest4()
{
RegionInfo regionInfo = new RegionInfo("it-IT");
Expand Down
2 changes: 1 addition & 1 deletion src/System.Globalization/tests/TextInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static void TurkishICasing(string localeName)
[InlineData("")]
[InlineData("en-US")]
[InlineData("fr-FR")]
public static void NoUnicodeSpecalCases(string localeName)
public static void NoUnicodeSpecialCases(string localeName)
{
// Unicode defines some codepoints which expand into multiple codepoints
// when cased (see SpecialCasing.txt from UNIDATA for some examples). We have never done
Expand Down
2 changes: 0 additions & 2 deletions src/System.Globalization/tests/TextInfo/TextInfoToString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class TextInfoToString
{
// PosTest1: Verify the en-US TextInfo
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void VerifyEnUSTextInfo()
{
TextInfo textInfoUS = new CultureInfo("en-US").TextInfo;
Expand All @@ -21,7 +20,6 @@ public void VerifyEnUSTextInfo()

// PosTest2: Verify the fr-FR CultureInfo's TextInfo
[Fact]
[ActiveIssue(846, PlatformID.AnyUnix)]
public void VerifyFrFRTextInfo()
{
TextInfo textInfoFrance = new CultureInfo("fr-FR").TextInfo;
Expand Down

0 comments on commit 6b4daae

Please sign in to comment.