From 8f503e9ba959308f63e8a0c13d5cce71de4097a9 Mon Sep 17 00:00:00 2001 From: Muximize Date: Fri, 1 Mar 2024 20:56:23 +0100 Subject: [PATCH] Remove obsolete units (#1372) See #1200 --- .../CoefficientOfThermalExpansion.json | 48 ----------- .../HeatTransferCoefficient.json | 13 --- .../CoefficientOfThermalExpansion.g.cs | 42 ---------- .../Quantities/HeatTransferCoefficient.g.cs | 14 ---- .../CoefficientOfThermalExpansionUnit.g.cs | 6 -- .../Units/HeatTransferCoefficientUnit.g.cs | 2 - ...cientOfThermalExpansionExtensionsTest.g.cs | 12 --- ...HeatTransferCoefficientExtensionsTest.g.cs | 4 - ...efficientOfThermalExpansionExtensions.g.cs | 27 ------- ...erToHeatTransferCoefficientExtensions.g.cs | 9 --- .../CoefficientOfThermalExpansionTests.cs | 10 +-- .../HeatTransferCoefficientTests.cs | 1 - ...oefficientOfThermalExpansionTestsBase.g.cs | 79 +++++-------------- .../HeatTransferCoefficientTestsBase.g.cs | 37 +++------ UnitsNet.Tests/QuantityTypeConverterTest.cs | 4 +- .../CoefficientOfThermalExpansion.g.cs | 60 -------------- .../Quantities/HeatTransferCoefficient.g.cs | 20 ----- .../CoefficientOfThermalExpansion.restext | 3 - .../Resources/HeatTransferCoefficient.restext | 1 - .../CoefficientOfThermalExpansionUnit.g.cs | 6 -- .../Units/HeatTransferCoefficientUnit.g.cs | 2 - 21 files changed, 36 insertions(+), 364 deletions(-) diff --git a/Common/UnitDefinitions/CoefficientOfThermalExpansion.json b/Common/UnitDefinitions/CoefficientOfThermalExpansion.json index b861dab5e9..e96737307c 100644 --- a/Common/UnitDefinitions/CoefficientOfThermalExpansion.json +++ b/Common/UnitDefinitions/CoefficientOfThermalExpansion.json @@ -6,54 +6,6 @@ "Θ": -1 }, "Units": [ - { - "SingularName": "InverseKelvin", - "PluralName": "InverseKelvin", - "ObsoleteText": "Use PerKelvin instead.", - "BaseUnits": { - "Θ": "Kelvin" - }, - "FromUnitToBaseFunc": "{x}", - "FromBaseToUnitFunc": "{x}", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "1/K" ] - } - ] - }, - { - "SingularName": "InverseDegreeCelsius", - "PluralName": "InverseDegreeCelsius", - "ObsoleteText": "Use PerDegreeCelsius instead.", - "BaseUnits": { - "Θ": "DegreeCelsius" - }, - "FromUnitToBaseFunc": "{x}", - "FromBaseToUnitFunc": "{x}", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "1/°C" ] - } - ] - }, - { - "SingularName": "InverseDegreeFahrenheit", - "PluralName": "InverseDegreeFahrenheit", - "ObsoleteText": "Use PerDegreeFahrenheit instead.", - "BaseUnits": { - "Θ": "DegreeFahrenheit" - }, - "FromUnitToBaseFunc": "{x} * 9 / 5", - "FromBaseToUnitFunc": "{x} * 5 / 9", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "1/°F" ] - } - ] - }, { "SingularName": "PerKelvin", "PluralName": "PerKelvin", diff --git a/Common/UnitDefinitions/HeatTransferCoefficient.json b/Common/UnitDefinitions/HeatTransferCoefficient.json index 75db786ba7..a04241e7f2 100644 --- a/Common/UnitDefinitions/HeatTransferCoefficient.json +++ b/Common/UnitDefinitions/HeatTransferCoefficient.json @@ -32,19 +32,6 @@ } ] }, - { - "SingularName": "BtuPerSquareFootDegreeFahrenheit", - "PluralName": "BtusPerSquareFootDegreeFahrenheit", - "ObsoleteText": "The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead", - "FromUnitToBaseFunc": "{x} * 5.6782633411134878", - "FromBaseToUnitFunc": "{x} / 5.6782633411134878", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "Btu/ft²·°F" ] - } - ] - }, { "SingularName": "BtuPerHourSquareFootDegreeFahrenheit", "PluralName": "BtusPerHourSquareFootDegreeFahrenheit", diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index 7eb7f4995f..fb2d5e1a0a 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -78,24 +78,6 @@ public CoefficientOfThermalExpansion(double value, CoefficientOfThermalExpansion public static CoefficientOfThermalExpansion Zero { get; } = new CoefficientOfThermalExpansion(0, BaseUnit); #region Conversion Properties - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("Use PerDegreeCelsius instead.")] - public double InverseDegreeCelsius => As(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); - - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("Use PerDegreeFahrenheit instead.")] - public double InverseDegreeFahrenheit => As(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); - - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("Use PerKelvin instead.")] - public double InverseKelvin => As(CoefficientOfThermalExpansionUnit.InverseKelvin); - /// /// Gets a value of this quantity converted into /// @@ -130,24 +112,6 @@ public CoefficientOfThermalExpansion(double value, CoefficientOfThermalExpansion #region Static Factory Methods - /// - /// Creates a from . - /// - [Obsolete("Use PerDegreeCelsius instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(double inversedegreecelsius) => new CoefficientOfThermalExpansion(inversedegreecelsius, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); - - /// - /// Creates a from . - /// - [Obsolete("Use PerDegreeFahrenheit instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(double inversedegreefahrenheit) => new CoefficientOfThermalExpansion(inversedegreefahrenheit, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); - - /// - /// Creates a from . - /// - [Obsolete("Use PerKelvin instead.")] - public static CoefficientOfThermalExpansion FromInverseKelvin(double inversekelvin) => new CoefficientOfThermalExpansion(inversekelvin, CoefficientOfThermalExpansionUnit.InverseKelvin); - /// /// Creates a from . /// @@ -218,9 +182,6 @@ private double GetValueInBaseUnit() { return Unit switch { - CoefficientOfThermalExpansionUnit.InverseDegreeCelsius => _value, - CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit => _value * 9 / 5, - CoefficientOfThermalExpansionUnit.InverseKelvin => _value, CoefficientOfThermalExpansionUnit.PerDegreeCelsius => _value, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => _value * 9 / 5, CoefficientOfThermalExpansionUnit.PerKelvin => _value, @@ -240,9 +201,6 @@ private double GetValueAs(CoefficientOfThermalExpansionUnit unit) return unit switch { - CoefficientOfThermalExpansionUnit.InverseDegreeCelsius => baseUnitValue, - CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit => baseUnitValue * 5 / 9, - CoefficientOfThermalExpansionUnit.InverseKelvin => baseUnitValue, CoefficientOfThermalExpansionUnit.PerDegreeCelsius => baseUnitValue, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => baseUnitValue * 5 / 9, CoefficientOfThermalExpansionUnit.PerKelvin => baseUnitValue, diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index b42f1cd23e..6cf7d5450a 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -83,12 +83,6 @@ public HeatTransferCoefficient(double value, HeatTransferCoefficientUnit unit) /// public double BtusPerHourSquareFootDegreeFahrenheit => As(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - public double BtusPerSquareFootDegreeFahrenheit => As(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); - /// /// Gets a value of this quantity converted into /// @@ -118,12 +112,6 @@ public HeatTransferCoefficient(double value, HeatTransferCoefficientUnit unit) /// public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit(double btusperhoursquarefootdegreefahrenheit) => new HeatTransferCoefficient(btusperhoursquarefootdegreefahrenheit, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); - /// - /// Creates a from . - /// - [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(double btuspersquarefootdegreefahrenheit) => new HeatTransferCoefficient(btuspersquarefootdegreefahrenheit, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); - /// /// Creates a from . /// @@ -185,7 +173,6 @@ private double GetValueInBaseUnit() return Unit switch { HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => _value * 5.6782633411134878, - HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit => _value * 5.6782633411134878, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (_value * 4.1868) / 3600, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => ((_value * 4.1868) / 3600) * 1e3d, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => _value, @@ -204,7 +191,6 @@ private double GetValueAs(HeatTransferCoefficientUnit unit) return unit switch { HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => baseUnitValue / 5.6782633411134878, - HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit => baseUnitValue / 5.6782633411134878, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (baseUnitValue / 4.1868) * 3600, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => ((baseUnitValue / 4.1868) * 3600) / 1e3d, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => baseUnitValue, diff --git a/UnitsNet.NanoFramework/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs index 79748b807b..258f5065da 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs @@ -25,12 +25,6 @@ namespace UnitsNet.Units public enum CoefficientOfThermalExpansionUnit { - [System.Obsolete("Use PerDegreeCelsius instead.")] - InverseDegreeCelsius = 1, - [System.Obsolete("Use PerDegreeFahrenheit instead.")] - InverseDegreeFahrenheit = 2, - [System.Obsolete("Use PerKelvin instead.")] - InverseKelvin = 3, PerDegreeCelsius = 9, PerDegreeFahrenheit = 11, PerKelvin = 13, diff --git a/UnitsNet.NanoFramework/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs index beaabc3f3b..1a52bffbfe 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs @@ -26,8 +26,6 @@ namespace UnitsNet.Units public enum HeatTransferCoefficientUnit { BtuPerHourSquareFootDegreeFahrenheit = 11, - [System.Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - BtuPerSquareFootDegreeFahrenheit = 1, CaloriePerHourSquareMeterDegreeCelsius = 5, KilocaloriePerHourSquareMeterDegreeCelsius = 8, WattPerSquareMeterCelsius = 2, diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensionsTest.g.cs index 880508b3ee..fa8854e062 100644 --- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensionsTest.g.cs +++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensionsTest.g.cs @@ -24,18 +24,6 @@ namespace UnitsNet.Tests { public class NumberToCoefficientOfThermalExpansionExtensionsTests { - [Fact] - public void NumberToInverseDegreeCelsiusTest() => - Assert.Equal(CoefficientOfThermalExpansion.FromInverseDegreeCelsius(2), 2.InverseDegreeCelsius()); - - [Fact] - public void NumberToInverseDegreeFahrenheitTest() => - Assert.Equal(CoefficientOfThermalExpansion.FromInverseDegreeFahrenheit(2), 2.InverseDegreeFahrenheit()); - - [Fact] - public void NumberToInverseKelvinTest() => - Assert.Equal(CoefficientOfThermalExpansion.FromInverseKelvin(2), 2.InverseKelvin()); - [Fact] public void NumberToPerDegreeCelsiusTest() => Assert.Equal(CoefficientOfThermalExpansion.FromPerDegreeCelsius(2), 2.PerDegreeCelsius()); diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToHeatTransferCoefficientExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToHeatTransferCoefficientExtensionsTest.g.cs index 9f317e64d2..fb4878717d 100644 --- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToHeatTransferCoefficientExtensionsTest.g.cs +++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToHeatTransferCoefficientExtensionsTest.g.cs @@ -28,10 +28,6 @@ public class NumberToHeatTransferCoefficientExtensionsTests public void NumberToBtusPerHourSquareFootDegreeFahrenheitTest() => Assert.Equal(HeatTransferCoefficient.FromBtusPerHourSquareFootDegreeFahrenheit(2), 2.BtusPerHourSquareFootDegreeFahrenheit()); - [Fact] - public void NumberToBtusPerSquareFootDegreeFahrenheitTest() => - Assert.Equal(HeatTransferCoefficient.FromBtusPerSquareFootDegreeFahrenheit(2), 2.BtusPerSquareFootDegreeFahrenheit()); - [Fact] public void NumberToCaloriesPerHourSquareMeterDegreeCelsiusTest() => Assert.Equal(HeatTransferCoefficient.FromCaloriesPerHourSquareMeterDegreeCelsius(2), 2.CaloriesPerHourSquareMeterDegreeCelsius()); diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs index ad0f6b2bc5..22adc70a09 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToCoefficientOfThermalExpansionExtensions.g.cs @@ -32,33 +32,6 @@ namespace UnitsNet.NumberExtensions.NumberToCoefficientOfThermalExpansion /// public static class NumberToCoefficientOfThermalExpansionExtensions { - /// - [Obsolete("Use PerDegreeCelsius instead.")] - public static CoefficientOfThermalExpansion InverseDegreeCelsius(this T value) - where T : notnull -#if NET7_0_OR_GREATER - , INumber -#endif - => CoefficientOfThermalExpansion.FromInverseDegreeCelsius(Convert.ToDouble(value)); - - /// - [Obsolete("Use PerDegreeFahrenheit instead.")] - public static CoefficientOfThermalExpansion InverseDegreeFahrenheit(this T value) - where T : notnull -#if NET7_0_OR_GREATER - , INumber -#endif - => CoefficientOfThermalExpansion.FromInverseDegreeFahrenheit(Convert.ToDouble(value)); - - /// - [Obsolete("Use PerKelvin instead.")] - public static CoefficientOfThermalExpansion InverseKelvin(this T value) - where T : notnull -#if NET7_0_OR_GREATER - , INumber -#endif - => CoefficientOfThermalExpansion.FromInverseKelvin(Convert.ToDouble(value)); - /// public static CoefficientOfThermalExpansion PerDegreeCelsius(this T value) where T : notnull diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs index d53c217c5f..477658707c 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToHeatTransferCoefficientExtensions.g.cs @@ -40,15 +40,6 @@ public static HeatTransferCoefficient BtusPerHourSquareFootDegreeFahrenheit(t #endif => HeatTransferCoefficient.FromBtusPerHourSquareFootDegreeFahrenheit(Convert.ToDouble(value)); - /// - [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - public static HeatTransferCoefficient BtusPerSquareFootDegreeFahrenheit(this T value) - where T : notnull -#if NET7_0_OR_GREATER - , INumber -#endif - => HeatTransferCoefficient.FromBtusPerSquareFootDegreeFahrenheit(Convert.ToDouble(value)); - /// public static HeatTransferCoefficient CaloriesPerHourSquareMeterDegreeCelsius(this T value) where T : notnull diff --git a/UnitsNet.Tests/CustomCode/CoefficientOfThermalExpansionTests.cs b/UnitsNet.Tests/CustomCode/CoefficientOfThermalExpansionTests.cs index 4e43ec261e..6199c7f658 100644 --- a/UnitsNet.Tests/CustomCode/CoefficientOfThermalExpansionTests.cs +++ b/UnitsNet.Tests/CustomCode/CoefficientOfThermalExpansionTests.cs @@ -29,12 +29,6 @@ public class CoefficientOfThermalExpansionTests : CoefficientOfThermalExpansionT { protected override bool SupportsSIUnitSystem => true; - protected override double InverseDegreeCelsiusInOnePerKelvin => 1.0; - - protected override double InverseDegreeFahrenheitInOnePerKelvin => 0.5555555555555556; - - protected override double InverseKelvinInOnePerKelvin => 1.0; - protected override double PerDegreeCelsiusInOnePerKelvin => 1.0; protected override double PerDegreeFahrenheitInOnePerKelvin => 0.5555555555555556; @@ -52,7 +46,7 @@ public void CoefficientOfThermalExpansionTimesTemperatureDelta() { double temperatureDeltaDegC = 2.0; double ctePerDegC = 0.001; - CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromInverseDegreeCelsius(ctePerDegC); + CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromPerDegreeCelsius(ctePerDegC); TemperatureDelta dT = TemperatureDelta.FromDegreesCelsius(temperatureDeltaDegC); AssertEx.EqualTolerance(cte * dT, ctePerDegC * temperatureDeltaDegC, 1e-10); } @@ -62,7 +56,7 @@ public void TemperatureDeltaTimesCoefficientOfThermalExpansion() { double temperatureDeltaDegC = 2.0; double ctePerDegC = 0.001; - CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromInverseDegreeCelsius(ctePerDegC); + CoefficientOfThermalExpansion cte = CoefficientOfThermalExpansion.FromPerDegreeCelsius(ctePerDegC); TemperatureDelta dT = TemperatureDelta.FromDegreesCelsius(temperatureDeltaDegC); AssertEx.EqualTolerance(dT * cte, temperatureDeltaDegC * ctePerDegC, 1e-10); } diff --git a/UnitsNet.Tests/CustomCode/HeatTransferCoefficientTests.cs b/UnitsNet.Tests/CustomCode/HeatTransferCoefficientTests.cs index ab1846a381..1e67ece931 100644 --- a/UnitsNet.Tests/CustomCode/HeatTransferCoefficientTests.cs +++ b/UnitsNet.Tests/CustomCode/HeatTransferCoefficientTests.cs @@ -32,7 +32,6 @@ public class HeatTransferCoefficientTests : HeatTransferCoefficientTestsBase protected override double WattsPerSquareMeterKelvinInOneWattPerSquareMeterKelvin => 1; protected override double BtusPerHourSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin => 1.7611018368230584e-1; protected override double KilocaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin => 0.859845227859; - protected override double BtusPerSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin => 1.7611018368230584e-1; protected override double CaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin => 859.845227859; } } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs index 9f12014fbd..b3dc60110f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs @@ -38,9 +38,6 @@ namespace UnitsNet.Tests // ReSharper disable once PartialTypeWithSinglePart public abstract partial class CoefficientOfThermalExpansionTestsBase : QuantityTestsBase { - protected abstract double InverseDegreeCelsiusInOnePerKelvin { get; } - protected abstract double InverseDegreeFahrenheitInOnePerKelvin { get; } - protected abstract double InverseKelvinInOnePerKelvin { get; } protected abstract double PerDegreeCelsiusInOnePerKelvin { get; } protected abstract double PerDegreeFahrenheitInOnePerKelvin { get; } protected abstract double PerKelvinInOnePerKelvin { get; } @@ -49,9 +46,6 @@ public abstract partial class CoefficientOfThermalExpansionTestsBase : QuantityT protected abstract double PpmPerKelvinInOnePerKelvin { get; } // ReSharper disable VirtualMemberNeverOverriden.Global - protected virtual double InverseDegreeCelsiusTolerance { get { return 1e-5; } } - protected virtual double InverseDegreeFahrenheitTolerance { get { return 1e-5; } } - protected virtual double InverseKelvinTolerance { get { return 1e-5; } } protected virtual double PerDegreeCelsiusTolerance { get { return 1e-5; } } protected virtual double PerDegreeFahrenheitTolerance { get { return 1e-5; } } protected virtual double PerKelvinTolerance { get { return 1e-5; } } @@ -64,9 +58,6 @@ public abstract partial class CoefficientOfThermalExpansionTestsBase : QuantityT { return unit switch { - CoefficientOfThermalExpansionUnit.InverseDegreeCelsius => (InverseDegreeCelsiusInOnePerKelvin, InverseDegreeCelsiusTolerance), - CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit => (InverseDegreeFahrenheitInOnePerKelvin, InverseDegreeFahrenheitTolerance), - CoefficientOfThermalExpansionUnit.InverseKelvin => (InverseKelvinInOnePerKelvin, InverseKelvinTolerance), CoefficientOfThermalExpansionUnit.PerDegreeCelsius => (PerDegreeCelsiusInOnePerKelvin, PerDegreeCelsiusTolerance), CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => (PerDegreeFahrenheitInOnePerKelvin, PerDegreeFahrenheitTolerance), CoefficientOfThermalExpansionUnit.PerKelvin => (PerKelvinInOnePerKelvin, PerKelvinTolerance), @@ -79,9 +70,6 @@ public abstract partial class CoefficientOfThermalExpansionTestsBase : QuantityT public static IEnumerable UnitTypes = new List { - new object[] { CoefficientOfThermalExpansionUnit.InverseDegreeCelsius }, - new object[] { CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit }, - new object[] { CoefficientOfThermalExpansionUnit.InverseKelvin }, new object[] { CoefficientOfThermalExpansionUnit.PerDegreeCelsius }, new object[] { CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit }, new object[] { CoefficientOfThermalExpansionUnit.PerKelvin }, @@ -155,9 +143,6 @@ public void CoefficientOfThermalExpansion_QuantityInfo_ReturnsQuantityInfoDescri public void PerKelvinToCoefficientOfThermalExpansionUnits() { CoefficientOfThermalExpansion perkelvin = CoefficientOfThermalExpansion.FromPerKelvin(1); - AssertEx.EqualTolerance(InverseDegreeCelsiusInOnePerKelvin, perkelvin.InverseDegreeCelsius, InverseDegreeCelsiusTolerance); - AssertEx.EqualTolerance(InverseDegreeFahrenheitInOnePerKelvin, perkelvin.InverseDegreeFahrenheit, InverseDegreeFahrenheitTolerance); - AssertEx.EqualTolerance(InverseKelvinInOnePerKelvin, perkelvin.InverseKelvin, InverseKelvinTolerance); AssertEx.EqualTolerance(PerDegreeCelsiusInOnePerKelvin, perkelvin.PerDegreeCelsius, PerDegreeCelsiusTolerance); AssertEx.EqualTolerance(PerDegreeFahrenheitInOnePerKelvin, perkelvin.PerDegreeFahrenheit, PerDegreeFahrenheitTolerance); AssertEx.EqualTolerance(PerKelvinInOnePerKelvin, perkelvin.PerKelvin, PerKelvinTolerance); @@ -169,41 +154,29 @@ public void PerKelvinToCoefficientOfThermalExpansionUnits() [Fact] public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() { - var quantity00 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); - AssertEx.EqualTolerance(1, quantity00.InverseDegreeCelsius, InverseDegreeCelsiusTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, quantity00.Unit); + var quantity00 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); + AssertEx.EqualTolerance(1, quantity00.PerDegreeCelsius, PerDegreeCelsiusTolerance); + Assert.Equal(CoefficientOfThermalExpansionUnit.PerDegreeCelsius, quantity00.Unit); - var quantity01 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); - AssertEx.EqualTolerance(1, quantity01.InverseDegreeFahrenheit, InverseDegreeFahrenheitTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, quantity01.Unit); + var quantity01 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); + AssertEx.EqualTolerance(1, quantity01.PerDegreeFahrenheit, PerDegreeFahrenheitTolerance); + Assert.Equal(CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit, quantity01.Unit); - var quantity02 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.InverseKelvin); - AssertEx.EqualTolerance(1, quantity02.InverseKelvin, InverseKelvinTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.InverseKelvin, quantity02.Unit); + var quantity02 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PerKelvin); + AssertEx.EqualTolerance(1, quantity02.PerKelvin, PerKelvinTolerance); + Assert.Equal(CoefficientOfThermalExpansionUnit.PerKelvin, quantity02.Unit); - var quantity03 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius); - AssertEx.EqualTolerance(1, quantity03.PerDegreeCelsius, PerDegreeCelsiusTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.PerDegreeCelsius, quantity03.Unit); + var quantity03 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); + AssertEx.EqualTolerance(1, quantity03.PpmPerDegreeCelsius, PpmPerDegreeCelsiusTolerance); + Assert.Equal(CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius, quantity03.Unit); - var quantity04 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit); - AssertEx.EqualTolerance(1, quantity04.PerDegreeFahrenheit, PerDegreeFahrenheitTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit, quantity04.Unit); + var quantity04 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); + AssertEx.EqualTolerance(1, quantity04.PpmPerDegreeFahrenheit, PpmPerDegreeFahrenheitTolerance); + Assert.Equal(CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit, quantity04.Unit); - var quantity05 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PerKelvin); - AssertEx.EqualTolerance(1, quantity05.PerKelvin, PerKelvinTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.PerKelvin, quantity05.Unit); - - var quantity06 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius); - AssertEx.EqualTolerance(1, quantity06.PpmPerDegreeCelsius, PpmPerDegreeCelsiusTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius, quantity06.Unit); - - var quantity07 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit); - AssertEx.EqualTolerance(1, quantity07.PpmPerDegreeFahrenheit, PpmPerDegreeFahrenheitTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit, quantity07.Unit); - - var quantity08 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PpmPerKelvin); - AssertEx.EqualTolerance(1, quantity08.PpmPerKelvin, PpmPerKelvinTolerance); - Assert.Equal(CoefficientOfThermalExpansionUnit.PpmPerKelvin, quantity08.Unit); + var quantity05 = CoefficientOfThermalExpansion.From(1, CoefficientOfThermalExpansionUnit.PpmPerKelvin); + AssertEx.EqualTolerance(1, quantity05.PpmPerKelvin, PpmPerKelvinTolerance); + Assert.Equal(CoefficientOfThermalExpansionUnit.PpmPerKelvin, quantity05.Unit); } @@ -229,9 +202,6 @@ public void FromPerKelvin_WithNanValue_DoNotThrowsArgumentException() public void As() { var perkelvin = CoefficientOfThermalExpansion.FromPerKelvin(1); - AssertEx.EqualTolerance(InverseDegreeCelsiusInOnePerKelvin, perkelvin.As(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius), InverseDegreeCelsiusTolerance); - AssertEx.EqualTolerance(InverseDegreeFahrenheitInOnePerKelvin, perkelvin.As(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit), InverseDegreeFahrenheitTolerance); - AssertEx.EqualTolerance(InverseKelvinInOnePerKelvin, perkelvin.As(CoefficientOfThermalExpansionUnit.InverseKelvin), InverseKelvinTolerance); AssertEx.EqualTolerance(PerDegreeCelsiusInOnePerKelvin, perkelvin.As(CoefficientOfThermalExpansionUnit.PerDegreeCelsius), PerDegreeCelsiusTolerance); AssertEx.EqualTolerance(PerDegreeFahrenheitInOnePerKelvin, perkelvin.As(CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit), PerDegreeFahrenheitTolerance); AssertEx.EqualTolerance(PerKelvinInOnePerKelvin, perkelvin.As(CoefficientOfThermalExpansionUnit.PerKelvin), PerKelvinTolerance); @@ -467,9 +437,6 @@ public virtual void ToUnit_FromDefaultQuantity_ReturnsQuantityWithGivenUnit(Coef public void ConversionRoundTrip() { CoefficientOfThermalExpansion perkelvin = CoefficientOfThermalExpansion.FromPerKelvin(1); - AssertEx.EqualTolerance(1, CoefficientOfThermalExpansion.FromInverseDegreeCelsius(perkelvin.InverseDegreeCelsius).PerKelvin, InverseDegreeCelsiusTolerance); - AssertEx.EqualTolerance(1, CoefficientOfThermalExpansion.FromInverseDegreeFahrenheit(perkelvin.InverseDegreeFahrenheit).PerKelvin, InverseDegreeFahrenheitTolerance); - AssertEx.EqualTolerance(1, CoefficientOfThermalExpansion.FromInverseKelvin(perkelvin.InverseKelvin).PerKelvin, InverseKelvinTolerance); AssertEx.EqualTolerance(1, CoefficientOfThermalExpansion.FromPerDegreeCelsius(perkelvin.PerDegreeCelsius).PerKelvin, PerDegreeCelsiusTolerance); AssertEx.EqualTolerance(1, CoefficientOfThermalExpansion.FromPerDegreeFahrenheit(perkelvin.PerDegreeFahrenheit).PerKelvin, PerDegreeFahrenheitTolerance); AssertEx.EqualTolerance(1, CoefficientOfThermalExpansion.FromPerKelvin(perkelvin.PerKelvin).PerKelvin, PerKelvinTolerance); @@ -534,8 +501,8 @@ public void CompareToThrowsOnNull() [Theory] [InlineData(1, CoefficientOfThermalExpansionUnit.PerKelvin, 1, CoefficientOfThermalExpansionUnit.PerKelvin, true)] // Same value and unit. [InlineData(1, CoefficientOfThermalExpansionUnit.PerKelvin, 2, CoefficientOfThermalExpansionUnit.PerKelvin, false)] // Different value. - [InlineData(2, CoefficientOfThermalExpansionUnit.PerKelvin, 1, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, false)] // Different value and unit. - [InlineData(1, CoefficientOfThermalExpansionUnit.PerKelvin, 1, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, false)] // Different unit. + [InlineData(2, CoefficientOfThermalExpansionUnit.PerKelvin, 1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius, false)] // Different value and unit. + [InlineData(1, CoefficientOfThermalExpansionUnit.PerKelvin, 1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius, false)] // Different unit. public void Equals_ReturnsTrue_IfValueAndUnitAreEqual(double valueA, CoefficientOfThermalExpansionUnit unitA, double valueB, CoefficientOfThermalExpansionUnit unitB, bool expectEqual) { var a = new CoefficientOfThermalExpansion(valueA, unitA); @@ -623,9 +590,6 @@ public void ToString_ReturnsValueAndUnitAbbreviationInCurrentCulture() var prevCulture = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); try { - Assert.Equal("1 1/°C", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius).ToString()); - Assert.Equal("1 1/°F", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit).ToString()); - Assert.Equal("1 1/K", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.InverseKelvin).ToString()); Assert.Equal("1 °C⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius).ToString()); Assert.Equal("1 °F⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit).ToString()); Assert.Equal("1 K⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerKelvin).ToString()); @@ -645,9 +609,6 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 1/°C", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 1/°F", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 1/K", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.InverseKelvin).ToString(swedishCulture)); Assert.Equal("1 °C⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius).ToString(swedishCulture)); Assert.Equal("1 °F⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit).ToString(swedishCulture)); Assert.Equal("1 K⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerKelvin).ToString(swedishCulture)); diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs index 8722aac635..18f60db9ae 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs @@ -39,7 +39,6 @@ namespace UnitsNet.Tests public abstract partial class HeatTransferCoefficientTestsBase : QuantityTestsBase { protected abstract double BtusPerHourSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin { get; } - protected abstract double BtusPerSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin { get; } protected abstract double CaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin { get; } protected abstract double KilocaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin { get; } protected abstract double WattsPerSquareMeterCelsiusInOneWattPerSquareMeterKelvin { get; } @@ -47,7 +46,6 @@ public abstract partial class HeatTransferCoefficientTestsBase : QuantityTestsBa // ReSharper disable VirtualMemberNeverOverriden.Global protected virtual double BtusPerHourSquareFootDegreeFahrenheitTolerance { get { return 1e-5; } } - protected virtual double BtusPerSquareFootDegreeFahrenheitTolerance { get { return 1e-5; } } protected virtual double CaloriesPerHourSquareMeterDegreeCelsiusTolerance { get { return 1e-5; } } protected virtual double KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance { get { return 1e-5; } } protected virtual double WattsPerSquareMeterCelsiusTolerance { get { return 1e-5; } } @@ -59,7 +57,6 @@ public abstract partial class HeatTransferCoefficientTestsBase : QuantityTestsBa return unit switch { HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => (BtusPerHourSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin, BtusPerHourSquareFootDegreeFahrenheitTolerance), - HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit => (BtusPerSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin, BtusPerSquareFootDegreeFahrenheitTolerance), HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (CaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin, CaloriesPerHourSquareMeterDegreeCelsiusTolerance), HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => (KilocaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin, KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance), HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => (WattsPerSquareMeterCelsiusInOneWattPerSquareMeterKelvin, WattsPerSquareMeterCelsiusTolerance), @@ -71,7 +68,6 @@ public abstract partial class HeatTransferCoefficientTestsBase : QuantityTestsBa public static IEnumerable UnitTypes = new List { new object[] { HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit }, - new object[] { HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit }, new object[] { HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius }, new object[] { HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius }, new object[] { HeatTransferCoefficientUnit.WattPerSquareMeterCelsius }, @@ -144,7 +140,6 @@ public void WattPerSquareMeterKelvinToHeatTransferCoefficientUnits() { HeatTransferCoefficient wattpersquaremeterkelvin = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); AssertEx.EqualTolerance(BtusPerHourSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.BtusPerHourSquareFootDegreeFahrenheit, BtusPerHourSquareFootDegreeFahrenheitTolerance); - AssertEx.EqualTolerance(BtusPerSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.BtusPerSquareFootDegreeFahrenheit, BtusPerSquareFootDegreeFahrenheitTolerance); AssertEx.EqualTolerance(CaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.CaloriesPerHourSquareMeterDegreeCelsius, CaloriesPerHourSquareMeterDegreeCelsiusTolerance); AssertEx.EqualTolerance(KilocaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.KilocaloriesPerHourSquareMeterDegreeCelsius, KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance); AssertEx.EqualTolerance(WattsPerSquareMeterCelsiusInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.WattsPerSquareMeterCelsius, WattsPerSquareMeterCelsiusTolerance); @@ -158,25 +153,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() AssertEx.EqualTolerance(1, quantity00.BtusPerHourSquareFootDegreeFahrenheit, BtusPerHourSquareFootDegreeFahrenheitTolerance); Assert.Equal(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit, quantity00.Unit); - var quantity01 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); - AssertEx.EqualTolerance(1, quantity01.BtusPerSquareFootDegreeFahrenheit, BtusPerSquareFootDegreeFahrenheitTolerance); - Assert.Equal(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit, quantity01.Unit); + var quantity01 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); + AssertEx.EqualTolerance(1, quantity01.CaloriesPerHourSquareMeterDegreeCelsius, CaloriesPerHourSquareMeterDegreeCelsiusTolerance); + Assert.Equal(HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius, quantity01.Unit); - var quantity02 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius); - AssertEx.EqualTolerance(1, quantity02.CaloriesPerHourSquareMeterDegreeCelsius, CaloriesPerHourSquareMeterDegreeCelsiusTolerance); - Assert.Equal(HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius, quantity02.Unit); + var quantity02 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); + AssertEx.EqualTolerance(1, quantity02.KilocaloriesPerHourSquareMeterDegreeCelsius, KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance); + Assert.Equal(HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius, quantity02.Unit); - var quantity03 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius); - AssertEx.EqualTolerance(1, quantity03.KilocaloriesPerHourSquareMeterDegreeCelsius, KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance); - Assert.Equal(HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius, quantity03.Unit); + var quantity03 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); + AssertEx.EqualTolerance(1, quantity03.WattsPerSquareMeterCelsius, WattsPerSquareMeterCelsiusTolerance); + Assert.Equal(HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, quantity03.Unit); - var quantity04 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius); - AssertEx.EqualTolerance(1, quantity04.WattsPerSquareMeterCelsius, WattsPerSquareMeterCelsiusTolerance); - Assert.Equal(HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, quantity04.Unit); - - var quantity05 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin); - AssertEx.EqualTolerance(1, quantity05.WattsPerSquareMeterKelvin, WattsPerSquareMeterKelvinTolerance); - Assert.Equal(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity05.Unit); + var quantity04 = HeatTransferCoefficient.From(1, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin); + AssertEx.EqualTolerance(1, quantity04.WattsPerSquareMeterKelvin, WattsPerSquareMeterKelvinTolerance); + Assert.Equal(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity04.Unit); } @@ -203,7 +194,6 @@ public void As() { var wattpersquaremeterkelvin = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); AssertEx.EqualTolerance(BtusPerHourSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.As(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit), BtusPerHourSquareFootDegreeFahrenheitTolerance); - AssertEx.EqualTolerance(BtusPerSquareFootDegreeFahrenheitInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.As(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit), BtusPerSquareFootDegreeFahrenheitTolerance); AssertEx.EqualTolerance(CaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.As(HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius), CaloriesPerHourSquareMeterDegreeCelsiusTolerance); AssertEx.EqualTolerance(KilocaloriesPerHourSquareMeterDegreeCelsiusInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.As(HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius), KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance); AssertEx.EqualTolerance(WattsPerSquareMeterCelsiusInOneWattPerSquareMeterKelvin, wattpersquaremeterkelvin.As(HeatTransferCoefficientUnit.WattPerSquareMeterCelsius), WattsPerSquareMeterCelsiusTolerance); @@ -630,7 +620,6 @@ public void ConversionRoundTrip() { HeatTransferCoefficient wattpersquaremeterkelvin = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); AssertEx.EqualTolerance(1, HeatTransferCoefficient.FromBtusPerHourSquareFootDegreeFahrenheit(wattpersquaremeterkelvin.BtusPerHourSquareFootDegreeFahrenheit).WattsPerSquareMeterKelvin, BtusPerHourSquareFootDegreeFahrenheitTolerance); - AssertEx.EqualTolerance(1, HeatTransferCoefficient.FromBtusPerSquareFootDegreeFahrenheit(wattpersquaremeterkelvin.BtusPerSquareFootDegreeFahrenheit).WattsPerSquareMeterKelvin, BtusPerSquareFootDegreeFahrenheitTolerance); AssertEx.EqualTolerance(1, HeatTransferCoefficient.FromCaloriesPerHourSquareMeterDegreeCelsius(wattpersquaremeterkelvin.CaloriesPerHourSquareMeterDegreeCelsius).WattsPerSquareMeterKelvin, CaloriesPerHourSquareMeterDegreeCelsiusTolerance); AssertEx.EqualTolerance(1, HeatTransferCoefficient.FromKilocaloriesPerHourSquareMeterDegreeCelsius(wattpersquaremeterkelvin.KilocaloriesPerHourSquareMeterDegreeCelsius).WattsPerSquareMeterKelvin, KilocaloriesPerHourSquareMeterDegreeCelsiusTolerance); AssertEx.EqualTolerance(1, HeatTransferCoefficient.FromWattsPerSquareMeterCelsius(wattpersquaremeterkelvin.WattsPerSquareMeterCelsius).WattsPerSquareMeterKelvin, WattsPerSquareMeterCelsiusTolerance); @@ -783,7 +772,6 @@ public void ToString_ReturnsValueAndUnitAbbreviationInCurrentCulture() Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); try { Assert.Equal("1 Btu/h·ft²·°F", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit).ToString()); - Assert.Equal("1 Btu/ft²·°F", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit).ToString()); Assert.Equal("1 kcal/h·m²·°C", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius).ToString()); Assert.Equal("1 kkcal/h·m²·°C", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius).ToString()); Assert.Equal("1 W/m²·°C", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius).ToString()); @@ -802,7 +790,6 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); Assert.Equal("1 Btu/h·ft²·°F", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 Btu/ft²·°F", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit).ToString(swedishCulture)); Assert.Equal("1 kcal/h·m²·°C", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius).ToString(swedishCulture)); Assert.Equal("1 kkcal/h·m²·°C", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius).ToString(swedishCulture)); Assert.Equal("1 W/m²·°C", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius).ToString(swedishCulture)); diff --git a/UnitsNet.Tests/QuantityTypeConverterTest.cs b/UnitsNet.Tests/QuantityTypeConverterTest.cs index 9f40f2d47f..0fe4662cd0 100644 --- a/UnitsNet.Tests/QuantityTypeConverterTest.cs +++ b/UnitsNet.Tests/QuantityTypeConverterTest.cs @@ -327,8 +327,8 @@ public void ConvertFrom_GivenStringWithPower_minus1() var converter = new QuantityTypeConverter(); ITypeDescriptorContext context = new TypeDescriptorContext("SomeMemberName", new Attribute[] { }); - Assert.Equal(CoefficientOfThermalExpansion.FromInverseKelvin(1), converter.ConvertFrom(context, Culture, "1K⁻¹")); - Assert.Equal(CoefficientOfThermalExpansion.FromInverseKelvin(1), converter.ConvertFrom(context, Culture, "1K^-1")); + Assert.Equal(CoefficientOfThermalExpansion.FromPerKelvin(1), converter.ConvertFrom(context, Culture, "1K⁻¹")); + Assert.Equal(CoefficientOfThermalExpansion.FromPerKelvin(1), converter.ConvertFrom(context, Culture, "1K^-1")); } [Fact] diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index b931c4e7fe..6985716cf0 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -71,9 +71,6 @@ static CoefficientOfThermalExpansion() Info = new QuantityInfo("CoefficientOfThermalExpansion", new UnitInfo[] { - new UnitInfo(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, "InverseDegreeCelsius", new BaseUnits(temperature: TemperatureUnit.DegreeCelsius), "CoefficientOfThermalExpansion"), - new UnitInfo(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, "InverseDegreeFahrenheit", new BaseUnits(temperature: TemperatureUnit.DegreeFahrenheit), "CoefficientOfThermalExpansion"), - new UnitInfo(CoefficientOfThermalExpansionUnit.InverseKelvin, "InverseKelvin", new BaseUnits(temperature: TemperatureUnit.Kelvin), "CoefficientOfThermalExpansion"), new UnitInfo(CoefficientOfThermalExpansionUnit.PerDegreeCelsius, "PerDegreeCelsius", new BaseUnits(temperature: TemperatureUnit.DegreeCelsius), "CoefficientOfThermalExpansion"), new UnitInfo(CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit, "PerDegreeFahrenheit", new BaseUnits(temperature: TemperatureUnit.DegreeFahrenheit), "CoefficientOfThermalExpansion"), new UnitInfo(CoefficientOfThermalExpansionUnit.PerKelvin, "PerKelvin", new BaseUnits(temperature: TemperatureUnit.Kelvin), "CoefficientOfThermalExpansion"), @@ -182,24 +179,6 @@ public CoefficientOfThermalExpansion(double value, UnitSystem unitSystem) #region Conversion Properties - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("Use PerDegreeCelsius instead.")] - public double InverseDegreeCelsius => As(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); - - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("Use PerDegreeFahrenheit instead.")] - public double InverseDegreeFahrenheit => As(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); - - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("Use PerKelvin instead.")] - public double InverseKelvin => As(CoefficientOfThermalExpansionUnit.InverseKelvin); - /// /// Gets a value of this quantity converted into /// @@ -241,9 +220,6 @@ public CoefficientOfThermalExpansion(double value, UnitSystem unitSystem) internal static void RegisterDefaultConversions(UnitConverter unitConverter) { // Register in unit converter: CoefficientOfThermalExpansionUnit -> BaseUnit - unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerKelvin)); - unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerKelvin)); - unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.InverseKelvin, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerKelvin)); unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerDegreeCelsius, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerKelvin)); unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerKelvin)); unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerKelvin)); @@ -254,9 +230,6 @@ internal static void RegisterDefaultConversions(UnitConverter unitConverter) unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PerKelvin, quantity => quantity); // Register in unit converter: BaseUnit -> CoefficientOfThermalExpansionUnit - unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.InverseDegreeCelsius)); - unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit)); - unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.InverseKelvin, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.InverseKelvin)); unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PerDegreeCelsius, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerDegreeCelsius)); unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit)); unitConverter.SetConversionFunction(CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius, quantity => quantity.ToUnit(CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius)); @@ -289,33 +262,6 @@ public static string GetAbbreviation(CoefficientOfThermalExpansionUnit unit, IFo #region Static Factory Methods - /// - /// Creates a from . - /// - [Obsolete("Use PerDegreeCelsius instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeCelsius(double value) - { - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius); - } - - /// - /// Creates a from . - /// - [Obsolete("Use PerDegreeFahrenheit instead.")] - public static CoefficientOfThermalExpansion FromInverseDegreeFahrenheit(double value) - { - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit); - } - - /// - /// Creates a from . - /// - [Obsolete("Use PerKelvin instead.")] - public static CoefficientOfThermalExpansion FromInverseKelvin(double value) - { - return new CoefficientOfThermalExpansion(value, CoefficientOfThermalExpansionUnit.InverseKelvin); - } - /// /// Creates a from . /// @@ -864,9 +810,6 @@ private bool TryToUnit(CoefficientOfThermalExpansionUnit unit, [NotNullWhen(true CoefficientOfThermalExpansion? convertedOrNull = (Unit, unit) switch { // CoefficientOfThermalExpansionUnit -> BaseUnit - (CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value, CoefficientOfThermalExpansionUnit.PerKelvin), - (CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value * 9 / 5, CoefficientOfThermalExpansionUnit.PerKelvin), - (CoefficientOfThermalExpansionUnit.InverseKelvin, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value, CoefficientOfThermalExpansionUnit.PerKelvin), (CoefficientOfThermalExpansionUnit.PerDegreeCelsius, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value, CoefficientOfThermalExpansionUnit.PerKelvin), (CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value * 9 / 5, CoefficientOfThermalExpansionUnit.PerKelvin), (CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value / 1e6, CoefficientOfThermalExpansionUnit.PerKelvin), @@ -874,9 +817,6 @@ private bool TryToUnit(CoefficientOfThermalExpansionUnit unit, [NotNullWhen(true (CoefficientOfThermalExpansionUnit.PpmPerKelvin, CoefficientOfThermalExpansionUnit.PerKelvin) => new CoefficientOfThermalExpansion(_value / 1e6, CoefficientOfThermalExpansionUnit.PerKelvin), // BaseUnit -> CoefficientOfThermalExpansionUnit - (CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius) => new CoefficientOfThermalExpansion(_value, CoefficientOfThermalExpansionUnit.InverseDegreeCelsius), - (CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit) => new CoefficientOfThermalExpansion(_value * 5 / 9, CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit), - (CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.InverseKelvin) => new CoefficientOfThermalExpansion(_value, CoefficientOfThermalExpansionUnit.InverseKelvin), (CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PerDegreeCelsius) => new CoefficientOfThermalExpansion(_value, CoefficientOfThermalExpansionUnit.PerDegreeCelsius), (CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit) => new CoefficientOfThermalExpansion(_value * 5 / 9, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit), (CoefficientOfThermalExpansionUnit.PerKelvin, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius) => new CoefficientOfThermalExpansion(_value * 1e6, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius), diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 2a8117d729..89e37c750e 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -66,7 +66,6 @@ static HeatTransferCoefficient() new UnitInfo[] { new UnitInfo(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit, "BtusPerHourSquareFootDegreeFahrenheit", BaseUnits.Undefined, "HeatTransferCoefficient"), - new UnitInfo(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit, "BtusPerSquareFootDegreeFahrenheit", BaseUnits.Undefined, "HeatTransferCoefficient"), new UnitInfo(HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius, "CaloriesPerHourSquareMeterDegreeCelsius", BaseUnits.Undefined, "HeatTransferCoefficient"), new UnitInfo(HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius, "KilocaloriesPerHourSquareMeterDegreeCelsius", BaseUnits.Undefined, "HeatTransferCoefficient"), new UnitInfo(HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, "WattsPerSquareMeterCelsius", BaseUnits.Undefined, "HeatTransferCoefficient"), @@ -178,12 +177,6 @@ public HeatTransferCoefficient(double value, UnitSystem unitSystem) /// public double BtusPerHourSquareFootDegreeFahrenheit => As(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); - /// - /// Gets a value of this quantity converted into - /// - [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - public double BtusPerSquareFootDegreeFahrenheit => As(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); - /// /// Gets a value of this quantity converted into /// @@ -216,7 +209,6 @@ internal static void RegisterDefaultConversions(UnitConverter unitConverter) { // Register in unit converter: HeatTransferCoefficientUnit -> BaseUnit unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin)); - unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin)); unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin)); unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin)); unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin)); @@ -226,7 +218,6 @@ internal static void RegisterDefaultConversions(UnitConverter unitConverter) // Register in unit converter: BaseUnit -> HeatTransferCoefficientUnit unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit)); - unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit)); unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius)); unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius)); unitConverter.SetConversionFunction(HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, quantity => quantity.ToUnit(HeatTransferCoefficientUnit.WattPerSquareMeterCelsius)); @@ -265,15 +256,6 @@ public static HeatTransferCoefficient FromBtusPerHourSquareFootDegreeFahrenheit( return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit); } - /// - /// Creates a from . - /// - [Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(double value) - { - return new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit); - } - /// /// Creates a from . /// @@ -791,14 +773,12 @@ private bool TryToUnit(HeatTransferCoefficientUnit unit, [NotNullWhen(true)] out { // HeatTransferCoefficientUnit -> BaseUnit (HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) => new HeatTransferCoefficient(_value * 5.6782633411134878, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin), - (HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) => new HeatTransferCoefficient(_value * 5.6782633411134878, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin), (HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) => new HeatTransferCoefficient((_value * 4.1868) / 3600, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin), (HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) => new HeatTransferCoefficient(((_value * 4.1868) / 3600) * 1e3d, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin), (HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) => new HeatTransferCoefficient(_value, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin), // BaseUnit -> HeatTransferCoefficientUnit (HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit) => new HeatTransferCoefficient(_value / 5.6782633411134878, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit), - (HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit) => new HeatTransferCoefficient(_value / 5.6782633411134878, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit), (HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius) => new HeatTransferCoefficient((_value / 4.1868) * 3600, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius), (HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius) => new HeatTransferCoefficient(((_value / 4.1868) * 3600) / 1e3d, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius), (HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius) => new HeatTransferCoefficient(_value, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius), diff --git a/UnitsNet/GeneratedCode/Resources/CoefficientOfThermalExpansion.restext b/UnitsNet/GeneratedCode/Resources/CoefficientOfThermalExpansion.restext index 5b3891862a..a243d3cce3 100644 --- a/UnitsNet/GeneratedCode/Resources/CoefficientOfThermalExpansion.restext +++ b/UnitsNet/GeneratedCode/Resources/CoefficientOfThermalExpansion.restext @@ -1,6 +1,3 @@ -InverseDegreeCelsius=1/°C -InverseDegreeFahrenheit=1/°F -InverseKelvin=1/K PerDegreeCelsius=°C⁻¹ PerDegreeFahrenheit=°F⁻¹ PerKelvin=K⁻¹ diff --git a/UnitsNet/GeneratedCode/Resources/HeatTransferCoefficient.restext b/UnitsNet/GeneratedCode/Resources/HeatTransferCoefficient.restext index 86874b6f2f..7813341d30 100644 --- a/UnitsNet/GeneratedCode/Resources/HeatTransferCoefficient.restext +++ b/UnitsNet/GeneratedCode/Resources/HeatTransferCoefficient.restext @@ -1,5 +1,4 @@ BtusPerHourSquareFootDegreeFahrenheit=Btu/h·ft²·°F,Btu/ft²·h·°F,Btu/hr·ft²·°F,Btu/ft²·hr·°F -BtusPerSquareFootDegreeFahrenheit=Btu/ft²·°F CaloriesPerHourSquareMeterDegreeCelsius=kcal/h·m²·°C,kcal/m²·h·°C,kcal/hr·m²·°C,kcal/m²·hr·°C KilocaloriesPerHourSquareMeterDegreeCelsius=kkcal/h·m²·°C,kkcal/m²·h·°C,kkcal/hr·m²·°C,kkcal/m²·hr·°C WattsPerSquareMeterCelsius=W/m²·°C diff --git a/UnitsNet/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs b/UnitsNet/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs index 79748b807b..258f5065da 100644 --- a/UnitsNet/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs @@ -25,12 +25,6 @@ namespace UnitsNet.Units public enum CoefficientOfThermalExpansionUnit { - [System.Obsolete("Use PerDegreeCelsius instead.")] - InverseDegreeCelsius = 1, - [System.Obsolete("Use PerDegreeFahrenheit instead.")] - InverseDegreeFahrenheit = 2, - [System.Obsolete("Use PerKelvin instead.")] - InverseKelvin = 3, PerDegreeCelsius = 9, PerDegreeFahrenheit = 11, PerKelvin = 13, diff --git a/UnitsNet/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs b/UnitsNet/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs index beaabc3f3b..1a52bffbfe 100644 --- a/UnitsNet/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs @@ -26,8 +26,6 @@ namespace UnitsNet.Units public enum HeatTransferCoefficientUnit { BtuPerHourSquareFootDegreeFahrenheit = 11, - [System.Obsolete("The name of this definition incorrectly omitted time as divisor, please use BtuPerHourSquareFootDegreeFahrenheit instead")] - BtuPerSquareFootDegreeFahrenheit = 1, CaloriePerHourSquareMeterDegreeCelsius = 5, KilocaloriePerHourSquareMeterDegreeCelsius = 8, WattPerSquareMeterCelsius = 2,