Skip to content

Commit

Permalink
Add extra locale test
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrawehr committed May 26, 2020
1 parent b2113ee commit e2b4f67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions UnitsNet.Tests/QuantityIFormattableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ public void SFormatEqualsSignificantDigits(string sFormatString, string expected
Assert.Equal(expected, length.ToString(sFormatString, NumberFormatInfo.InvariantInfo));
}

[Fact]
public void FormattingUsesSuppliedLocale()
{
Temperature t = Temperature.FromDegreesCelsius(2012.1234);
CultureInfo c = CultureInfo.CreateSpecificCulture("de-CH");
string formatted = string.Format(c, "{0:g}", t);
Assert.Equal("2'012.12 °C", formatted);
}

[Fact]
public void UFormatEqualsUnitToString()
{
Expand Down

0 comments on commit e2b4f67

Please sign in to comment.