diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
index b9a6039db9..8d960748e5 100644
--- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
+++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
@@ -40,6 +40,7 @@ public string Generate()
using System.Globalization;
using System.Linq;
using System.Runtime.Serialization;
+using UnitsNet.InternalHelpers;
using UnitsNet.Units;
#if NET
using System.Numerics;
@@ -154,7 +155,7 @@ private void GenerateStaticConstructor()
Writer.WL($@"
BaseUnit = {_unitEnumName}.{_quantity.BaseUnit};
- Units = Enum.GetValues(typeof({_unitEnumName})).Cast<{_unitEnumName}>().ToArray();
+ Units = EnumHelpers.GetValues<{_unitEnumName}>();
Zero = new {_quantity.Name}(0, BaseUnit);
Info = new QuantityInfo<{_unitEnumName}>(""{_quantity.Name}"",
new UnitInfo<{_unitEnumName}>[]
@@ -305,7 +306,7 @@ private void GenerateProperties()
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
Enum IQuantity.Unit => Unit;
-
+
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
UnitKey IQuantity.UnitKey => UnitKey.ForUnit(Unit);
@@ -1195,7 +1196,7 @@ public string ToString(string? format, IFormatProvider? provider)
#endregion
" );
}
-
+
///
private static string? GetObsoleteAttributeOrNull(Quantity quantity) => GetObsoleteAttributeOrNull(quantity.ObsoleteText);
diff --git a/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs
index 69443fa2d5..08f5eaaacf 100644
--- a/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs
+++ b/CodeGen/Generators/UnitsNetGen/StaticQuantityGenerator.cs
@@ -123,11 +123,14 @@ public static bool TryParse(IFormatProvider? formatProvider, Type quantityType,
};
}
- internal static IEnumerable GetQuantityTypes()
+ internal static void RegisterDefaultConversions(UnitConverter unitConverter)
{");
foreach (var quantity in _quantities)
+ {
Writer.WL($@"
- yield return typeof({quantity.Name});");
+ {quantity.Name}.RegisterDefaultConversions(unitConverter);");
+ }
+
Writer.WL(@"
}
}
diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs
index 9e4b57dd00..1c0b2e5008 100644
--- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs
+++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs
@@ -50,7 +50,7 @@ internal class UnitTestBaseClassGenerator : GeneratorBase
/// Example: "LengthUnit.Centimeter".
///
private readonly string _otherOrBaseUnitFullName;
-
+
///
/// Indicates whether the quantity is dimensionless.
///
@@ -178,6 +178,7 @@ public string Generate()
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -374,7 +375,7 @@ public void As_UnitSystem_ReturnsValueInDimensionlessUnit()
var quantity = new {_quantity.Name}(value: 1, unit: {_baseUnitFullName});
var convertedValue = quantity.As(UnitSystem.SI);
-
+
Assert.Equal(quantity.Value, convertedValue);
}}
@@ -420,7 +421,7 @@ public void ToUnitSystem_ReturnsValueInDimensionlessUnit()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{{
var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -496,7 +497,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity<{_unitEnumName}> convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}}, () =>
{{
IQuantity quantityToConvert = quantity;
@@ -504,7 +505,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}});
}}
@@ -512,7 +513,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{{
var quantity = new {_quantity.Name}(value: 1, unit: {_quantity.Name}.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1011,7 +1012,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{{
- var units = Enum.GetValues(typeof({_unitEnumName})).Cast<{_unitEnumName}>();
+ var units = EnumHelpers.GetValues<{_unitEnumName}>();
foreach (var unit in units)
{{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/PerfTests/PerfTest_Startup_Aot/PerfTest_Startup_Aot.csproj b/PerfTests/PerfTest_Startup_Aot/PerfTest_Startup_Aot.csproj
new file mode 100644
index 0000000000..85893c202a
--- /dev/null
+++ b/PerfTests/PerfTest_Startup_Aot/PerfTest_Startup_Aot.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ net9.0
+ enable
+ enable
+ perftest
+
+ true
+
+
+
+
+
+
+
diff --git a/PerfTests/PerfTest_Startup_Aot/Program.cs b/PerfTests/PerfTest_Startup_Aot/Program.cs
new file mode 100644
index 0000000000..b54c226ab3
--- /dev/null
+++ b/PerfTests/PerfTest_Startup_Aot/Program.cs
@@ -0,0 +1,4 @@
+using UnitsNet;
+using UnitsNet.Units;
+
+Console.WriteLine(Power.From(5, PowerUnit.Watt));
diff --git a/PerfTests/PerfTest_Startup_Aot/profile.sh b/PerfTests/PerfTest_Startup_Aot/profile.sh
new file mode 100644
index 0000000000..1b145208f2
--- /dev/null
+++ b/PerfTests/PerfTest_Startup_Aot/profile.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# shellcheck disable=SC2155
+declare -r dirname=$(dirname -- "$0")
+
+pushd "$dirname" || exit
+dotnet publish
+dotnet timeit "$dirname/timeit.json"
+popd || exit
diff --git a/PerfTests/PerfTest_Startup_Aot/timeit.json b/PerfTests/PerfTest_Startup_Aot/timeit.json
new file mode 100644
index 0000000000..13300ae3ad
--- /dev/null
+++ b/PerfTests/PerfTest_Startup_Aot/timeit.json
@@ -0,0 +1,8 @@
+{
+ "warmUpCount": 10,
+ "count": 20,
+ "scenarios": [{ "name": "Default" }],
+ "processName": "../../Artifacts/PerfTest_Startup_Aot/net9.0/win-x64/publish/PerfTest_Startup_Aot.exe",
+ "workingDirectory": "$(CWD)/",
+ "processTimeout": 15
+}
diff --git a/UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj b/UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj
index d4506ebd9d..ef550d5843 100644
--- a/UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj
+++ b/UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj
@@ -23,6 +23,7 @@
enable
UnitsNet
netstandard2.0;net8.0;net9.0
+ true
diff --git a/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj b/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj
index ba3fa99a4f..20f3b08438 100644
--- a/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj
+++ b/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj
@@ -25,6 +25,7 @@
enable
UnitsNet.Serialization.JsonNet
netstandard2.0;net8.0;net9.0
+ true
diff --git a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs
index 87b5309c6d..334d8e5989 100644
--- a/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs
+++ b/UnitsNet.Serialization.JsonNet/UnitsNetBaseJsonConverter.cs
@@ -3,7 +3,7 @@
using System;
using System.Collections.Concurrent;
-using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -15,6 +15,10 @@ namespace UnitsNet.Serialization.JsonNet
/// Contains shared functionality used by and
///
/// The type being converted. Should either be or
+#if NET
+ [RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
+ [RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
+#endif
public abstract class UnitsNetBaseJsonConverter : NullableQuantityConverter
{
private readonly ConcurrentDictionary _registeredTypes = new();
diff --git a/UnitsNet.Serialization.JsonNet/UnitsNetIComparableJsonConverter.cs b/UnitsNet.Serialization.JsonNet/UnitsNetIComparableJsonConverter.cs
index 66445578f1..f1aa8b7618 100644
--- a/UnitsNet.Serialization.JsonNet/UnitsNetIComparableJsonConverter.cs
+++ b/UnitsNet.Serialization.JsonNet/UnitsNetIComparableJsonConverter.cs
@@ -2,6 +2,7 @@
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
using System;
+using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -15,6 +16,10 @@ namespace UnitsNet.Serialization.JsonNet
/// Should only be used when UnitsNet types are assigned to properties of type IComparable.
/// Requires TypeNameHandling on to be set to something other than so that it outputs $type when serializing.
///
+#if NET
+ [RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
+ [RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
+#endif
public sealed class UnitsNetIComparableJsonConverter : UnitsNetBaseJsonConverter
{
///
diff --git a/UnitsNet.Serialization.JsonNet/UnitsNetIQuantityJsonConverter.cs b/UnitsNet.Serialization.JsonNet/UnitsNetIQuantityJsonConverter.cs
index d25ec17172..ceb76c6ecb 100644
--- a/UnitsNet.Serialization.JsonNet/UnitsNetIQuantityJsonConverter.cs
+++ b/UnitsNet.Serialization.JsonNet/UnitsNetIQuantityJsonConverter.cs
@@ -2,6 +2,7 @@
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
using System;
+using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -12,6 +13,10 @@ namespace UnitsNet.Serialization.JsonNet
/// JSON.net converter for IQuantity types (e.g. all units in UnitsNet)
/// Use this converter to serialize and deserialize UnitsNet types to and from JSON
///
+#if NET
+ [RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
+ [RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
+#endif
public sealed class UnitsNetIQuantityJsonConverter : UnitsNetBaseJsonConverter
{
///
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs
index 7e984c3ebd..b2dfadba90 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -367,7 +368,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -375,7 +376,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -383,7 +384,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new AbsorbedDoseOfIonizingRadiation(value: 1, unit: AbsorbedDoseOfIonizingRadiation.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1240,7 +1241,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AbsorbedDoseOfIonizingRadiationUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs
index 71a8043327..566e0c3a58 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -347,7 +348,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -355,7 +356,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -363,7 +364,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Acceleration(value: 1, unit: Acceleration.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1214,7 +1215,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AccelerationUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs
index 00822f557e..3e0d81f8a7 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -377,7 +378,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -385,7 +386,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -393,7 +394,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new AmountOfSubstance(value: 1, unit: AmountOfSubstance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1060,7 +1061,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AmountOfSubstanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs
index ae50044142..afcc91b9c3 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -176,7 +177,7 @@ public void As_UnitSystem_ReturnsValueInDimensionlessUnit()
var quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatioUnit.DecibelVolt);
var convertedValue = quantity.As(UnitSystem.SI);
-
+
Assert.Equal(quantity.Value, convertedValue);
}
@@ -222,7 +223,7 @@ public void ToUnitSystem_ReturnsValueInDimensionlessUnit()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new AmplitudeRatio(value: 1, unit: AmplitudeRatio.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -600,7 +601,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AmplitudeRatioUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs
index 64de88c7b0..bcfed59d9e 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -286,7 +287,7 @@ public void As_UnitSystem_ReturnsValueInDimensionlessUnit()
var quantity = new Angle(value: 1, unit: AngleUnit.Radian);
var convertedValue = quantity.As(UnitSystem.SI);
-
+
Assert.Equal(quantity.Value, convertedValue);
}
@@ -332,7 +333,7 @@ public void ToUnitSystem_ReturnsValueInDimensionlessUnit()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Angle(value: 1, unit: Angle.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1362,7 +1363,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AngleUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs
index d98d7d9414..fa040d02b6 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new AreaDensity(value: 1, unit: AreaDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -645,7 +646,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AreaDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs
index a0589f34c2..26d34f6008 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -267,7 +268,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -275,7 +276,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -283,7 +284,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new AreaMomentOfInertia(value: 1, unit: AreaMomentOfInertia.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -720,7 +721,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AreaMomentOfInertiaUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs
index 040e06fcac..5310df716b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -347,7 +348,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -355,7 +356,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -363,7 +364,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Area(value: 1, unit: Area.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1429,7 +1430,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(AreaUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs
index 9063e7d0fa..8ba827d90b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -597,7 +598,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -605,7 +606,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -613,7 +614,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new BitRate(value: 1, unit: BitRate.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -2049,7 +2050,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(BitRateUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs
index 2f766a9ec5..f942d60aad 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new BrakeSpecificFuelConsumption(value: 1, unit: BrakeSpecificFuelConsumption.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -624,7 +625,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(BrakeSpecificFuelConsumptionUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs
index 83b6a28a6c..4c2f7095b8 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -267,7 +268,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -275,7 +276,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -283,7 +284,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new CoefficientOfThermalExpansion(value: 1, unit: CoefficientOfThermalExpansion.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -720,7 +721,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(CoefficientOfThermalExpansionUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs
index 5421a37f7d..908cc3554e 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -277,7 +278,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -285,7 +286,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -293,7 +294,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Compressibility(value: 1, unit: Compressibility.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -899,7 +900,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(CompressibilityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs
index b2abef6f0f..2b7e98d2f9 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -767,7 +768,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -775,7 +776,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -783,7 +784,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Density(value: 1, unit: Density.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -2514,7 +2515,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(DensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs
index 4af2534b2f..88c6cc3c22 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -407,7 +408,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -415,7 +416,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -423,7 +424,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new DoseAreaProduct(value: 1, unit: DoseAreaProduct.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1508,7 +1509,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(DoseAreaProductUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs
index 0d995447c0..1ca0602492 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -327,7 +328,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -335,7 +336,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -343,7 +344,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Duration(value: 1, unit: Duration.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1877,7 +1878,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(DurationUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs
index f4f9260cb7..89a14e68af 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -307,7 +308,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -315,7 +316,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -323,7 +324,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new DynamicViscosity(value: 1, unit: DynamicViscosity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -911,7 +912,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(DynamicViscosityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs
index 930e787458..a57d9f70c4 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -367,7 +368,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -375,7 +376,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -383,7 +384,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricAdmittance(value: 1, unit: ElectricAdmittance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1016,7 +1017,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricAdmittanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs
index edb4ddefc1..87c904a717 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricApparentEnergy(value: 1, unit: ElectricApparentEnergy.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -624,7 +625,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricApparentEnergyUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs
index eab8ab5ac1..3f598c575b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -267,7 +268,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -275,7 +276,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -283,7 +284,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricApparentPower(value: 1, unit: ElectricApparentPower.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -708,7 +709,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricApparentPowerUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs
index 5e36873363..4efe779121 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -277,7 +278,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -285,7 +286,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -293,7 +294,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricCapacitance(value: 1, unit: ElectricCapacitance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -740,7 +741,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricCapacitanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs
index e646150fe1..a3a7e0100d 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -217,7 +218,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -225,7 +226,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -233,7 +234,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricChargeDensity(value: 1, unit: ElectricChargeDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -559,7 +560,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricChargeDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs
index 4dd96c0e1d..d72ab80210 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -317,7 +318,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -325,7 +326,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -333,7 +334,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricCharge(value: 1, unit: ElectricCharge.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -928,7 +929,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricChargeUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs
index 430db4201c..3e9077ade2 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -367,7 +368,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -375,7 +376,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -383,7 +384,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricConductance(value: 1, unit: ElectricConductance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1016,7 +1017,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricConductanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs
index 3070d32283..c8622aed2b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -267,7 +268,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -275,7 +276,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -283,7 +284,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricConductivity(value: 1, unit: ElectricConductivity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -720,7 +721,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricConductivityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs
index f3dc1f8131..5c78055630 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricCurrentDensity(value: 1, unit: ElectricCurrentDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -624,7 +625,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricCurrentDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs
index 5a28952e40..b0c0f9375f 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -277,7 +278,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -285,7 +286,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -293,7 +294,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricCurrentGradient(value: 1, unit: ElectricCurrentGradient.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -752,7 +753,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricCurrentGradientUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs
index dcab219ec5..236a9465b3 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -297,7 +298,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -305,7 +306,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -313,7 +314,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricCurrent(value: 1, unit: ElectricCurrent.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -804,7 +805,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricCurrentUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs
index 8c72f0c083..7e5904e6d2 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -217,7 +218,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -225,7 +226,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -233,7 +234,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricField(value: 1, unit: ElectricField.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -559,7 +560,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricFieldUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs
index 1f93d38d3f..607df9aab4 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -287,7 +288,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -295,7 +296,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -303,7 +304,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricImpedance(value: 1, unit: ElectricImpedance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -772,7 +773,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricImpedanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs
index 1d4d90304c..d7cc181769 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -257,7 +258,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -265,7 +266,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -273,7 +274,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricInductance(value: 1, unit: ElectricInductance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -688,7 +689,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricInductanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs
index c4fc663776..7bf3fb3f83 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -407,7 +408,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -415,7 +416,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -423,7 +424,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricPotentialChangeRate(value: 1, unit: ElectricPotentialChangeRate.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1120,7 +1121,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricPotentialChangeRateUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs
index c8fd56395d..ef0d89b3ed 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -267,7 +268,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -275,7 +276,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -283,7 +284,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricPotential(value: 1, unit: ElectricPotential.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -798,7 +799,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricPotentialUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs
index bb6050424c..bbc3b10dc1 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -287,7 +288,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -295,7 +296,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -303,7 +304,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricReactance(value: 1, unit: ElectricReactance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -772,7 +773,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricReactanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs
index e7f7a81569..017c48d8dc 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricReactiveEnergy(value: 1, unit: ElectricReactiveEnergy.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -624,7 +625,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricReactiveEnergyUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs
index 1898a607fb..40054f2d06 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -247,7 +248,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -255,7 +256,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -263,7 +264,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricReactivePower(value: 1, unit: ElectricReactivePower.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -656,7 +657,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricReactivePowerUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
index 01926457f7..fc7ccefe13 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -287,7 +288,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -295,7 +296,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -303,7 +304,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricResistance(value: 1, unit: ElectricResistance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -772,7 +773,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricResistanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs
index 7dfc3ba1e1..01603502bc 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -347,7 +348,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -355,7 +356,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -363,7 +364,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricResistivity(value: 1, unit: ElectricResistivity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -952,7 +953,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricResistivityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs
index 0b5989bb2c..b2a583a7f1 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricSurfaceChargeDensity(value: 1, unit: ElectricSurfaceChargeDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -624,7 +625,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricSurfaceChargeDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs
index 63651a7adf..65962ee054 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -367,7 +368,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -375,7 +376,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -383,7 +384,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ElectricSusceptance(value: 1, unit: ElectricSusceptance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1016,7 +1017,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ElectricSusceptanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs
index 81cbe0c958..8261210ae6 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -327,7 +328,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -335,7 +336,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -343,7 +344,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new EnergyDensity(value: 1, unit: EnergyDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -912,7 +913,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(EnergyDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs
index 5c0848d361..48726fb2b9 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -607,7 +608,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -615,7 +616,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -623,7 +624,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Energy(value: 1, unit: Energy.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -2153,7 +2154,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(EnergyUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs
index 942c3472f0..efca5803b8 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -277,7 +278,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -285,7 +286,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -293,7 +294,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Entropy(value: 1, unit: Entropy.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -752,7 +753,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(EntropyUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs
index 6fc493ffa0..1890acfa44 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -397,7 +398,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -405,7 +406,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -413,7 +414,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new FluidResistance(value: 1, unit: FluidResistance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1535,7 +1536,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(FluidResistanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs
index 620e8e5c2b..3ef8bf2a55 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -357,7 +358,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -365,7 +366,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -373,7 +374,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ForceChangeRate(value: 1, unit: ForceChangeRate.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1092,7 +1093,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ForceChangeRateUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs
index f3f3ace69a..5c6769e0ec 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -587,7 +588,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -595,7 +596,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -603,7 +604,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new ForcePerLength(value: 1, unit: ForcePerLength.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1894,7 +1895,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ForcePerLengthUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs
index 1b851903be..a8d2defdb9 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -357,7 +358,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -365,7 +366,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -373,7 +374,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Force(value: 1, unit: Force.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1338,7 +1339,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ForceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs
index c29c0bc8f4..ab7fcc60e0 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -327,7 +328,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -335,7 +336,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -343,7 +344,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Frequency(value: 1, unit: Frequency.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1041,7 +1042,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(FrequencyUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs
index 674b348b4d..962b3dfef8 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -247,7 +248,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -255,7 +256,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -263,7 +264,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new FuelEfficiency(value: 1, unit: FuelEfficiency.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -656,7 +657,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(FuelEfficiencyUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs
index 19644db7e1..6629aabb0a 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -387,7 +388,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -395,7 +396,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -403,7 +404,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new HeatFlux(value: 1, unit: HeatFlux.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1125,7 +1126,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(HeatFluxUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs
index ec830a89cb..e4220ccd10 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -257,7 +258,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -265,7 +266,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -273,7 +274,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new HeatTransferCoefficient(value: 1, unit: HeatTransferCoefficient.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -877,7 +878,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(HeatTransferCoefficientUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs
index 4c48288af0..113ac11b57 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -247,7 +248,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -255,7 +256,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -263,7 +264,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Illuminance(value: 1, unit: Illuminance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -644,7 +645,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(IlluminanceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs
index c3cb7c0ac0..9094d87865 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -337,7 +338,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -345,7 +346,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -353,7 +354,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Impulse(value: 1, unit: Impulse.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -932,7 +933,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(ImpulseUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs
index b9d4033225..abb2d89005 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -526,7 +527,7 @@ public void As_UnitSystem_ReturnsValueInDimensionlessUnit()
var quantity = new Information(value: 1, unit: InformationUnit.Bit);
var convertedValue = quantity.As(UnitSystem.SI);
-
+
Assert.Equal(quantity.Value, convertedValue);
}
@@ -572,7 +573,7 @@ public void ToUnitSystem_ReturnsValueInDimensionlessUnit()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Information(value: 1, unit: Information.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1560,7 +1561,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(InformationUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs
index 4d83f72100..fe213c11f9 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -347,7 +348,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -355,7 +356,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -363,7 +364,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Irradiance(value: 1, unit: Irradiance.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -952,7 +953,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(IrradianceUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs
index edb74a3ab9..496087b08b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -297,7 +298,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -305,7 +306,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -313,7 +314,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Irradiation(value: 1, unit: Irradiation.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -816,7 +817,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(IrradiationUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs
index 96692af73c..87ac7334e2 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -317,7 +318,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -325,7 +326,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -333,7 +334,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Jerk(value: 1, unit: Jerk.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1067,7 +1068,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(JerkUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs
index 00c7b1eb0e..a8fb66b4a8 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -297,7 +298,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -305,7 +306,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -313,7 +314,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new KinematicViscosity(value: 1, unit: KinematicViscosity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -952,7 +953,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(KinematicViscosityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs
index 637fe4e754..d1a3794946 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -237,7 +238,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -245,7 +246,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -253,7 +254,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new LeakRate(value: 1, unit: LeakRate.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -624,7 +625,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(LeakRateUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs
index 3421251e86..1a6be98df8 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -627,7 +628,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -635,7 +636,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -643,7 +644,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Length(value: 1, unit: Length.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -2694,7 +2695,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(LengthUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs
index 2fdb75ab65..d0391af004 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -156,7 +157,7 @@ public void As_UnitSystem_ReturnsValueInDimensionlessUnit()
var quantity = new Level(value: 1, unit: LevelUnit.Decibel);
var convertedValue = quantity.As(UnitSystem.SI);
-
+
Assert.Equal(quantity.Value, convertedValue);
}
@@ -202,7 +203,7 @@ public void ToUnitSystem_ReturnsValueInDimensionlessUnit()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new Level(value: 1, unit: Level.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -536,7 +537,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(LevelUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs
index ba684bfcad..ff61391b11 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -387,7 +388,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -395,7 +396,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -403,7 +404,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new LinearDensity(value: 1, unit: LinearDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1104,7 +1105,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(LinearDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs
index 9f8d726645..f7a2b24282 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -457,7 +458,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
}, () =>
{
IQuantity quantityToConvert = quantity;
@@ -465,7 +466,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity convertedQuantity = quantityToConvert.ToUnit(UnitSystem.SI);
Assert.Equal(expectedUnit, convertedQuantity.Unit);
- Assert.Equal(expectedValue, convertedQuantity.Value);
+ Assert.Equal(expectedValue, convertedQuantity.Value);
});
}
@@ -473,7 +474,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
public void ToUnit_UnitSystem_ThrowsArgumentNullExceptionIfNull()
{
UnitSystem nullUnitSystem = null!;
- Assert.Multiple(() =>
+ Assert.Multiple(() =>
{
var quantity = new LinearPowerDensity(value: 1, unit: LinearPowerDensity.BaseUnit);
Assert.Throws(() => quantity.ToUnit(nullUnitSystem));
@@ -1268,7 +1269,7 @@ public void EqualsReturnsFalseOnNull()
[Fact]
public void HasAtLeastOneAbbreviationSpecified()
{
- var units = Enum.GetValues(typeof(LinearPowerDensityUnit)).Cast();
+ var units = EnumHelpers.GetValues();
foreach (var unit in units)
{
var defaultAbbreviation = UnitsNetSetup.Default.UnitAbbreviations.GetDefaultAbbreviation(unit);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs
index cbc32fbaa1..beb3ada71e 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs
@@ -22,6 +22,7 @@
using System.Globalization;
using System.Linq;
using System.Threading;
+using UnitsNet.InternalHelpers;
using UnitsNet.Tests.Helpers;
using UnitsNet.Tests.TestsBase;
using UnitsNet.Units;
@@ -307,7 +308,7 @@ public virtual void ToUnit_UnitSystem_SI_ReturnsQuantityInSIUnits()
IQuantity