diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index bbde37cc6b..dfaa53af3d 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -1151,9 +1151,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity<{_unitEnumName}> IQuantity<{_unitEnumName}>.ToUnit({_unitEnumName} unit) => ToUnit(unit); - /// - IQuantity<{_unitEnumName}> IQuantity<{_unitEnumName}>.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs index b2ebbdf0b3..a5818b07cf 100644 --- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs @@ -412,37 +412,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() {{ - Assert.Multiple(() => - {{ - var quantity = new {_quantity.Name}(value: 1, unit: {_baseUnitFullName}); - - {_quantity.Name} convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal({_baseUnitFullName}, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }}, () => - {{ - IQuantity<{_unitEnumName}> quantity = new {_quantity.Name}(value: 1, unit: {_baseUnitFullName}); - - IQuantity<{_unitEnumName}> convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal({_baseUnitFullName}, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }}); - }} - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - {{ - IQuantity quantity = new {_quantity.Name}(value: 1, unit: {_baseUnitFullName}); + var quantity = new {_quantity.Name}(value: 1, unit: {_baseUnitFullName}); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + {_quantity.Name} convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal({_baseUnitFullName}, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); }} - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() {{ @@ -450,15 +427,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => {{ var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }}, () => {{ IQuantity<{_unitEnumName}> quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }}, () => {{ IQuantity quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }}); }} "); @@ -508,35 +485,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = {_quantity.Name}.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - {{ - {_quantity.Name} quantityToConvert = quantity; - - {_quantity.Name} convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }}, () => - {{ - IQuantity<{_unitEnumName}> quantityToConvert = quantity; - - IQuantity<{_unitEnumName}> convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }}); - }} - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - {{ - var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - var expectedUnit = {_quantity.Name}.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + {_quantity.Name} convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -546,46 +495,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() {{ UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - {{ - var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }}, () => - {{ - IQuantity<{_unitEnumName}> quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }}); - }} - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - {{ - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }} [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() {{ var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - {{ - var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }}, () => - {{ - IQuantity<{_unitEnumName}> quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }}); - }} - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - {{ - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); }} "); } diff --git a/UnitsNet.Tests/CustomCode/ElectricApparentEnergyTests.cs b/UnitsNet.Tests/CustomCode/ElectricApparentEnergyTests.cs index 0e03d7c445..33e85f4386 100644 --- a/UnitsNet.Tests/CustomCode/ElectricApparentEnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/ElectricApparentEnergyTests.cs @@ -55,11 +55,5 @@ public override void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() { base.ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits(); } - - [Fact(Skip = "See about adding an SI unit (VoltampereSecond, Joules?)")] - public override void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - base.ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits(); - } } } diff --git a/UnitsNet.Tests/CustomCode/ElectricReactiveEnergyTests.cs b/UnitsNet.Tests/CustomCode/ElectricReactiveEnergyTests.cs index c6a879999c..f1a56b6811 100644 --- a/UnitsNet.Tests/CustomCode/ElectricReactiveEnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/ElectricReactiveEnergyTests.cs @@ -54,11 +54,5 @@ public override void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() { base.ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits(); } - - [Fact(Skip = "See about adding an SI unit (VoltampereReactiveSecond, Joules?)")] - public override void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - base.ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits(); - } } } diff --git a/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs b/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs index 06bf5627cb..3e6e249af0 100644 --- a/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs +++ b/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs @@ -54,11 +54,5 @@ public override void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() { base.ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits(); } - - [Fact(Skip = "The SI unit would have to be MeterPerCubicMeter")] - public override void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - base.ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits(); - } } } diff --git a/UnitsNet.Tests/CustomCode/IQuantityTests.cs b/UnitsNet.Tests/CustomCode/IQuantityTests.cs index 012f0cc09f..ce591ef0aa 100644 --- a/UnitsNet.Tests/CustomCode/IQuantityTests.cs +++ b/UnitsNet.Tests/CustomCode/IQuantityTests.cs @@ -1,31 +1,84 @@ // Licensed under MIT No Attribution, see LICENSE file at the root. // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. -using System; -using System.Linq; -using Xunit; +namespace UnitsNet.Tests; -namespace UnitsNet.Tests +// ReSharper disable once InconsistentNaming +public partial class IQuantityTests { - // ReSharper disable once InconsistentNaming - public partial class IQuantityTests + [Fact] + public void As_GivenWrongUnitType_ThrowsArgumentException() { - [Fact] - public void As_GivenWrongUnitType_ThrowsArgumentException() + Assert.All(Quantity.Infos.Select(x => x.Zero), quantity => { Assert.Throws(() => quantity.As(ComparisonType.Absolute)); }); + } + + [Fact] + public void ToUnit_GivenWrongUnitType_ThrowsArgumentException() + { + Assert.All(Quantity.Infos.Select(x => x.Zero), quantity => { Assert.Throws(() => quantity.ToUnit(ComparisonType.Absolute)); }); + } + + [Fact] + public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() + { + var quantity = new Mass(1, Mass.BaseUnit); + MassUnit expectedUnit = Mass.Info.GetDefaultUnit(UnitSystem.SI); + var expectedValue = quantity.As(expectedUnit); + + Assert.Multiple(() => + { + IQuantity quantityToConvert = quantity; + + IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); + + Assert.Equal(expectedUnit, convertedQuantity.Unit); + Assert.Equal(expectedValue, convertedQuantity.Value); + }, () => + { + IQuantity quantityToConvert = quantity; + + IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); + + Assert.Equal(expectedUnit, convertedQuantity.Unit); + Assert.Equal(expectedValue, convertedQuantity.Value); + }); + } + + [Fact] + public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() + { + UnitSystem nullUnitSystem = null!; + Assert.Multiple(() => + { + IQuantity quantity = new Mass(1, Mass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); + }, () => + { + IQuantity quantity = new Mass(1, Mass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); + }); + } + + [Fact] + public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() + { + var unsupportedUnitSystem = new UnitSystem(new BaseUnits( + (LengthUnit)(-1), + (MassUnit)(-1), + (DurationUnit)(-1), + (ElectricCurrentUnit)(-1), + (TemperatureUnit)(-1), + (AmountOfSubstanceUnit)(-1), + (LuminousIntensityUnit)(-1))); + + Assert.Multiple(() => { - Assert.All(Quantity.Infos.Select(x => x.Zero), quantity => - { - Assert.Throws(() => quantity.As(ComparisonType.Absolute)); - }); - } - - [Fact] - public void ToUnit_GivenWrongUnitType_ThrowsArgumentException() + IQuantity quantity = new Mass(1, Mass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); + }, () => { - Assert.All(Quantity.Infos.Select(x => x.Zero), quantity => - { - Assert.Throws(() => quantity.ToUnit(ComparisonType.Absolute)); - }); - } + IQuantity quantity = new Mass(1, Mass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); + }); } } diff --git a/UnitsNet.Tests/CustomQuantities/HowMuch.cs b/UnitsNet.Tests/CustomQuantities/HowMuch.cs index 80db2ffff6..7a59f20a8d 100644 --- a/UnitsNet.Tests/CustomQuantities/HowMuch.cs +++ b/UnitsNet.Tests/CustomQuantities/HowMuch.cs @@ -70,8 +70,6 @@ public double As(UnitKey unitKey) return As(unitKey.ToUnit()); } - public double As(UnitSystem unitSystem) => throw new NotImplementedException(); - public IQuantity ToUnit(Enum unit) { if (unit is HowMuchUnit howMuchUnit) return new HowMuch(As(unit), howMuchUnit); @@ -82,13 +80,6 @@ public IQuantity ToUnit(HowMuchUnit unit) { throw new NotImplementedException(); } - - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) - { - throw new NotImplementedException(); - } - - public IQuantity ToUnit(UnitSystem unitSystem) => throw new NotImplementedException(); public override string ToString() { diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs index 1468b9c0bc..8840d0d429 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs @@ -305,35 +305,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = AbsorbedDoseOfIonizingRadiation.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - AbsorbedDoseOfIonizingRadiation quantityToConvert = quantity; - - AbsorbedDoseOfIonizingRadiation convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - var expectedUnit = AbsorbedDoseOfIonizingRadiation.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + AbsorbedDoseOfIonizingRadiation convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -343,46 +315,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs index df6b31005e..c9600ef2ed 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs @@ -287,35 +287,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Acceleration.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Acceleration quantityToConvert = quantity; - - Acceleration convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - var expectedUnit = Acceleration.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Acceleration convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -325,46 +297,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs index f83c68a30b..a18ed6b913 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs @@ -305,35 +305,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = AmountOfSubstance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - AmountOfSubstance quantityToConvert = quantity; - - AmountOfSubstance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - var expectedUnit = AmountOfSubstance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + AmountOfSubstance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -343,46 +315,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs index 3b46e2b40b..f59245efa9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs @@ -186,37 +186,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatioUnit.DecibelVolt); - - AmplitudeRatio convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(AmplitudeRatioUnit.DecibelVolt, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatioUnit.DecibelVolt); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(AmplitudeRatioUnit.DecibelVolt, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatioUnit.DecibelVolt); + var quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatioUnit.DecibelVolt); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + AmplitudeRatio convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(AmplitudeRatioUnit.DecibelVolt, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -224,15 +201,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs index 213bdd8424..b9fc738a7f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs @@ -252,37 +252,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new Angle(value: 1, unit: AngleUnit.Radian); - - Angle convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(AngleUnit.Radian, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new Angle(value: 1, unit: AngleUnit.Radian); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(AngleUnit.Radian, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new Angle(value: 1, unit: AngleUnit.Radian); + var quantity = new Angle(value: 1, unit: AngleUnit.Radian); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + Angle convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(AngleUnit.Radian, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -290,15 +267,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new Angle(value: 1, unit: Angle.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Angle(value: 1, unit: Angle.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Angle(value: 1, unit: Angle.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs index 6da629fbf6..9389bf8362 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = AreaDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - AreaDensity quantityToConvert = quantity; - - AreaDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - var expectedUnit = AreaDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + AreaDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs index 7476dc3f70..ba59189e55 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = AreaMomentOfInertia.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - AreaMomentOfInertia quantityToConvert = quantity; - - AreaMomentOfInertia convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - var expectedUnit = AreaMomentOfInertia.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + AreaMomentOfInertia convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs index 197378c4e9..cebf87cd99 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs @@ -287,35 +287,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Area.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Area quantityToConvert = quantity; - - Area convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Area(value: 1, unit: Area.BaseUnit); - var expectedUnit = Area.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Area convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -325,46 +297,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Area(value: 1, unit: Area.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Area(value: 1, unit: Area.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Area(value: 1, unit: Area.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Area(value: 1, unit: Area.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Area(value: 1, unit: Area.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Area(value: 1, unit: Area.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Area(value: 1, unit: Area.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Area(value: 1, unit: Area.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs index 854e9900b1..5d2d759816 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs @@ -437,35 +437,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = BitRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - BitRate quantityToConvert = quantity; - - BitRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - var expectedUnit = BitRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + BitRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -475,46 +447,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new BitRate(value: 1, unit: BitRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs index 536f5b101f..2a2dc55d8b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = BrakeSpecificFuelConsumption.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - BrakeSpecificFuelConsumption quantityToConvert = quantity; - - BrakeSpecificFuelConsumption convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - var expectedUnit = BrakeSpecificFuelConsumption.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + BrakeSpecificFuelConsumption convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs index 64fcb85cca..26119fec3c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = CoefficientOfThermalExpansion.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - CoefficientOfThermalExpansion quantityToConvert = quantity; - - CoefficientOfThermalExpansion convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - var expectedUnit = CoefficientOfThermalExpansion.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + CoefficientOfThermalExpansion convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs index 964d15a611..6069068fc7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs @@ -245,35 +245,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Compressibility.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Compressibility quantityToConvert = quantity; - - Compressibility convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - var expectedUnit = Compressibility.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Compressibility convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -283,46 +255,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs index 48e3d7e820..77efc0fcc8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs @@ -539,35 +539,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Density.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Density quantityToConvert = quantity; - - Density convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Density(value: 1, unit: Density.BaseUnit); - var expectedUnit = Density.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Density convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -577,46 +549,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Density(value: 1, unit: Density.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Density(value: 1, unit: Density.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Density(value: 1, unit: Density.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Density(value: 1, unit: Density.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Density(value: 1, unit: Density.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Density(value: 1, unit: Density.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Density(value: 1, unit: Density.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Density(value: 1, unit: Density.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs index d2c1304e26..61ab4c58b2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs @@ -353,35 +353,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = DoseAreaProduct.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - DoseAreaProduct quantityToConvert = quantity; - - DoseAreaProduct convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - var expectedUnit = DoseAreaProduct.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + DoseAreaProduct convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -391,46 +363,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs index 1e77b4db99..c6f76a8a57 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs @@ -281,35 +281,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Duration.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Duration quantityToConvert = quantity; - - Duration convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Duration(value: 1, unit: Duration.BaseUnit); - var expectedUnit = Duration.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Duration convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -319,46 +291,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Duration(value: 1, unit: Duration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Duration(value: 1, unit: Duration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Duration(value: 1, unit: Duration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Duration(value: 1, unit: Duration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Duration(value: 1, unit: Duration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Duration(value: 1, unit: Duration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Duration(value: 1, unit: Duration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Duration(value: 1, unit: Duration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs index 483cff37e8..12ac7a9c89 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs @@ -263,35 +263,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = DynamicViscosity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - DynamicViscosity quantityToConvert = quantity; - - DynamicViscosity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - var expectedUnit = DynamicViscosity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + DynamicViscosity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -301,46 +273,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs index 5e8754b5ee..acb1078b4b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs @@ -299,35 +299,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricAdmittance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricAdmittance quantityToConvert = quantity; - - ElectricAdmittance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - var expectedUnit = ElectricAdmittance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricAdmittance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -337,46 +309,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs index 79f5ea0993..70c351debd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricApparentEnergy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricApparentEnergy quantityToConvert = quantity; - - ElectricApparentEnergy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - var expectedUnit = ElectricApparentEnergy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricApparentEnergy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs index 8572daa8ff..ce74ec86aa 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricApparentPower.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricApparentPower quantityToConvert = quantity; - - ElectricApparentPower convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - var expectedUnit = ElectricApparentPower.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricApparentPower convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs index f6c32ffea9..ba285112ff 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs @@ -245,35 +245,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricCapacitance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricCapacitance quantityToConvert = quantity; - - ElectricCapacitance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - var expectedUnit = ElectricCapacitance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricCapacitance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -283,46 +255,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs index ef3f5777ae..98973d7cea 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricChargeDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricChargeDensity quantityToConvert = quantity; - - ElectricChargeDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - var expectedUnit = ElectricChargeDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricChargeDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs index 5d53b09e3e..1ea18ab026 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs @@ -269,35 +269,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricCharge.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricCharge quantityToConvert = quantity; - - ElectricCharge convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - var expectedUnit = ElectricCharge.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricCharge convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -307,46 +279,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs index 74df3bb25a..0994d2484e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs @@ -299,35 +299,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricConductance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricConductance quantityToConvert = quantity; - - ElectricConductance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - var expectedUnit = ElectricConductance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricConductance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -337,46 +309,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs index 2eb01bb833..2c1f78e00b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricConductivity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricConductivity quantityToConvert = quantity; - - ElectricConductivity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - var expectedUnit = ElectricConductivity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricConductivity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs index 63824a627e..c232faff41 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricCurrentDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricCurrentDensity quantityToConvert = quantity; - - ElectricCurrentDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - var expectedUnit = ElectricCurrentDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricCurrentDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs index d1bb6aef40..52921cb032 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs @@ -245,35 +245,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricCurrentGradient.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricCurrentGradient quantityToConvert = quantity; - - ElectricCurrentGradient convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - var expectedUnit = ElectricCurrentGradient.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricCurrentGradient convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -283,46 +255,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs index ae61a05fce..a2ab2d38d1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricCurrent.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricCurrent quantityToConvert = quantity; - - ElectricCurrent convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - var expectedUnit = ElectricCurrent.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricCurrent convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs index 4871795759..bb071eb658 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricField.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricField quantityToConvert = quantity; - - ElectricField convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - var expectedUnit = ElectricField.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricField convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs index 61b4092eda..79e1bbe725 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs @@ -251,35 +251,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricImpedance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricImpedance quantityToConvert = quantity; - - ElectricImpedance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - var expectedUnit = ElectricImpedance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricImpedance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -289,46 +261,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs index c52256b465..e26f61f5d1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs @@ -233,35 +233,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricInductance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricInductance quantityToConvert = quantity; - - ElectricInductance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - var expectedUnit = ElectricInductance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricInductance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -271,46 +243,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs index dadaac73d6..9f2d788ca4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs @@ -323,35 +323,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricPotentialChangeRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricPotentialChangeRate quantityToConvert = quantity; - - ElectricPotentialChangeRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - var expectedUnit = ElectricPotentialChangeRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricPotentialChangeRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -361,46 +333,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs index bab3e31985..6af93caf9c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricPotential.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricPotential quantityToConvert = quantity; - - ElectricPotential convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - var expectedUnit = ElectricPotential.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricPotential convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs index f520d34671..251faa950c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs @@ -251,35 +251,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricReactance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricReactance quantityToConvert = quantity; - - ElectricReactance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - var expectedUnit = ElectricReactance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricReactance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -289,46 +261,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs index a8c7fbc9e4..8a024ca4a4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricReactiveEnergy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricReactiveEnergy quantityToConvert = quantity; - - ElectricReactiveEnergy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - var expectedUnit = ElectricReactiveEnergy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricReactiveEnergy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs index 9252b9e59e..e828a9817c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricReactivePower.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricReactivePower quantityToConvert = quantity; - - ElectricReactivePower convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - var expectedUnit = ElectricReactivePower.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricReactivePower convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs index 5d3f5c9cf0..b490a6789f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs @@ -251,35 +251,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricResistance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricResistance quantityToConvert = quantity; - - ElectricResistance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - var expectedUnit = ElectricResistance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricResistance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -289,46 +261,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs index c4a30f8349..345994d34b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs @@ -287,35 +287,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricResistivity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricResistivity quantityToConvert = quantity; - - ElectricResistivity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - var expectedUnit = ElectricResistivity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricResistivity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -325,46 +297,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs index d39dba513b..24c8046d0f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricSurfaceChargeDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricSurfaceChargeDensity quantityToConvert = quantity; - - ElectricSurfaceChargeDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - var expectedUnit = ElectricSurfaceChargeDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricSurfaceChargeDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs index 2b66a0de39..d36c679ee4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs @@ -299,35 +299,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ElectricSusceptance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ElectricSusceptance quantityToConvert = quantity; - - ElectricSusceptance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - var expectedUnit = ElectricSusceptance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ElectricSusceptance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -337,46 +309,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs index f63fc68783..c1f52bd393 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs @@ -275,35 +275,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = EnergyDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - EnergyDensity quantityToConvert = quantity; - - EnergyDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - var expectedUnit = EnergyDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + EnergyDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -313,46 +285,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs index 6b68f3ec28..b11ba62ff4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs @@ -443,35 +443,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Energy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Energy quantityToConvert = quantity; - - Energy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Energy(value: 1, unit: Energy.BaseUnit); - var expectedUnit = Energy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Energy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -481,46 +453,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Energy(value: 1, unit: Energy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Energy(value: 1, unit: Energy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Energy(value: 1, unit: Energy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Energy(value: 1, unit: Energy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Energy(value: 1, unit: Energy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Energy(value: 1, unit: Energy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Energy(value: 1, unit: Energy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Energy(value: 1, unit: Energy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs index 5be6549b6c..35ba253a34 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs @@ -245,35 +245,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Entropy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Entropy quantityToConvert = quantity; - - Entropy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - var expectedUnit = Entropy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Entropy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -283,46 +255,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Entropy(value: 1, unit: Entropy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs index c65c410d75..faf7bc6e39 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs @@ -317,35 +317,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = FluidResistance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - FluidResistance quantityToConvert = quantity; - - FluidResistance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - var expectedUnit = FluidResistance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + FluidResistance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -355,46 +327,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs index 71b1df898f..8a1d0d30bd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs @@ -293,35 +293,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ForceChangeRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ForceChangeRate quantityToConvert = quantity; - - ForceChangeRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - var expectedUnit = ForceChangeRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ForceChangeRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -331,46 +303,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs index b9bd16c3a1..6aae573015 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs @@ -431,35 +431,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ForcePerLength.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ForcePerLength quantityToConvert = quantity; - - ForcePerLength convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - var expectedUnit = ForcePerLength.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ForcePerLength convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -469,46 +441,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs index b1196a7cf8..1514287143 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs @@ -293,35 +293,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Force.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Force quantityToConvert = quantity; - - Force convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Force(value: 1, unit: Force.BaseUnit); - var expectedUnit = Force.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Force convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -331,46 +303,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Force(value: 1, unit: Force.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Force(value: 1, unit: Force.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Force(value: 1, unit: Force.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Force(value: 1, unit: Force.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Force(value: 1, unit: Force.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Force(value: 1, unit: Force.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Force(value: 1, unit: Force.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Force(value: 1, unit: Force.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs index 516f83da0b..9969c0cb93 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs @@ -275,35 +275,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Frequency.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Frequency quantityToConvert = quantity; - - Frequency convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - var expectedUnit = Frequency.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Frequency convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -313,46 +285,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Frequency(value: 1, unit: Frequency.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs index d9c6c56302..568dc6995a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = FuelEfficiency.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - FuelEfficiency quantityToConvert = quantity; - - FuelEfficiency convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - var expectedUnit = FuelEfficiency.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + FuelEfficiency convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs index c8e08b7beb..b2dfbfdb44 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs @@ -311,35 +311,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = HeatFlux.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - HeatFlux quantityToConvert = quantity; - - HeatFlux convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - var expectedUnit = HeatFlux.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + HeatFlux convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -349,46 +321,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs index 60694c3d86..94683fce44 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs @@ -233,35 +233,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = HeatTransferCoefficient.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - HeatTransferCoefficient quantityToConvert = quantity; - - HeatTransferCoefficient convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - var expectedUnit = HeatTransferCoefficient.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + HeatTransferCoefficient convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -271,46 +243,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs index 0d21c5fe14..032f7f109f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Illuminance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Illuminance quantityToConvert = quantity; - - Illuminance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - var expectedUnit = Illuminance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Illuminance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs index 66e6a5974e..4387a54912 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs @@ -281,35 +281,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Impulse.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Impulse quantityToConvert = quantity; - - Impulse convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - var expectedUnit = Impulse.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Impulse convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -319,46 +291,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Impulse(value: 1, unit: Impulse.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs index c42b7a0489..1d46f8d8d3 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs @@ -396,37 +396,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new Information(value: 1, unit: InformationUnit.Bit); - - Information convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(InformationUnit.Bit, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new Information(value: 1, unit: InformationUnit.Bit); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(InformationUnit.Bit, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new Information(value: 1, unit: InformationUnit.Bit); + var quantity = new Information(value: 1, unit: InformationUnit.Bit); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + Information convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(InformationUnit.Bit, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -434,15 +411,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new Information(value: 1, unit: Information.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Information(value: 1, unit: Information.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Information(value: 1, unit: Information.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs index b672a3b7cc..f1e60d0038 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs @@ -287,35 +287,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Irradiance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Irradiance quantityToConvert = quantity; - - Irradiance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - var expectedUnit = Irradiance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Irradiance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -325,46 +297,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs index 8b513e1156..32139d5345 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Irradiation.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Irradiation quantityToConvert = quantity; - - Irradiation convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - var expectedUnit = Irradiation.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Irradiation convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs index 5c6a2cda5b..9bf5edc18a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs @@ -269,35 +269,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Jerk.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Jerk quantityToConvert = quantity; - - Jerk convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - var expectedUnit = Jerk.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Jerk convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -307,46 +279,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Jerk(value: 1, unit: Jerk.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs index 4b500c381f..3692bbe175 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = KinematicViscosity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - KinematicViscosity quantityToConvert = quantity; - - KinematicViscosity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - var expectedUnit = KinematicViscosity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + KinematicViscosity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs index 94a6edf1a4..244629383e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = LeakRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - LeakRate quantityToConvert = quantity; - - LeakRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - var expectedUnit = LeakRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + LeakRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs index c69a0a0fe8..85dba00fd2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs @@ -455,35 +455,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Length.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Length quantityToConvert = quantity; - - Length convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Length(value: 1, unit: Length.BaseUnit); - var expectedUnit = Length.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Length convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -493,46 +465,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Length(value: 1, unit: Length.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Length(value: 1, unit: Length.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Length(value: 1, unit: Length.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Length(value: 1, unit: Length.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Length(value: 1, unit: Length.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Length(value: 1, unit: Length.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Length(value: 1, unit: Length.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Length(value: 1, unit: Length.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs index 62060ed89a..82674f5d14 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs @@ -174,37 +174,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new Level(value: 1, unit: LevelUnit.Decibel); - - Level convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(LevelUnit.Decibel, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new Level(value: 1, unit: LevelUnit.Decibel); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(LevelUnit.Decibel, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new Level(value: 1, unit: LevelUnit.Decibel); + var quantity = new Level(value: 1, unit: LevelUnit.Decibel); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + Level convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(LevelUnit.Decibel, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -212,15 +189,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new Level(value: 1, unit: Level.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Level(value: 1, unit: Level.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Level(value: 1, unit: Level.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs index cc57a73bcd..2c915411ce 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs @@ -311,35 +311,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = LinearDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - LinearDensity quantityToConvert = quantity; - - LinearDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - var expectedUnit = LinearDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + LinearDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -349,46 +321,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs index f923eb7d3a..bf9050a371 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs @@ -353,35 +353,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = LinearPowerDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - LinearPowerDensity quantityToConvert = quantity; - - LinearPowerDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - var expectedUnit = LinearPowerDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + LinearPowerDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -391,46 +363,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs index 486f7febff..591c951b4f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs @@ -263,35 +263,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Luminance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Luminance quantityToConvert = quantity; - - Luminance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - var expectedUnit = Luminance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Luminance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -301,46 +273,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Luminance(value: 1, unit: Luminance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs index ce10be03ec..4b14438b18 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs @@ -287,35 +287,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Luminosity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Luminosity quantityToConvert = quantity; - - Luminosity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - var expectedUnit = Luminosity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Luminosity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -325,46 +297,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Luminosity(value: 1, unit: Luminosity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs index 69e75babc7..32b414cdc9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = LuminousFlux.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - LuminousFlux quantityToConvert = quantity; - - LuminousFlux convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - var expectedUnit = LuminousFlux.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + LuminousFlux convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new LuminousFlux(value: 1, unit: LuminousFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs index 6257383d39..cad3063579 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = LuminousIntensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - LuminousIntensity quantityToConvert = quantity; - - LuminousIntensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - var expectedUnit = LuminousIntensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + LuminousIntensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new LuminousIntensity(value: 1, unit: LuminousIntensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs index 9b8c34a6d4..b41a87c1e6 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MagneticField.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MagneticField quantityToConvert = quantity; - - MagneticField convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - var expectedUnit = MagneticField.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MagneticField convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MagneticField(value: 1, unit: MagneticField.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs index 1ed30187de..714b6a3f69 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MagneticFlux.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MagneticFlux quantityToConvert = quantity; - - MagneticFlux convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - var expectedUnit = MagneticFlux.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MagneticFlux convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MagneticFlux(value: 1, unit: MagneticFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs index fcb8e82192..ffb6e8d0be 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Magnetization.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Magnetization quantityToConvert = quantity; - - Magnetization convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - var expectedUnit = Magnetization.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Magnetization convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Magnetization(value: 1, unit: Magnetization.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs index b4ea373245..ea4ccb7413 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs @@ -497,35 +497,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MassConcentration.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MassConcentration quantityToConvert = quantity; - - MassConcentration convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - var expectedUnit = MassConcentration.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MassConcentration convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -535,46 +507,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MassConcentration(value: 1, unit: MassConcentration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs index 1007bedb84..6fe7c26333 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs @@ -401,35 +401,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MassFlow.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MassFlow quantityToConvert = quantity; - - MassFlow convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - var expectedUnit = MassFlow.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MassFlow convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -439,46 +411,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MassFlow(value: 1, unit: MassFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs index ecd9b4a0c0..8349116945 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs @@ -275,35 +275,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MassFlux.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MassFlux quantityToConvert = quantity; - - MassFlux convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - var expectedUnit = MassFlux.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MassFlux convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -313,46 +285,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MassFlux(value: 1, unit: MassFlux.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs index d957c538c8..008e2ebdd4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs @@ -306,37 +306,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new MassFraction(value: 1, unit: MassFractionUnit.DecimalFraction); - - MassFraction convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(MassFractionUnit.DecimalFraction, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new MassFraction(value: 1, unit: MassFractionUnit.DecimalFraction); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(MassFractionUnit.DecimalFraction, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new MassFraction(value: 1, unit: MassFractionUnit.DecimalFraction); + var quantity = new MassFraction(value: 1, unit: MassFractionUnit.DecimalFraction); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + MassFraction convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(MassFractionUnit.DecimalFraction, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -344,15 +321,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new MassFraction(value: 1, unit: MassFraction.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new MassFraction(value: 1, unit: MassFraction.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new MassFraction(value: 1, unit: MassFraction.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs index cbcc1f622e..b74e630e2b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs @@ -371,35 +371,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MassMomentOfInertia.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MassMomentOfInertia quantityToConvert = quantity; - - MassMomentOfInertia convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - var expectedUnit = MassMomentOfInertia.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MassMomentOfInertia convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -409,46 +381,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MassMomentOfInertia(value: 1, unit: MassMomentOfInertia.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs index b2c238a2d4..1e75b909f7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs @@ -365,35 +365,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Mass.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Mass quantityToConvert = quantity; - - Mass convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Mass(value: 1, unit: Mass.BaseUnit); - var expectedUnit = Mass.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Mass convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -403,46 +375,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Mass(value: 1, unit: Mass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Mass(value: 1, unit: Mass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Mass(value: 1, unit: Mass.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Mass(value: 1, unit: Mass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Mass(value: 1, unit: Mass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Mass(value: 1, unit: Mass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Mass(value: 1, unit: Mass.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Mass(value: 1, unit: Mass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs index 5443d12d23..55f36ca488 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Molality.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Molality quantityToConvert = quantity; - - Molality convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Molality(value: 1, unit: Molality.BaseUnit); - var expectedUnit = Molality.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Molality convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Molality(value: 1, unit: Molality.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Molality(value: 1, unit: Molality.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Molality(value: 1, unit: Molality.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Molality(value: 1, unit: Molality.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Molality(value: 1, unit: Molality.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Molality(value: 1, unit: Molality.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Molality(value: 1, unit: Molality.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Molality(value: 1, unit: Molality.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs index 332fabe6b6..d418c52438 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MolarEnergy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MolarEnergy quantityToConvert = quantity; - - MolarEnergy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - var expectedUnit = MolarEnergy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MolarEnergy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MolarEnergy(value: 1, unit: MolarEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs index 5c36626f22..07465bdcb4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MolarEntropy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MolarEntropy quantityToConvert = quantity; - - MolarEntropy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - var expectedUnit = MolarEntropy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MolarEntropy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MolarEntropy(value: 1, unit: MolarEntropy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs index 987cde502d..38f030aa1a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MolarFlow.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MolarFlow quantityToConvert = quantity; - - MolarFlow convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - var expectedUnit = MolarFlow.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MolarFlow convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MolarFlow(value: 1, unit: MolarFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs index 851833d560..0e16d4b1fa 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs @@ -281,35 +281,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = MolarMass.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - MolarMass quantityToConvert = quantity; - - MolarMass convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - var expectedUnit = MolarMass.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + MolarMass convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -319,46 +291,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new MolarMass(value: 1, unit: MolarMass.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs index 4d8333fed7..fcab87357e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs @@ -269,35 +269,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Molarity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Molarity quantityToConvert = quantity; - - Molarity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - var expectedUnit = Molarity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Molarity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -307,46 +279,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Molarity(value: 1, unit: Molarity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs index cb65b5b9e8..4853e2bd39 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Permeability.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Permeability quantityToConvert = quantity; - - Permeability convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - var expectedUnit = Permeability.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Permeability convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Permeability(value: 1, unit: Permeability.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs index fee87ec3aa..f2dc863436 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs @@ -209,35 +209,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Permittivity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Permittivity quantityToConvert = quantity; - - Permittivity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - var expectedUnit = Permittivity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Permittivity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -247,46 +219,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Permittivity(value: 1, unit: Permittivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs index 65c890210b..734b29d9f6 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs @@ -233,35 +233,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = PorousMediumPermeability.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - PorousMediumPermeability quantityToConvert = quantity; - - PorousMediumPermeability convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - var expectedUnit = PorousMediumPermeability.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + PorousMediumPermeability convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -271,46 +243,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new PorousMediumPermeability(value: 1, unit: PorousMediumPermeability.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs index bc8898263b..b9bd40cd73 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs @@ -467,35 +467,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = PowerDensity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - PowerDensity quantityToConvert = quantity; - - PowerDensity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - var expectedUnit = PowerDensity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + PowerDensity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -505,46 +477,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new PowerDensity(value: 1, unit: PowerDensity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs index 5aef0f93c7..e3d5bbafb4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs @@ -174,37 +174,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new PowerRatio(value: 1, unit: PowerRatioUnit.DecibelWatt); - - PowerRatio convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(PowerRatioUnit.DecibelWatt, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new PowerRatio(value: 1, unit: PowerRatioUnit.DecibelWatt); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(PowerRatioUnit.DecibelWatt, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new PowerRatio(value: 1, unit: PowerRatioUnit.DecibelWatt); + var quantity = new PowerRatio(value: 1, unit: PowerRatioUnit.DecibelWatt); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + PowerRatio convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(PowerRatioUnit.DecibelWatt, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -212,15 +189,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new PowerRatio(value: 1, unit: PowerRatio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new PowerRatio(value: 1, unit: PowerRatio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new PowerRatio(value: 1, unit: PowerRatio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs index 9475ce2578..1920ba333f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs @@ -365,35 +365,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Power.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Power quantityToConvert = quantity; - - Power convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Power(value: 1, unit: Power.BaseUnit); - var expectedUnit = Power.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Power convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -403,46 +375,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Power(value: 1, unit: Power.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Power(value: 1, unit: Power.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Power(value: 1, unit: Power.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Power(value: 1, unit: Power.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Power(value: 1, unit: Power.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Power(value: 1, unit: Power.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Power(value: 1, unit: Power.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Power(value: 1, unit: Power.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs index c74e46c776..bd759a52f0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs @@ -311,35 +311,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = PressureChangeRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - PressureChangeRate quantityToConvert = quantity; - - PressureChangeRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - var expectedUnit = PressureChangeRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + PressureChangeRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -349,46 +321,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new PressureChangeRate(value: 1, unit: PressureChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs index 2e76518d12..fbb8444297 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs @@ -491,35 +491,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Pressure.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Pressure quantityToConvert = quantity; - - Pressure convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - var expectedUnit = Pressure.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Pressure convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -529,46 +501,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Pressure(value: 1, unit: Pressure.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs index 4d4672a5ff..e0ece9c4e8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs @@ -263,35 +263,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RadiationEquivalentDoseRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RadiationEquivalentDoseRate quantityToConvert = quantity; - - RadiationEquivalentDoseRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - var expectedUnit = RadiationEquivalentDoseRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RadiationEquivalentDoseRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -301,46 +273,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RadiationEquivalentDoseRate(value: 1, unit: RadiationEquivalentDoseRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs index f7557c5d79..829adc0123 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RadiationEquivalentDose.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RadiationEquivalentDose quantityToConvert = quantity; - - RadiationEquivalentDose convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - var expectedUnit = RadiationEquivalentDose.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RadiationEquivalentDose convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RadiationEquivalentDose(value: 1, unit: RadiationEquivalentDose.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs index e6424e2e13..e517befb98 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs @@ -251,35 +251,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RadiationExposure.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RadiationExposure quantityToConvert = quantity; - - RadiationExposure convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - var expectedUnit = RadiationExposure.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RadiationExposure convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -289,46 +261,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RadiationExposure(value: 1, unit: RadiationExposure.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs index 5eed4f3d92..54161e1834 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs @@ -377,35 +377,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Radioactivity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Radioactivity quantityToConvert = quantity; - - Radioactivity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - var expectedUnit = Radioactivity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Radioactivity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -415,46 +387,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Radioactivity(value: 1, unit: Radioactivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs index bd18e90323..31d7ddf70a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs @@ -215,35 +215,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RatioChangeRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RatioChangeRate quantityToConvert = quantity; - - RatioChangeRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - var expectedUnit = RatioChangeRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RatioChangeRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -253,46 +225,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RatioChangeRate(value: 1, unit: RatioChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs index 49e44d12e1..f50b4c3fbd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs @@ -198,37 +198,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new Ratio(value: 1, unit: RatioUnit.DecimalFraction); - - Ratio convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(RatioUnit.DecimalFraction, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new Ratio(value: 1, unit: RatioUnit.DecimalFraction); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(RatioUnit.DecimalFraction, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new Ratio(value: 1, unit: RatioUnit.DecimalFraction); + var quantity = new Ratio(value: 1, unit: RatioUnit.DecimalFraction); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + Ratio convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(RatioUnit.DecimalFraction, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -236,15 +213,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new Ratio(value: 1, unit: Ratio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Ratio(value: 1, unit: Ratio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Ratio(value: 1, unit: Ratio.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs index 598bf4bc3c..1cdff726ea 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs @@ -269,35 +269,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ReciprocalArea.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ReciprocalArea quantityToConvert = quantity; - - ReciprocalArea convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - var expectedUnit = ReciprocalArea.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ReciprocalArea convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -307,46 +279,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ReciprocalArea(value: 1, unit: ReciprocalArea.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs index 5f8950c3a6..3ad6ec30de 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs @@ -263,35 +263,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ReciprocalLength.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ReciprocalLength quantityToConvert = quantity; - - ReciprocalLength convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - var expectedUnit = ReciprocalLength.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ReciprocalLength convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -301,46 +273,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ReciprocalLength(value: 1, unit: ReciprocalLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs index adcd7bbb99..7f73c3343d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs @@ -168,37 +168,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new RelativeHumidity(value: 1, unit: RelativeHumidityUnit.Percent); - - RelativeHumidity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(RelativeHumidityUnit.Percent, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new RelativeHumidity(value: 1, unit: RelativeHumidityUnit.Percent); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(RelativeHumidityUnit.Percent, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new RelativeHumidity(value: 1, unit: RelativeHumidityUnit.Percent); + var quantity = new RelativeHumidity(value: 1, unit: RelativeHumidityUnit.Percent); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + RelativeHumidity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(RelativeHumidityUnit.Percent, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -206,15 +183,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new RelativeHumidity(value: 1, unit: RelativeHumidity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new RelativeHumidity(value: 1, unit: RelativeHumidity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new RelativeHumidity(value: 1, unit: RelativeHumidity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs index 678c977c33..37b6c2b9fd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RotationalAcceleration.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RotationalAcceleration quantityToConvert = quantity; - - RotationalAcceleration convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - var expectedUnit = RotationalAcceleration.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RotationalAcceleration convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RotationalAcceleration(value: 1, unit: RotationalAcceleration.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs index fa5ef846e2..f96bcd6abd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs @@ -281,35 +281,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RotationalSpeed.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RotationalSpeed quantityToConvert = quantity; - - RotationalSpeed convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - var expectedUnit = RotationalSpeed.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RotationalSpeed convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -319,46 +291,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RotationalSpeed(value: 1, unit: RotationalSpeed.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs index 3e0a660659..ca708ff30a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs @@ -233,35 +233,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RotationalStiffnessPerLength.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RotationalStiffnessPerLength quantityToConvert = quantity; - - RotationalStiffnessPerLength convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - var expectedUnit = RotationalStiffnessPerLength.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RotationalStiffnessPerLength convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -271,46 +243,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RotationalStiffnessPerLength(value: 1, unit: RotationalStiffnessPerLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs index b827277f41..ef40ab2228 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs @@ -401,35 +401,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = RotationalStiffness.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - RotationalStiffness quantityToConvert = quantity; - - RotationalStiffness convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - var expectedUnit = RotationalStiffness.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + RotationalStiffness convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -439,46 +411,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new RotationalStiffness(value: 1, unit: RotationalStiffness.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs index a483f5954e..f1adb3c098 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs @@ -168,37 +168,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new Scalar(value: 1, unit: ScalarUnit.Amount); - - Scalar convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(ScalarUnit.Amount, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new Scalar(value: 1, unit: ScalarUnit.Amount); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(ScalarUnit.Amount, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new Scalar(value: 1, unit: ScalarUnit.Amount); + var quantity = new Scalar(value: 1, unit: ScalarUnit.Amount); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + Scalar convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(ScalarUnit.Amount, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -206,15 +183,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new Scalar(value: 1, unit: Scalar.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Scalar(value: 1, unit: Scalar.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Scalar(value: 1, unit: Scalar.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs index 410e851faa..eb6a58dbfe 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs @@ -168,37 +168,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new SolidAngle(value: 1, unit: SolidAngleUnit.Steradian); - - SolidAngle convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(SolidAngleUnit.Steradian, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new SolidAngle(value: 1, unit: SolidAngleUnit.Steradian); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(SolidAngleUnit.Steradian, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new SolidAngle(value: 1, unit: SolidAngleUnit.Steradian); + var quantity = new SolidAngle(value: 1, unit: SolidAngleUnit.Steradian); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + SolidAngle convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(SolidAngleUnit.Steradian, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -206,15 +183,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new SolidAngle(value: 1, unit: SolidAngle.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new SolidAngle(value: 1, unit: SolidAngle.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new SolidAngle(value: 1, unit: SolidAngle.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs index e796178a68..ef7090b04d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs @@ -383,35 +383,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = SpecificEnergy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - SpecificEnergy quantityToConvert = quantity; - - SpecificEnergy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - var expectedUnit = SpecificEnergy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + SpecificEnergy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -421,46 +393,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new SpecificEnergy(value: 1, unit: SpecificEnergy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs index 06596157f7..5695566514 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = SpecificEntropy.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - SpecificEntropy quantityToConvert = quantity; - - SpecificEntropy convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - var expectedUnit = SpecificEntropy.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + SpecificEntropy convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new SpecificEntropy(value: 1, unit: SpecificEntropy.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs index 9af48365b7..ecae77e791 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = SpecificFuelConsumption.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - SpecificFuelConsumption quantityToConvert = quantity; - - SpecificFuelConsumption convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - var expectedUnit = SpecificFuelConsumption.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + SpecificFuelConsumption convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new SpecificFuelConsumption(value: 1, unit: SpecificFuelConsumption.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs index 0233cd2c17..e9341cce8a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs @@ -221,35 +221,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = SpecificVolume.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - SpecificVolume quantityToConvert = quantity; - - SpecificVolume convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - var expectedUnit = SpecificVolume.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + SpecificVolume convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -259,46 +231,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new SpecificVolume(value: 1, unit: SpecificVolume.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs index 5ca94af9d2..44dcf36ee8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs @@ -305,35 +305,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = SpecificWeight.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - SpecificWeight quantityToConvert = quantity; - - SpecificWeight convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - var expectedUnit = SpecificWeight.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + SpecificWeight convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -343,46 +315,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new SpecificWeight(value: 1, unit: SpecificWeight.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs index 0861b0207e..dbde8909f0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs @@ -401,35 +401,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Speed.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Speed quantityToConvert = quantity; - - Speed convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Speed(value: 1, unit: Speed.BaseUnit); - var expectedUnit = Speed.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Speed convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -439,46 +411,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Speed(value: 1, unit: Speed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Speed(value: 1, unit: Speed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Speed(value: 1, unit: Speed.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Speed(value: 1, unit: Speed.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Speed(value: 1, unit: Speed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Speed(value: 1, unit: Speed.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Speed(value: 1, unit: Speed.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Speed(value: 1, unit: Speed.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs index 9793fa684d..bd761f4515 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = StandardVolumeFlow.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - StandardVolumeFlow quantityToConvert = quantity; - - StandardVolumeFlow convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - var expectedUnit = StandardVolumeFlow.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + StandardVolumeFlow convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new StandardVolumeFlow(value: 1, unit: StandardVolumeFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs index 680c47a200..8dd9f6749d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs @@ -305,35 +305,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = TemperatureChangeRate.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - TemperatureChangeRate quantityToConvert = quantity; - - TemperatureChangeRate convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - var expectedUnit = TemperatureChangeRate.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + TemperatureChangeRate convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -343,46 +315,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new TemperatureChangeRate(value: 1, unit: TemperatureChangeRate.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs index 8be36bb55b..54b76d43b4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = TemperatureDelta.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - TemperatureDelta quantityToConvert = quantity; - - TemperatureDelta convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - var expectedUnit = TemperatureDelta.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + TemperatureDelta convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new TemperatureDelta(value: 1, unit: TemperatureDelta.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs index d0f91b13dc..b770d73168 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs @@ -227,35 +227,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = TemperatureGradient.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - TemperatureGradient quantityToConvert = quantity; - - TemperatureGradient convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - var expectedUnit = TemperatureGradient.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + TemperatureGradient convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -265,46 +237,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new TemperatureGradient(value: 1, unit: TemperatureGradient.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs index adb6da15f3..84bad27648 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs @@ -263,35 +263,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Temperature.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Temperature quantityToConvert = quantity; - - Temperature convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - var expectedUnit = Temperature.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Temperature convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -301,46 +273,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Temperature(value: 1, unit: Temperature.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs index 7e7d035f05..c104c056cf 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs @@ -215,35 +215,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ThermalConductivity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ThermalConductivity quantityToConvert = quantity; - - ThermalConductivity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - var expectedUnit = ThermalConductivity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ThermalConductivity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -253,46 +225,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ThermalConductivity(value: 1, unit: ThermalConductivity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs index a84982777f..922f4109ea 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs @@ -245,35 +245,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ThermalInsulance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ThermalInsulance quantityToConvert = quantity; - - ThermalInsulance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - var expectedUnit = ThermalInsulance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ThermalInsulance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -283,46 +255,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ThermalInsulance(value: 1, unit: ThermalInsulance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs index 14d6a11532..692a181530 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs @@ -215,35 +215,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = ThermalResistance.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - ThermalResistance quantityToConvert = quantity; - - ThermalResistance convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - var expectedUnit = ThermalResistance.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + ThermalResistance convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -253,46 +225,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new ThermalResistance(value: 1, unit: ThermalResistance.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs index 28ab736f99..3965db12a5 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs @@ -353,35 +353,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Torque.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Torque quantityToConvert = quantity; - - Torque convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Torque(value: 1, unit: Torque.BaseUnit); - var expectedUnit = Torque.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Torque convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -391,46 +363,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Torque(value: 1, unit: Torque.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Torque(value: 1, unit: Torque.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Torque(value: 1, unit: Torque.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Torque(value: 1, unit: Torque.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Torque(value: 1, unit: Torque.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Torque(value: 1, unit: Torque.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Torque(value: 1, unit: Torque.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Torque(value: 1, unit: Torque.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs index d47b86d277..638583c83e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs @@ -168,37 +168,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new Turbidity(value: 1, unit: TurbidityUnit.NTU); - - Turbidity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(TurbidityUnit.NTU, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new Turbidity(value: 1, unit: TurbidityUnit.NTU); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(TurbidityUnit.NTU, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new Turbidity(value: 1, unit: TurbidityUnit.NTU); + var quantity = new Turbidity(value: 1, unit: TurbidityUnit.NTU); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + Turbidity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(TurbidityUnit.NTU, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -206,15 +183,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new Turbidity(value: 1, unit: Turbidity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Turbidity(value: 1, unit: Turbidity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new Turbidity(value: 1, unit: Turbidity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs index ebac154544..5bad1cea21 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs @@ -168,37 +168,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new VitaminA(value: 1, unit: VitaminAUnit.InternationalUnit); - - VitaminA convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(VitaminAUnit.InternationalUnit, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new VitaminA(value: 1, unit: VitaminAUnit.InternationalUnit); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(VitaminAUnit.InternationalUnit, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new VitaminA(value: 1, unit: VitaminAUnit.InternationalUnit); + var quantity = new VitaminA(value: 1, unit: VitaminAUnit.InternationalUnit); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + VitaminA convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(VitaminAUnit.InternationalUnit, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -206,15 +183,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new VitaminA(value: 1, unit: VitaminA.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new VitaminA(value: 1, unit: VitaminA.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new VitaminA(value: 1, unit: VitaminA.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs index f782bfb5be..fb80a74bc2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs @@ -282,37 +282,14 @@ public void As_UnitSystem_ThrowsArgumentNullExceptionIfNull() [Fact] public void ToUnit_UnitSystem_ReturnsValueInDimensionlessUnit() { - Assert.Multiple(() => - { - var quantity = new VolumeConcentration(value: 1, unit: VolumeConcentrationUnit.DecimalFraction); - - VolumeConcentration convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(VolumeConcentrationUnit.DecimalFraction, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }, () => - { - IQuantity quantity = new VolumeConcentration(value: 1, unit: VolumeConcentrationUnit.DecimalFraction); - - IQuantity convertedQuantity = quantity.ToUnit(UnitSystem.SI); - - Assert.Equal(VolumeConcentrationUnit.DecimalFraction, convertedQuantity.Unit); - Assert.Equal(quantity.Value, convertedQuantity.Value); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ReturnsValueInDimensionlessUnit() - { - IQuantity quantity = new VolumeConcentration(value: 1, unit: VolumeConcentrationUnit.DecimalFraction); + var quantity = new VolumeConcentration(value: 1, unit: VolumeConcentrationUnit.DecimalFraction); - IQuantity convertedQuantity = quantity.ToUnitUntyped(UnitSystem.SI); + VolumeConcentration convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(VolumeConcentrationUnit.DecimalFraction, convertedQuantity.Unit); Assert.Equal(quantity.Value, convertedQuantity.Value); } - [Fact] public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { @@ -320,15 +297,15 @@ public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() Assert.Multiple(() => { var quantity = new VolumeConcentration(value: 1, unit: VolumeConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new VolumeConcentration(value: 1, unit: VolumeConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }, () => { IQuantity quantity = new VolumeConcentration(value: 1, unit: VolumeConcentration.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); }); } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs index d90fb45e01..c641a62702 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs @@ -215,35 +215,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = VolumeFlowPerArea.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - VolumeFlowPerArea quantityToConvert = quantity; - - VolumeFlowPerArea convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - var expectedUnit = VolumeFlowPerArea.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + VolumeFlowPerArea convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -253,46 +225,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new VolumeFlowPerArea(value: 1, unit: VolumeFlowPerArea.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs index 86e87fd581..43e705c946 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs @@ -653,35 +653,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = VolumeFlow.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - VolumeFlow quantityToConvert = quantity; - - VolumeFlow convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - var expectedUnit = VolumeFlow.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + VolumeFlow convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -691,46 +663,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new VolumeFlow(value: 1, unit: VolumeFlow.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs index f9cada501c..b02a80a5ac 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = VolumePerLength.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - VolumePerLength quantityToConvert = quantity; - - VolumePerLength convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - var expectedUnit = VolumePerLength.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + VolumePerLength convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new VolumePerLength(value: 1, unit: VolumePerLength.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs index 1c489bae06..554bf4995a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs @@ -533,35 +533,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = Volume.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - Volume quantityToConvert = quantity; - - Volume convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new Volume(value: 1, unit: Volume.BaseUnit); - var expectedUnit = Volume.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + Volume convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -571,46 +543,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new Volume(value: 1, unit: Volume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new Volume(value: 1, unit: Volume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new Volume(value: 1, unit: Volume.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new Volume(value: 1, unit: Volume.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new Volume(value: 1, unit: Volume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new Volume(value: 1, unit: Volume.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new Volume(value: 1, unit: Volume.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new Volume(value: 1, unit: Volume.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs index b90ce99335..ebb7461584 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs @@ -257,35 +257,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = VolumetricHeatCapacity.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - VolumetricHeatCapacity quantityToConvert = quantity; - - VolumetricHeatCapacity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - var expectedUnit = VolumetricHeatCapacity.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + VolumetricHeatCapacity convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -295,46 +267,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new VolumetricHeatCapacity(value: 1, unit: VolumetricHeatCapacity.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs index 86348b2cc0..66c3fbb2bb 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs @@ -239,35 +239,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits() var expectedUnit = WarpingMomentOfInertia.Info.GetDefaultUnit(UnitSystem.SI); var expectedValue = quantity.As(expectedUnit); - Assert.Multiple(() => - { - WarpingMomentOfInertia quantityToConvert = quantity; - - WarpingMomentOfInertia convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }, () => - { - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI); - - Assert.Equal(expectedUnit, convertedQuantity.Unit); - Assert.Equal(expectedValue, convertedQuantity.Value); - }); - } - - [Fact] - public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() - { - var quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - var expectedUnit = WarpingMomentOfInertia.Info.GetDefaultUnit(UnitSystem.SI); - var expectedValue = quantity.As(expectedUnit); - - IQuantity quantityToConvert = quantity; - - IQuantity convertedQuantity = quantityToConvert.ToUnitUntyped(UnitSystem.SI); + WarpingMomentOfInertia convertedQuantity = quantity.ToUnit(UnitSystem.SI); Assert.Equal(expectedUnit, convertedQuantity.Unit); Assert.Equal(expectedValue, convertedQuantity.Value); @@ -277,46 +249,16 @@ public virtual void ToUnitUntyped_UnitSystem_SI_ReturnsQuantityInSIUnits() public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull() { UnitSystem nullUnitSystem = null!; - Assert.Multiple(() => - { - var quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }, () => - { - IQuantity quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentNullExceptionIfNull() - { - UnitSystem nullUnitSystem = null!; - IQuantity quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(nullUnitSystem)); + var quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); + Assert.Throws(() => quantity.ToUnit(nullUnitSystem)); } [Fact] public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - Assert.Multiple(() => - { - var quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }, () => - { - IQuantity quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); - }); - } - - [Fact] - public void ToUnitUntyped_UnitSystem_ThrowsArgumentExceptionIfNotSupported() - { - var unsupportedUnitSystem = new UnitSystem(UnsupportedBaseUnits); - IQuantity quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); - Assert.Throws(() => quantity.ToUnitUntyped(unsupportedUnitSystem)); + var quantity = new WarpingMomentOfInertia(value: 1, unit: WarpingMomentOfInertia.BaseUnit); + Assert.Throws(() => quantity.ToUnit(unsupportedUnitSystem)); } [Theory] diff --git a/UnitsNet/Extensions/QuantityExtensions.cs b/UnitsNet/Extensions/QuantityExtensions.cs index f17e8ef477..1c0c45f05e 100644 --- a/UnitsNet/Extensions/QuantityExtensions.cs +++ b/UnitsNet/Extensions/QuantityExtensions.cs @@ -91,13 +91,40 @@ public static TQuantity ToUnit(this TQuantity quantity, UnitSystem un /// /// Thrown if no matching unit is found for the specified . /// - public static IQuantity ToUnitUntyped(this IQuantity quantity, UnitSystem unitSystem) + [Obsolete("This method will be removed from the interface in the next major update.")] + public static IQuantity ToUnit(this IQuantity quantity, UnitSystem unitSystem) { QuantityInfo quantityInfo = quantity.QuantityInfo; UnitKey unitKey = quantityInfo.GetDefaultUnit(unitSystem).UnitKey; return quantityInfo.From(quantity.As(unitKey), unitKey); } + /// + /// Converts the specified quantity to a new quantity with a unit determined by the given . + /// + /// The quantity to convert. + /// The used to determine the target unit. + /// + /// A new quantity of the same type with the unit determined by the specified . + /// + /// + /// If multiple units are associated with the given , the first matching unit will be used. + /// + /// + /// Thrown if is null. + /// + /// + /// Thrown if no matching unit is found for the specified . + /// + [Obsolete("This method will be removed from the interface in the next major update.")] + public static IQuantity ToUnit(this IQuantity quantity, UnitSystem unitSystem) + where TUnit : struct, Enum + { + QuantityInfo quantityInfo = quantity.QuantityInfo; + TUnit unit = quantityInfo.GetDefaultUnit(unitSystem); + return quantityInfo.From(quantity.As(unit), unit); + } + /// /// Returns the string representation of the specified quantity using the provided format provider. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs index 93784d80e2..d9f4ac2066 100644 --- a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs @@ -1001,9 +1001,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AbsorbedDoseOfIonizingRadiationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index d9d8bf25c1..83b6c6add3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -983,9 +983,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AccelerationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 864ab55020..939a52084e 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -1044,9 +1044,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AmountOfSubstanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index a036c67c1f..0db3066f16 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -765,9 +765,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AmplitudeRatioUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index f5f41b813a..bb2822e031 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -973,9 +973,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AngleUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index ce96999459..971074a1b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -1067,9 +1067,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AreaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index e544154d74..2b662909c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -757,9 +757,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AreaDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index a0e0affc51..77fd67fa9f 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -818,9 +818,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(AreaMomentOfInertiaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index bb038d1853..ef08cdfb3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1397,9 +1397,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(BitRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 61bf01241e..fc7b253fa6 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -770,9 +770,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(BrakeSpecificFuelConsumptionUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index d01f82464a..25671ba248 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -811,9 +811,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(CoefficientOfThermalExpansionUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs index 3f32526745..6aafee49bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs @@ -818,9 +818,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(CompressibilityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 06905fd2dc..43aa68b621 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1763,9 +1763,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(DensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs b/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs index 8cb27b0e9b..d2ee657131 100644 --- a/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs @@ -1145,9 +1145,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(DoseAreaProductUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 6613112e5b..53509ba4eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -1035,9 +1035,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(DurationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 51cad3e2ad..7f0bc8028f 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -893,9 +893,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(DynamicViscosityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 662367c427..a0f4670b56 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -984,9 +984,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricAdmittanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs index 68202651a2..299daa8292 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs @@ -746,9 +746,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricApparentEnergyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs index 9df32410be..9eaa4f4fd6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs @@ -803,9 +803,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricApparentPowerUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs index 6e4a5b9c99..bb23cae42d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs @@ -821,9 +821,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricCapacitanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index bb2905dc1b..1a42c24f6c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -918,9 +918,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricChargeUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 7e260d0280..7c358b5237 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -713,9 +713,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricChargeDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 3fe27524af..f7a94f512f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -983,9 +983,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricConductanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index d408391c0d..42a8281ef0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -814,9 +814,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricConductivityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index c8746fd77a..1328d94480 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -896,9 +896,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricCurrentUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index da48ced132..6952796ae2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -749,9 +749,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricCurrentDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 62165d6e51..328c852d27 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -829,9 +829,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricCurrentGradientUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index dda3c7dc15..0cffdfb99a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -713,9 +713,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricFieldUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs index 3db22354ff..0664d9e4e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs @@ -840,9 +840,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricImpedanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index b9d4c360df..b23b44fce0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -785,9 +785,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricInductanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index e8006372aa..82a074d2a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -835,9 +835,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricPotentialUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs index 5d9e5a3690..1ab1aff852 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs @@ -1052,9 +1052,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricPotentialChangeRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs index 961ca2d2f7..0876ea916a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs @@ -839,9 +839,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricReactanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs index 5505a7861e..dde516150d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs @@ -746,9 +746,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricReactiveEnergyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs index b0d480089d..6bd91d9da5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs @@ -767,9 +767,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricReactivePowerUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index b80016fcbb..1b483957e0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -850,9 +850,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricResistanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 3d51567012..0a20865a27 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -958,9 +958,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricResistivityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs index d7b70206b6..35f23bb0ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs @@ -749,9 +749,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricSurfaceChargeDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs index 4b251ad48d..c6f5ca9ef8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs @@ -983,9 +983,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ElectricSusceptanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 6124bde8cc..982a1785f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1507,9 +1507,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(EnergyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs index 3fcf1abc47..3766c54268 100644 --- a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs @@ -919,9 +919,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(EnergyDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 5c84c344cc..0f6fe8c8d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -843,9 +843,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(EntropyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs index ab015be398..d92219473d 100644 --- a/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs @@ -1037,9 +1037,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(FluidResistanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index a8d8961f13..3e6e0cf3e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -1050,9 +1050,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ForceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 6e31575d71..031760cc0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -973,9 +973,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ForceChangeRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 116784e359..af311d6eb2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -1443,9 +1443,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ForcePerLengthUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index d1ef686de8..fa5f67b223 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -919,9 +919,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(FrequencyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs index 6a13ee2196..36feac40b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs @@ -767,9 +767,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(FuelEfficiencyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index be04abd29d..f04aa3dc7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -1027,9 +1027,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(HeatFluxUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index b65e77c2ae..ded5a527e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -782,9 +782,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(HeatTransferCoefficientUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 1c88fd0e05..097895cf58 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -778,9 +778,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(IlluminanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs index 3e00302571..e627a492d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs @@ -926,9 +926,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ImpulseUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 8525ab6e8d..37fc7a4f44 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1380,9 +1380,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(InformationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index cbbe0541ba..2807557480 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -944,9 +944,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(IrradianceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index 0e18961e44..d16db7fef3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -857,9 +857,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(IrradiationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs index 839b9d5f40..ac104b30b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs @@ -901,9 +901,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(JerkUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 0c608e46c4..e7828f6640 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -889,9 +889,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(KinematicViscosityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs index cbd67d7f51..b19b295670 100644 --- a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs @@ -767,9 +767,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LeakRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 920244675b..9974ed8191 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1585,9 +1585,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LengthUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index c3d261ce7b..e7bb8464fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -729,9 +729,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LevelUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 3ce38de015..a6d4bcc7e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -1044,9 +1044,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LinearDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs index 48a2128bd1..b395fa2690 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs @@ -1145,9 +1145,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LinearPowerDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs index d265c5741f..6fced29fcb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs @@ -886,9 +886,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LuminanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs index 40ecf8008b..8781a3c8c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs @@ -947,9 +947,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LuminosityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 133e349448..37a00f6f4d 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -731,9 +731,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LuminousFluxUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 7c2c3e2182..151f67d3d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -731,9 +731,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(LuminousIntensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 4e0b8ced2d..157f308cc9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -803,9 +803,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MagneticFieldUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index d3ad40c2e5..bfe7b01062 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -713,9 +713,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MagneticFluxUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 09bd303a54..0147a53206 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -713,9 +713,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MagnetizationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 67d4953670..56856ce226 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1294,9 +1294,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MassUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index 96ada9f3fc..b58c5046af 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -1616,9 +1616,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MassConcentrationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 886ec3d6e7..72cc1c5344 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -1360,9 +1360,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MassFlowUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 6ca992210e..f2e84a2d0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -933,9 +933,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MassFluxUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index 360bef3a1b..5a3a2755f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs @@ -1124,9 +1124,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MassFractionUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 5ecbedcd83..1cd21a64a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1196,9 +1196,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MassMomentOfInertiaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs index caa8160d81..63837b108d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs @@ -749,9 +749,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MolalityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 4766498498..d1427d6250 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -757,9 +757,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MolarEnergyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index baef495ca7..df7026eb59 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -746,9 +746,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MolarEntropyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs index 471273fc5e..cfaf99aa5f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -886,9 +886,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MolarFlowUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index c6a6e594f2..d20e489b04 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -951,9 +951,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MolarMassUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index cad1c306d0..83c4ff33fb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -932,9 +932,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(MolarityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 6f66e223ed..25987bbc99 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -713,9 +713,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PermeabilityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index ed3541d486..35b62f63d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -713,9 +713,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PermittivityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs index 0983fc86b8..3d228d91f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs @@ -785,9 +785,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PorousMediumPermeabilityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index ffc25f77ed..2f49d5080e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1280,9 +1280,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PowerUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 94dea870b4..24c67a9352 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1484,9 +1484,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PowerDensityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 9faf694184..eee3ae332b 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -729,9 +729,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PowerRatioUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index b3044e925d..2a91befa59 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1630,9 +1630,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PressureUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 99d1c3f2bb..2d54c32e54 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -1027,9 +1027,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(PressureChangeRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs index 81d8e56701..66133892c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs @@ -818,9 +818,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RadiationEquivalentDoseUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs index 779e463d09..d3e02da4f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs @@ -883,9 +883,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RadiationEquivalentDoseRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs index ea7194dc01..812da76551 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs @@ -836,9 +836,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RadiationExposureUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs index 826145264d..a96a95c519 100644 --- a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs @@ -1214,9 +1214,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RadioactivityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index dbecaddb2f..6512dc48b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -786,9 +786,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RatioUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs index e58788f74d..82ae527d99 100644 --- a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs @@ -728,9 +728,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RatioChangeRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs index 8e6446c7c8..fa16223844 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs @@ -939,9 +939,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ReciprocalAreaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs index 2f2ec5abe2..0750dace25 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs @@ -935,9 +935,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ReciprocalLengthUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs index 199596c42d..6c12b06e53 100644 --- a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs @@ -696,9 +696,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RelativeHumidityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index e1127eda49..ed0f6dde57 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -764,9 +764,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RotationalAccelerationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 964613906c..7262bc7e78 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -944,9 +944,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RotationalSpeedUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index bbda77fd82..0a6889e56b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -1311,9 +1311,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RotationalStiffnessUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index e72532261f..f8eb0afebf 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -793,9 +793,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(RotationalStiffnessPerLengthUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs index 40e039e76d..abc9a24426 100644 --- a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs @@ -696,9 +696,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ScalarUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index d2614ca7f7..2a0570adc9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -699,9 +699,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SolidAngleUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 3f0b92009d..26e37a9e26 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -1287,9 +1287,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SpecificEnergyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 16135e5263..97c2ee7c4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -872,9 +872,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SpecificEntropyUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs index d86299a382..0bbf00f424 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs @@ -767,9 +767,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SpecificFuelConsumptionUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index b0a1605692..7ef2f228ec 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -764,9 +764,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SpecificVolumeUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 37b9ddb345..5903a099c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -1033,9 +1033,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SpecificWeightUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index f7e8da5481..35a005752d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1346,9 +1346,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(SpeedUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs index 05934ce5e6..34a3c09609 100644 --- a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs @@ -854,9 +854,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(StandardVolumeFlowUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 38cfde63d4..94e66aff64 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -825,9 +825,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(TemperatureUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 2b3e15f4d2..1fac793995 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -1009,9 +1009,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(TemperatureChangeRateUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index db18d68336..6951bd5d09 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -907,9 +907,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(TemperatureDeltaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs index e90da44e9d..f215eb31ca 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs @@ -775,9 +775,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(TemperatureGradientUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index a056d62526..3821de1292 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -731,9 +731,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ThermalConductivityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs index 12511ea0ba..3c08dc9c5a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs @@ -818,9 +818,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ThermalInsulanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 6ec1896203..11693deb43 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -728,9 +728,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(ThermalResistanceUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 4f6b44e43a..8a260baeef 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1195,9 +1195,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(TorqueUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs index dd697e985d..483b6c6be3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs @@ -699,9 +699,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(TurbidityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 5fe3a101d5..1528ba9318 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -696,9 +696,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VitaminAUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index ee14a5a982..223437b961 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1777,9 +1777,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VolumeUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index 5d8be6574d..2b33114983 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs @@ -1059,9 +1059,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VolumeConcentrationUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index e94d1d09f0..95ab4f9d45 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -2081,9 +2081,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VolumeFlowUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs index 5806b2d3b0..e184bb5cd8 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs @@ -728,9 +728,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VolumeFlowPerAreaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs index fb95ba94b2..ce3022be10 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs @@ -854,9 +854,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VolumePerLengthUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs index 4d6d883152..650743addb 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs @@ -857,9 +857,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(VolumetricHeatCapacityUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs index 2523f92a3c..bd87fe23e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs @@ -800,9 +800,6 @@ IQuantity IQuantity.ToUnit(Enum unit) /// IQuantity IQuantity.ToUnit(WarpingMomentOfInertiaUnit unit) => ToUnit(unit); - /// - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => this.ToUnit(unitSystem); - #endregion #endregion diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 38fd95a9b9..149b3f9dd0 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -92,14 +92,6 @@ public interface IQuantity : IQuantity /// A new in the given . IQuantity ToUnit(TUnitType unit); - /// - /// Converts to a quantity with a unit determined by the given . - /// If multiple units were found for the given , the first match will be used. - /// - /// The to convert the quantity to. - /// A new quantity with the determined unit. - IQuantity ToUnit(UnitSystem unitSystem); - #if NET #region Implementation of IQuantity @@ -174,13 +166,6 @@ IQuantity IQuantity.ToUnit(TUnitType unit) { return TSelf.From(As(unit), unit); } - - IQuantity IQuantity.ToUnit(UnitSystem unitSystem) - { - TUnitType unit = QuantityInfo.GetDefaultUnit(unitSystem); - return ToUnit(unit); - } - #endif }