Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't modify default UnitAbbreviationsCache in test
  • Loading branch information
tmilnthorp committed Sep 9, 2020
commit 5be4cf7052da175622f2e99e9d9fe12a67d31fd4
9 changes: 6 additions & 3 deletions UnitsNet.Tests/UnitAbbreviationsCacheTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,13 @@ public void MapUnitToDefaultAbbreviation_GivenCustomAbbreviation_SetsAbbreviatio
}

[Fact]
public void MapUnitOverrideTest()
public void MapUnitToDefaultAbbreviation_ParsesUsingDefaultString()
{
UnitAbbreviationsCache.Default.MapUnitToDefaultAbbreviation(MassFlowUnit.GramPerSecond, NorwegianCulture, "grams/second");
Assert.Equal(MassFlow.FromPoundsPerSecond(10), Quantity.Parse(NorwegianCulture, typeof(MassFlow), "10 lb/s"));
var cache = new UnitAbbreviationsCache();
cache.MapUnitToDefaultAbbreviation(MassFlowUnit.GramPerSecond, NorwegianCulture, "grams/second");

var parser = new QuantityParser(cache);
Assert.Equal(MassFlow.FromPoundsPerSecond(10), parser.Parse<MassFlow, MassFlowUnit>("10 lb/s", NorwegianCulture, MassFlow.From));
}

[Fact]
Expand Down