diff --git a/UnitsNet.Tests/CustomCode/AreaTests.cs b/UnitsNet.Tests/CustomCode/AreaTests.cs index 85fe8fee1a..dfa4dd5e39 100644 --- a/UnitsNet.Tests/CustomCode/AreaTests.cs +++ b/UnitsNet.Tests/CustomCode/AreaTests.cs @@ -92,17 +92,21 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() } [Fact] - public void As_ImperialGivenSIUnitSystem_ReturnsSIValue() + public void As_GivenSIUnitSystem_ReturnsSIValue() { - var imperialArea = new Area(2.0, AreaUnit.SquareInch); - Assert.Equal(0.00129032, imperialArea.As(UnitSystem.SI)); + var squareInches = new Area(2.0, AreaUnit.SquareInch); + Assert.Equal(0.00129032, squareInches.As(UnitSystem.SI)); } [Fact] - public void ToUnit_ImperialGivenSIUnitSystem_ReturnsSIValue() + public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity() { - var imperialArea = new Area(2.0, AreaUnit.SquareInch); - Assert.Equal(Area.FromSquareMeters(0.00129032), imperialArea.ToUnit(UnitSystem.SI)); + var squareInches = new Area(2.0, AreaUnit.SquareInch); + + var inSI = squareInches.ToUnit(UnitSystem.SI); + + Assert.Equal(0.00129032, inSI.Value); + Assert.Equal(AreaUnit.SquareMeter, inSI.Unit); } } } diff --git a/UnitsNet.Tests/CustomCode/EnergyTests.cs b/UnitsNet.Tests/CustomCode/EnergyTests.cs index 3f99aec9df..f37022a074 100644 --- a/UnitsNet.Tests/CustomCode/EnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/EnergyTests.cs @@ -62,17 +62,21 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() } [Fact] - public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() + public void As_GivenSIUnitSystem_ReturnsSIValue() { - var imperialEnergy = new Energy(2.0, EnergyUnit.BritishThermalUnit); - Assert.Equal(2110.11170524, imperialEnergy.As(UnitSystem.SI)); + var btus = new Energy(2.0, EnergyUnit.BritishThermalUnit); + Assert.Equal(2110.11170524, btus.As(UnitSystem.SI)); } [Fact] - public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() + public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity() { - var imperialEnergy = new Energy(2.0, EnergyUnit.BritishThermalUnit); - Assert.Equal(Energy.FromJoules(2110.11170524), imperialEnergy.ToUnit(UnitSystem.SI)); + var btus = new Energy(2.0, EnergyUnit.BritishThermalUnit); + + var inSI = btus.ToUnit(UnitSystem.SI); + + Assert.Equal(2110.11170524, inSI.Value); + Assert.Equal(EnergyUnit.Joule, inSI.Unit); } } } diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index ec54147c2f..123e00ca3c 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -167,17 +167,21 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() } [Fact] - public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() + public void As_GivenSIUnitSystem_ReturnsSIValue() { - var imperialLength = new Length(2.0, LengthUnit.Inch); - Assert.Equal(0.0508, imperialLength.As(UnitSystem.SI)); + var inches = new Length(2.0, LengthUnit.Inch); + Assert.Equal(0.0508, inches.As(UnitSystem.SI)); } [Fact] - public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() + public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity() { - var imperialLength = new Length(2.0, LengthUnit.Inch); - Assert.Equal(Length.FromMeters(0.0508), imperialLength.ToUnit(UnitSystem.SI)); + var inches = new Length(2.0, LengthUnit.Inch); + + var inSI = inches.ToUnit(UnitSystem.SI); + + Assert.Equal(0.0508, inSI.Value); + Assert.Equal(LengthUnit.Meter, inSI.Unit); } } } diff --git a/UnitsNet.Tests/IQuantityTests.cs b/UnitsNet.Tests/IQuantityTests.cs index 382cd25bb2..5c19449965 100644 --- a/UnitsNet.Tests/IQuantityTests.cs +++ b/UnitsNet.Tests/IQuantityTests.cs @@ -24,10 +24,10 @@ public void As_GivenNullUnitSystem_ThrowsArgumentNullException() } [Fact] - public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() + public void As_GivenSIUnitSystem_ReturnsSIValue() { - IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); - Assert.Equal(0.0508, imperialLengthQuantity.As(UnitSystem.SI)); + IQuantity inches = new Length(2.0, LengthUnit.Inch); + Assert.Equal(0.0508, inches.As(UnitSystem.SI)); } [Fact] @@ -45,10 +45,14 @@ public void ToUnit_GivenNullUnitSystem_ThrowsArgumentNullException() } [Fact] - public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() + public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity() { - IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); - Assert.Equal(Length.FromMeters(0.0508), imperialLengthQuantity.ToUnit(UnitSystem.SI)); + IQuantity inches = new Length(2.0, LengthUnit.Inch); + + IQuantity inSI = inches.ToUnit(UnitSystem.SI); + + Assert.Equal(0.0508, inSI.Value); + Assert.Equal(LengthUnit.Meter, inSI.Unit); } } }