Skip to content

Commit

Permalink
Changes related to PR review.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebfortin committed Jul 15, 2023
1 parent 23d1dd5 commit 1d49861
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,23 @@ public void UnitsNetBaseJsonConverter_ConvertIQuantity_throws_ArgumentNullExcept
public void UnitsNetBaseJsonConverter_ConvertValueUnit_works_as_expected()
{
var result = _sut.Test_ConvertDecimalValueUnit("PowerUnit.Watt", 10.2365m);
var convert = _sut.Test_ConvertDoubleIQuantity(result);

Assert.NotNull(result);
Assert.IsType<Power>(result);
Assert.True(Power.FromWatts(10.2365).Equals((Power)result, 1e-5, ComparisonType.Absolute));
Assert.Equal("PowerUnit.Watt", convert.Unit);
Assert.Equal(10.2365, convert.Value);
}

[Fact]
public void UnitsNetBaseJsonConverter_ConvertValueUnit_double_works_as_expected()
{
var result = _sut.Test_ConvertDoubleValueUnit("PowerUnit.Watt", 10.2365);

Assert.NotNull(result);
Assert.IsType<Power>(result);
Assert.Equal("Watt", result.Unit.ToString());
Assert.Equal(10.2365, result.Value);
}

[Fact]
Expand Down

0 comments on commit 1d49861

Please sign in to comment.