diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
index 2875f84eff..38504033e5 100644
--- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
+++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
@@ -211,10 +211,7 @@ private void GenerateInstanceConstructors()
/// If value is NaN or Infinity.
public {_quantity.Name}({_quantity.ValueType} value, {_unitEnumName} unit)
{{");
- Writer.WL(_quantity.ValueType == "double"
- ? @"
- _value = Guard.EnsureValidNumber(value, nameof(value));"
- : @"
+ Writer.WL(@"
_value = value;");
Writer.WL($@"
_unit = unit;
@@ -236,10 +233,7 @@ private void GenerateInstanceConstructors()
var firstUnitInfo = unitInfos.FirstOrDefault();
");
- Writer.WL(_quantity.ValueType == "double"
- ? @"
- _value = Guard.EnsureValidNumber(value, nameof(value));"
- : @"
+ Writer.WL(@"
_value = value;");
Writer.WL($@"
_unit = firstUnitInfo?.Value ?? throw new ArgumentException(""No units were found for the given UnitSystem."", nameof(unitSystem));
diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs
index 02313ea6dd..1c39c9824f 100644
--- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs
+++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs
@@ -171,16 +171,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
");
if (_quantity.ValueType == "double") Writer.WL($@"
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{{
- Assert.Throws(() => new {_quantity.Name}(double.PositiveInfinity, {_baseUnitFullName}));
- Assert.Throws(() => new {_quantity.Name}(double.NegativeInfinity, {_baseUnitFullName}));
+ var exception1 = Record.Exception(() => new {_quantity.Name}(double.PositiveInfinity, {_baseUnitFullName}));
+ var exception2 = Record.Exception(() => new {_quantity.Name}(double.NegativeInfinity, {_baseUnitFullName}));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{{
- Assert.Throws(() => new {_quantity.Name}(double.NaN, {_baseUnitFullName}));
+ var exception = Record.Exception(() => new {_quantity.Name}(double.NaN, {_baseUnitFullName}));
+
+ Assert.Null(exception);
}}
"); Writer.WL($@"
@@ -248,16 +253,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
");
if (_quantity.ValueType == "double") Writer.WL($@"
[Fact]
- public void From{_baseUnit.PluralName}_WithInfinityValue_ThrowsArgumentException()
+ public void From{_baseUnit.PluralName}_WithInfinityValue_DoNotThrowsArgumentException()
{{
- Assert.Throws(() => {_quantity.Name}.From{_baseUnit.PluralName}(double.PositiveInfinity));
- Assert.Throws(() => {_quantity.Name}.From{_baseUnit.PluralName}(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => {_quantity.Name}.From{_baseUnit.PluralName}(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => {_quantity.Name}.From{_baseUnit.PluralName}(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}}
[Fact]
- public void From{_baseUnit.PluralName}_WithNanValue_ThrowsArgumentException()
+ public void From{_baseUnit.PluralName}_WithNanValue_DoNotThrowsArgumentException()
{{
- Assert.Throws(() => {_quantity.Name}.From{_baseUnit.PluralName}(double.NaN));
+ var exception = Record.Exception(() => {_quantity.Name}.From{_baseUnit.PluralName}(double.NaN));
+
+ Assert.Null(exception);
}}
"); Writer.WL($@"
diff --git a/Common/UnitDefinitions/Density.json b/Common/UnitDefinitions/Density.json
index 997c3c05a5..c0b6c4997e 100644
--- a/Common/UnitDefinitions/Density.json
+++ b/Common/UnitDefinitions/Density.json
@@ -197,7 +197,7 @@
},
{
"SingularName": "GramPerDeciliter",
- "PluralName": "GramsPerDeciLiter",
+ "PluralName": "GramsPerDeciliter",
"FromUnitToBaseFunc": "{x} / 1e-1",
"FromBaseToUnitFunc": "{x} * 1e-1",
"Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Centi", "Deci" ],
diff --git a/Common/UnitDefinitions/ElectricPotentialChangeRate.json b/Common/UnitDefinitions/ElectricPotentialChangeRate.json
index ed81c5aa1d..9e7a1916a8 100644
--- a/Common/UnitDefinitions/ElectricPotentialChangeRate.json
+++ b/Common/UnitDefinitions/ElectricPotentialChangeRate.json
@@ -11,7 +11,7 @@
"Units": [
{
"SingularName": "VoltPerSecond",
- "PluralName": "VoltsPerSeconds",
+ "PluralName": "VoltsPerSecond",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
@@ -30,7 +30,7 @@
},
{
"SingularName": "VoltPerMicrosecond",
- "PluralName": "VoltsPerMicroseconds",
+ "PluralName": "VoltsPerMicrosecond",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
@@ -49,7 +49,7 @@
},
{
"SingularName": "VoltPerMinute",
- "PluralName": "VoltsPerMinutes",
+ "PluralName": "VoltsPerMinute",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
@@ -68,7 +68,7 @@
},
{
"SingularName": "VoltPerHour",
- "PluralName": "VoltsPerHours",
+ "PluralName": "VoltsPerHour",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
diff --git a/Common/UnitDefinitions/FuelEfficiency.json b/Common/UnitDefinitions/FuelEfficiency.json
index d0a27ce366..a32e9cd959 100644
--- a/Common/UnitDefinitions/FuelEfficiency.json
+++ b/Common/UnitDefinitions/FuelEfficiency.json
@@ -41,7 +41,7 @@
},
{
"SingularName": "KilometerPerLiter",
- "PluralName": "KilometersPerLiters",
+ "PluralName": "KilometersPerLiter",
"FromUnitToBaseFunc": "100 / {x}",
"FromBaseToUnitFunc": "100 / {x}",
"Localization": [{
diff --git a/Common/UnitDefinitions/Speed.json b/Common/UnitDefinitions/Speed.json
index f17f8a321c..6a127121e5 100644
--- a/Common/UnitDefinitions/Speed.json
+++ b/Common/UnitDefinitions/Speed.json
@@ -30,7 +30,7 @@
},
{
"SingularName": "MeterPerMinute",
- "PluralName": "MetersPerMinutes",
+ "PluralName": "MetersPerMinute",
"BaseUnits": {
"L": "Meter",
"T": "Minute"
diff --git a/Common/UnitDefinitions/TemperatureGradient.json b/Common/UnitDefinitions/TemperatureGradient.json
index d0cf566fc1..d2c9d5f5bd 100644
--- a/Common/UnitDefinitions/TemperatureGradient.json
+++ b/Common/UnitDefinitions/TemperatureGradient.json
@@ -25,7 +25,7 @@
},
{
"SingularName": "DegreeCelsiusPerMeter",
- "PluralName": "DegreesCelciusPerMeter",
+ "PluralName": "DegreesCelsiusPerMeter",
"BaseUnits": {
"L": "Meter",
"Θ": "DegreeCelsius"
@@ -57,7 +57,7 @@
},
{
"SingularName": "DegreeCelsiusPerKilometer",
- "PluralName": "DegreesCelciusPerKilometer",
+ "PluralName": "DegreesCelsiusPerKilometer",
"BaseUnits": {
"L": "Kilometer",
"Θ": "DegreeCelsius"
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs
index 55431e6bab..7fc366dd8d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs
@@ -85,7 +85,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double CentigramsPerDeciLiter => As(DensityUnit.CentigramPerDeciliter);
+ public double CentigramsPerDeciliter => As(DensityUnit.CentigramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -100,7 +100,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double DecigramsPerDeciLiter => As(DensityUnit.DecigramPerDeciliter);
+ public double DecigramsPerDeciliter => As(DensityUnit.DecigramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -115,7 +115,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double FemtogramsPerDeciLiter => As(DensityUnit.FemtogramPerDeciliter);
+ public double FemtogramsPerDeciliter => As(DensityUnit.FemtogramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -155,7 +155,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double GramsPerDeciLiter => As(DensityUnit.GramPerDeciliter);
+ public double GramsPerDeciliter => As(DensityUnit.GramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -210,7 +210,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double MicrogramsPerDeciLiter => As(DensityUnit.MicrogramPerDeciliter);
+ public double MicrogramsPerDeciliter => As(DensityUnit.MicrogramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -230,7 +230,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double MilligramsPerDeciLiter => As(DensityUnit.MilligramPerDeciliter);
+ public double MilligramsPerDeciliter => As(DensityUnit.MilligramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -245,7 +245,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double NanogramsPerDeciLiter => As(DensityUnit.NanogramPerDeciliter);
+ public double NanogramsPerDeciliter => As(DensityUnit.NanogramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -260,7 +260,7 @@ public Density(double value, DensityUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double PicogramsPerDeciLiter => As(DensityUnit.PicogramPerDeciliter);
+ public double PicogramsPerDeciliter => As(DensityUnit.PicogramPerDeciliter);
///
/// Gets a value of this quantity converted into
@@ -370,7 +370,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromCentigramsPerDeciLiter(double centigramsperdeciliter) => new Density(centigramsperdeciliter, DensityUnit.CentigramPerDeciliter);
+ public static Density FromCentigramsPerDeciliter(double centigramsperdeciliter) => new Density(centigramsperdeciliter, DensityUnit.CentigramPerDeciliter);
///
/// Creates a from .
@@ -388,7 +388,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromDecigramsPerDeciLiter(double decigramsperdeciliter) => new Density(decigramsperdeciliter, DensityUnit.DecigramPerDeciliter);
+ public static Density FromDecigramsPerDeciliter(double decigramsperdeciliter) => new Density(decigramsperdeciliter, DensityUnit.DecigramPerDeciliter);
///
/// Creates a from .
@@ -406,7 +406,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromFemtogramsPerDeciLiter(double femtogramsperdeciliter) => new Density(femtogramsperdeciliter, DensityUnit.FemtogramPerDeciliter);
+ public static Density FromFemtogramsPerDeciliter(double femtogramsperdeciliter) => new Density(femtogramsperdeciliter, DensityUnit.FemtogramPerDeciliter);
///
/// Creates a from .
@@ -454,7 +454,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromGramsPerDeciLiter(double gramsperdeciliter) => new Density(gramsperdeciliter, DensityUnit.GramPerDeciliter);
+ public static Density FromGramsPerDeciliter(double gramsperdeciliter) => new Density(gramsperdeciliter, DensityUnit.GramPerDeciliter);
///
/// Creates a from .
@@ -520,7 +520,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromMicrogramsPerDeciLiter(double microgramsperdeciliter) => new Density(microgramsperdeciliter, DensityUnit.MicrogramPerDeciliter);
+ public static Density FromMicrogramsPerDeciliter(double microgramsperdeciliter) => new Density(microgramsperdeciliter, DensityUnit.MicrogramPerDeciliter);
///
/// Creates a from .
@@ -544,7 +544,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromMilligramsPerDeciLiter(double milligramsperdeciliter) => new Density(milligramsperdeciliter, DensityUnit.MilligramPerDeciliter);
+ public static Density FromMilligramsPerDeciliter(double milligramsperdeciliter) => new Density(milligramsperdeciliter, DensityUnit.MilligramPerDeciliter);
///
/// Creates a from .
@@ -562,7 +562,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromNanogramsPerDeciLiter(double nanogramsperdeciliter) => new Density(nanogramsperdeciliter, DensityUnit.NanogramPerDeciliter);
+ public static Density FromNanogramsPerDeciliter(double nanogramsperdeciliter) => new Density(nanogramsperdeciliter, DensityUnit.NanogramPerDeciliter);
///
/// Creates a from .
@@ -580,7 +580,7 @@ public Density(double value, DensityUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Density FromPicogramsPerDeciLiter(double picogramsperdeciliter) => new Density(picogramsperdeciliter, DensityUnit.PicogramPerDeciliter);
+ public static Density FromPicogramsPerDeciliter(double picogramsperdeciliter) => new Density(picogramsperdeciliter, DensityUnit.PicogramPerDeciliter);
///
/// Creates a from .
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
index 1ce4ce0ecc..75d8f1efe5 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
@@ -82,102 +82,102 @@ public ElectricPotentialChangeRate(double value, ElectricPotentialChangeRateUnit
///
/// Gets a value of this quantity converted into
///
- public double KilovoltsPerHours => As(ElectricPotentialChangeRateUnit.KilovoltPerHour);
+ public double KilovoltsPerHour => As(ElectricPotentialChangeRateUnit.KilovoltPerHour);
///
/// Gets a value of this quantity converted into
///
- public double KilovoltsPerMicroseconds => As(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond);
+ public double KilovoltsPerMicrosecond => As(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond);
///
/// Gets a value of this quantity converted into
///
- public double KilovoltsPerMinutes => As(ElectricPotentialChangeRateUnit.KilovoltPerMinute);
+ public double KilovoltsPerMinute => As(ElectricPotentialChangeRateUnit.KilovoltPerMinute);
///
/// Gets a value of this quantity converted into
///
- public double KilovoltsPerSeconds => As(ElectricPotentialChangeRateUnit.KilovoltPerSecond);
+ public double KilovoltsPerSecond => As(ElectricPotentialChangeRateUnit.KilovoltPerSecond);
///
/// Gets a value of this quantity converted into
///
- public double MegavoltsPerHours => As(ElectricPotentialChangeRateUnit.MegavoltPerHour);
+ public double MegavoltsPerHour => As(ElectricPotentialChangeRateUnit.MegavoltPerHour);
///
/// Gets a value of this quantity converted into
///
- public double MegavoltsPerMicroseconds => As(ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond);
+ public double MegavoltsPerMicrosecond => As(ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond);
///
/// Gets a value of this quantity converted into
///
- public double MegavoltsPerMinutes => As(ElectricPotentialChangeRateUnit.MegavoltPerMinute);
+ public double MegavoltsPerMinute => As(ElectricPotentialChangeRateUnit.MegavoltPerMinute);
///
/// Gets a value of this quantity converted into
///
- public double MegavoltsPerSeconds => As(ElectricPotentialChangeRateUnit.MegavoltPerSecond);
+ public double MegavoltsPerSecond => As(ElectricPotentialChangeRateUnit.MegavoltPerSecond);
///
/// Gets a value of this quantity converted into
///
- public double MicrovoltsPerHours => As(ElectricPotentialChangeRateUnit.MicrovoltPerHour);
+ public double MicrovoltsPerHour => As(ElectricPotentialChangeRateUnit.MicrovoltPerHour);
///
/// Gets a value of this quantity converted into
///
- public double MicrovoltsPerMicroseconds => As(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond);
+ public double MicrovoltsPerMicrosecond => As(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond);
///
/// Gets a value of this quantity converted into
///
- public double MicrovoltsPerMinutes => As(ElectricPotentialChangeRateUnit.MicrovoltPerMinute);
+ public double MicrovoltsPerMinute => As(ElectricPotentialChangeRateUnit.MicrovoltPerMinute);
///
/// Gets a value of this quantity converted into
///
- public double MicrovoltsPerSeconds => As(ElectricPotentialChangeRateUnit.MicrovoltPerSecond);
+ public double MicrovoltsPerSecond => As(ElectricPotentialChangeRateUnit.MicrovoltPerSecond);
///
/// Gets a value of this quantity converted into
///
- public double MillivoltsPerHours => As(ElectricPotentialChangeRateUnit.MillivoltPerHour);
+ public double MillivoltsPerHour => As(ElectricPotentialChangeRateUnit.MillivoltPerHour);
///
/// Gets a value of this quantity converted into
///
- public double MillivoltsPerMicroseconds => As(ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond);
+ public double MillivoltsPerMicrosecond => As(ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond);
///
/// Gets a value of this quantity converted into
///
- public double MillivoltsPerMinutes => As(ElectricPotentialChangeRateUnit.MillivoltPerMinute);
+ public double MillivoltsPerMinute => As(ElectricPotentialChangeRateUnit.MillivoltPerMinute);
///
/// Gets a value of this quantity converted into
///
- public double MillivoltsPerSeconds => As(ElectricPotentialChangeRateUnit.MillivoltPerSecond);
+ public double MillivoltsPerSecond => As(ElectricPotentialChangeRateUnit.MillivoltPerSecond);
///
/// Gets a value of this quantity converted into
///
- public double VoltsPerHours => As(ElectricPotentialChangeRateUnit.VoltPerHour);
+ public double VoltsPerHour => As(ElectricPotentialChangeRateUnit.VoltPerHour);
///
/// Gets a value of this quantity converted into
///
- public double VoltsPerMicroseconds => As(ElectricPotentialChangeRateUnit.VoltPerMicrosecond);
+ public double VoltsPerMicrosecond => As(ElectricPotentialChangeRateUnit.VoltPerMicrosecond);
///
/// Gets a value of this quantity converted into
///
- public double VoltsPerMinutes => As(ElectricPotentialChangeRateUnit.VoltPerMinute);
+ public double VoltsPerMinute => As(ElectricPotentialChangeRateUnit.VoltPerMinute);
///
/// Gets a value of this quantity converted into
///
- public double VoltsPerSeconds => As(ElectricPotentialChangeRateUnit.VoltPerSecond);
+ public double VoltsPerSecond => As(ElectricPotentialChangeRateUnit.VoltPerSecond);
#endregion
@@ -187,121 +187,121 @@ public ElectricPotentialChangeRate(double value, ElectricPotentialChangeRateUnit
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromKilovoltsPerHours(double kilovoltsperhours) => new ElectricPotentialChangeRate(kilovoltsperhours, ElectricPotentialChangeRateUnit.KilovoltPerHour);
+ public static ElectricPotentialChangeRate FromKilovoltsPerHour(double kilovoltsperhour) => new ElectricPotentialChangeRate(kilovoltsperhour, ElectricPotentialChangeRateUnit.KilovoltPerHour);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromKilovoltsPerMicroseconds(double kilovoltspermicroseconds) => new ElectricPotentialChangeRate(kilovoltspermicroseconds, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond);
+ public static ElectricPotentialChangeRate FromKilovoltsPerMicrosecond(double kilovoltspermicrosecond) => new ElectricPotentialChangeRate(kilovoltspermicrosecond, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromKilovoltsPerMinutes(double kilovoltsperminutes) => new ElectricPotentialChangeRate(kilovoltsperminutes, ElectricPotentialChangeRateUnit.KilovoltPerMinute);
+ public static ElectricPotentialChangeRate FromKilovoltsPerMinute(double kilovoltsperminute) => new ElectricPotentialChangeRate(kilovoltsperminute, ElectricPotentialChangeRateUnit.KilovoltPerMinute);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromKilovoltsPerSeconds(double kilovoltsperseconds) => new ElectricPotentialChangeRate(kilovoltsperseconds, ElectricPotentialChangeRateUnit.KilovoltPerSecond);
+ public static ElectricPotentialChangeRate FromKilovoltsPerSecond(double kilovoltspersecond) => new ElectricPotentialChangeRate(kilovoltspersecond, ElectricPotentialChangeRateUnit.KilovoltPerSecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMegavoltsPerHours(double megavoltsperhours) => new ElectricPotentialChangeRate(megavoltsperhours, ElectricPotentialChangeRateUnit.MegavoltPerHour);
+ public static ElectricPotentialChangeRate FromMegavoltsPerHour(double megavoltsperhour) => new ElectricPotentialChangeRate(megavoltsperhour, ElectricPotentialChangeRateUnit.MegavoltPerHour);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMegavoltsPerMicroseconds(double megavoltspermicroseconds) => new ElectricPotentialChangeRate(megavoltspermicroseconds, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond);
+ public static ElectricPotentialChangeRate FromMegavoltsPerMicrosecond(double megavoltspermicrosecond) => new ElectricPotentialChangeRate(megavoltspermicrosecond, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMegavoltsPerMinutes(double megavoltsperminutes) => new ElectricPotentialChangeRate(megavoltsperminutes, ElectricPotentialChangeRateUnit.MegavoltPerMinute);
+ public static ElectricPotentialChangeRate FromMegavoltsPerMinute(double megavoltsperminute) => new ElectricPotentialChangeRate(megavoltsperminute, ElectricPotentialChangeRateUnit.MegavoltPerMinute);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMegavoltsPerSeconds(double megavoltsperseconds) => new ElectricPotentialChangeRate(megavoltsperseconds, ElectricPotentialChangeRateUnit.MegavoltPerSecond);
+ public static ElectricPotentialChangeRate FromMegavoltsPerSecond(double megavoltspersecond) => new ElectricPotentialChangeRate(megavoltspersecond, ElectricPotentialChangeRateUnit.MegavoltPerSecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMicrovoltsPerHours(double microvoltsperhours) => new ElectricPotentialChangeRate(microvoltsperhours, ElectricPotentialChangeRateUnit.MicrovoltPerHour);
+ public static ElectricPotentialChangeRate FromMicrovoltsPerHour(double microvoltsperhour) => new ElectricPotentialChangeRate(microvoltsperhour, ElectricPotentialChangeRateUnit.MicrovoltPerHour);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMicrovoltsPerMicroseconds(double microvoltspermicroseconds) => new ElectricPotentialChangeRate(microvoltspermicroseconds, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond);
+ public static ElectricPotentialChangeRate FromMicrovoltsPerMicrosecond(double microvoltspermicrosecond) => new ElectricPotentialChangeRate(microvoltspermicrosecond, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMicrovoltsPerMinutes(double microvoltsperminutes) => new ElectricPotentialChangeRate(microvoltsperminutes, ElectricPotentialChangeRateUnit.MicrovoltPerMinute);
+ public static ElectricPotentialChangeRate FromMicrovoltsPerMinute(double microvoltsperminute) => new ElectricPotentialChangeRate(microvoltsperminute, ElectricPotentialChangeRateUnit.MicrovoltPerMinute);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMicrovoltsPerSeconds(double microvoltsperseconds) => new ElectricPotentialChangeRate(microvoltsperseconds, ElectricPotentialChangeRateUnit.MicrovoltPerSecond);
+ public static ElectricPotentialChangeRate FromMicrovoltsPerSecond(double microvoltspersecond) => new ElectricPotentialChangeRate(microvoltspersecond, ElectricPotentialChangeRateUnit.MicrovoltPerSecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMillivoltsPerHours(double millivoltsperhours) => new ElectricPotentialChangeRate(millivoltsperhours, ElectricPotentialChangeRateUnit.MillivoltPerHour);
+ public static ElectricPotentialChangeRate FromMillivoltsPerHour(double millivoltsperhour) => new ElectricPotentialChangeRate(millivoltsperhour, ElectricPotentialChangeRateUnit.MillivoltPerHour);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMillivoltsPerMicroseconds(double millivoltspermicroseconds) => new ElectricPotentialChangeRate(millivoltspermicroseconds, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond);
+ public static ElectricPotentialChangeRate FromMillivoltsPerMicrosecond(double millivoltspermicrosecond) => new ElectricPotentialChangeRate(millivoltspermicrosecond, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMillivoltsPerMinutes(double millivoltsperminutes) => new ElectricPotentialChangeRate(millivoltsperminutes, ElectricPotentialChangeRateUnit.MillivoltPerMinute);
+ public static ElectricPotentialChangeRate FromMillivoltsPerMinute(double millivoltsperminute) => new ElectricPotentialChangeRate(millivoltsperminute, ElectricPotentialChangeRateUnit.MillivoltPerMinute);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromMillivoltsPerSeconds(double millivoltsperseconds) => new ElectricPotentialChangeRate(millivoltsperseconds, ElectricPotentialChangeRateUnit.MillivoltPerSecond);
+ public static ElectricPotentialChangeRate FromMillivoltsPerSecond(double millivoltspersecond) => new ElectricPotentialChangeRate(millivoltspersecond, ElectricPotentialChangeRateUnit.MillivoltPerSecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromVoltsPerHours(double voltsperhours) => new ElectricPotentialChangeRate(voltsperhours, ElectricPotentialChangeRateUnit.VoltPerHour);
+ public static ElectricPotentialChangeRate FromVoltsPerHour(double voltsperhour) => new ElectricPotentialChangeRate(voltsperhour, ElectricPotentialChangeRateUnit.VoltPerHour);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromVoltsPerMicroseconds(double voltspermicroseconds) => new ElectricPotentialChangeRate(voltspermicroseconds, ElectricPotentialChangeRateUnit.VoltPerMicrosecond);
+ public static ElectricPotentialChangeRate FromVoltsPerMicrosecond(double voltspermicrosecond) => new ElectricPotentialChangeRate(voltspermicrosecond, ElectricPotentialChangeRateUnit.VoltPerMicrosecond);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromVoltsPerMinutes(double voltsperminutes) => new ElectricPotentialChangeRate(voltsperminutes, ElectricPotentialChangeRateUnit.VoltPerMinute);
+ public static ElectricPotentialChangeRate FromVoltsPerMinute(double voltsperminute) => new ElectricPotentialChangeRate(voltsperminute, ElectricPotentialChangeRateUnit.VoltPerMinute);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static ElectricPotentialChangeRate FromVoltsPerSeconds(double voltsperseconds) => new ElectricPotentialChangeRate(voltsperseconds, ElectricPotentialChangeRateUnit.VoltPerSecond);
+ public static ElectricPotentialChangeRate FromVoltsPerSecond(double voltspersecond) => new ElectricPotentialChangeRate(voltspersecond, ElectricPotentialChangeRateUnit.VoltPerSecond);
///
/// Dynamically convert from value and unit enum to .
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs
index e1ff33660e..381e3e29c1 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs
@@ -85,7 +85,7 @@ public FuelEfficiency(double value, FuelEfficiencyUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double KilometersPerLiters => As(FuelEfficiencyUnit.KilometerPerLiter);
+ public double KilometersPerLiter => As(FuelEfficiencyUnit.KilometerPerLiter);
///
/// Gets a value of this quantity converted into
@@ -110,7 +110,7 @@ public FuelEfficiency(double value, FuelEfficiencyUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static FuelEfficiency FromKilometersPerLiters(double kilometersperliters) => new FuelEfficiency(kilometersperliters, FuelEfficiencyUnit.KilometerPerLiter);
+ public static FuelEfficiency FromKilometersPerLiter(double kilometersperliter) => new FuelEfficiency(kilometersperliter, FuelEfficiencyUnit.KilometerPerLiter);
///
/// Creates a from .
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs
index 6dc39a4e37..b8ebe48855 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs
@@ -87,7 +87,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double CentimetersPerMinutes => As(SpeedUnit.CentimeterPerMinute);
+ public double CentimetersPerMinute => As(SpeedUnit.CentimeterPerMinute);
///
/// Gets a value of this quantity converted into
@@ -97,7 +97,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double DecimetersPerMinutes => As(SpeedUnit.DecimeterPerMinute);
+ public double DecimetersPerMinute => As(SpeedUnit.DecimeterPerMinute);
///
/// Gets a value of this quantity converted into
@@ -142,7 +142,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double KilometersPerMinutes => As(SpeedUnit.KilometerPerMinute);
+ public double KilometersPerMinute => As(SpeedUnit.KilometerPerMinute);
///
/// Gets a value of this quantity converted into
@@ -167,7 +167,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double MetersPerMinutes => As(SpeedUnit.MeterPerMinute);
+ public double MetersPerMinute => As(SpeedUnit.MeterPerMinute);
///
/// Gets a value of this quantity converted into
@@ -177,7 +177,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double MicrometersPerMinutes => As(SpeedUnit.MicrometerPerMinute);
+ public double MicrometersPerMinute => As(SpeedUnit.MicrometerPerMinute);
///
/// Gets a value of this quantity converted into
@@ -197,7 +197,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double MillimetersPerMinutes => As(SpeedUnit.MillimeterPerMinute);
+ public double MillimetersPerMinute => As(SpeedUnit.MillimeterPerMinute);
///
/// Gets a value of this quantity converted into
@@ -207,7 +207,7 @@ public Speed(double value, SpeedUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double NanometersPerMinutes => As(SpeedUnit.NanometerPerMinute);
+ public double NanometersPerMinute => As(SpeedUnit.NanometerPerMinute);
///
/// Gets a value of this quantity converted into
@@ -258,7 +258,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromCentimetersPerMinutes(double centimetersperminutes) => new Speed(centimetersperminutes, SpeedUnit.CentimeterPerMinute);
+ public static Speed FromCentimetersPerMinute(double centimetersperminute) => new Speed(centimetersperminute, SpeedUnit.CentimeterPerMinute);
///
/// Creates a from .
@@ -270,7 +270,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromDecimetersPerMinutes(double decimetersperminutes) => new Speed(decimetersperminutes, SpeedUnit.DecimeterPerMinute);
+ public static Speed FromDecimetersPerMinute(double decimetersperminute) => new Speed(decimetersperminute, SpeedUnit.DecimeterPerMinute);
///
/// Creates a from .
@@ -324,7 +324,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromKilometersPerMinutes(double kilometersperminutes) => new Speed(kilometersperminutes, SpeedUnit.KilometerPerMinute);
+ public static Speed FromKilometersPerMinute(double kilometersperminute) => new Speed(kilometersperminute, SpeedUnit.KilometerPerMinute);
///
/// Creates a from .
@@ -354,7 +354,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromMetersPerMinutes(double metersperminutes) => new Speed(metersperminutes, SpeedUnit.MeterPerMinute);
+ public static Speed FromMetersPerMinute(double metersperminute) => new Speed(metersperminute, SpeedUnit.MeterPerMinute);
///
/// Creates a from .
@@ -366,7 +366,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromMicrometersPerMinutes(double micrometersperminutes) => new Speed(micrometersperminutes, SpeedUnit.MicrometerPerMinute);
+ public static Speed FromMicrometersPerMinute(double micrometersperminute) => new Speed(micrometersperminute, SpeedUnit.MicrometerPerMinute);
///
/// Creates a from .
@@ -390,7 +390,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromMillimetersPerMinutes(double millimetersperminutes) => new Speed(millimetersperminutes, SpeedUnit.MillimeterPerMinute);
+ public static Speed FromMillimetersPerMinute(double millimetersperminute) => new Speed(millimetersperminute, SpeedUnit.MillimeterPerMinute);
///
/// Creates a from .
@@ -402,7 +402,7 @@ public Speed(double value, SpeedUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static Speed FromNanometersPerMinutes(double nanometersperminutes) => new Speed(nanometersperminutes, SpeedUnit.NanometerPerMinute);
+ public static Speed FromNanometersPerMinute(double nanometersperminute) => new Speed(nanometersperminute, SpeedUnit.NanometerPerMinute);
///
/// Creates a from .
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs
index 2f2283f3af..9946644fa7 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs
@@ -82,12 +82,12 @@ public TemperatureGradient(double value, TemperatureGradientUnit unit)
///
/// Gets a value of this quantity converted into
///
- public double DegreesCelciusPerKilometer => As(TemperatureGradientUnit.DegreeCelsiusPerKilometer);
+ public double DegreesCelsiusPerKilometer => As(TemperatureGradientUnit.DegreeCelsiusPerKilometer);
///
/// Gets a value of this quantity converted into
///
- public double DegreesCelciusPerMeter => As(TemperatureGradientUnit.DegreeCelsiusPerMeter);
+ public double DegreesCelsiusPerMeter => As(TemperatureGradientUnit.DegreeCelsiusPerMeter);
///
/// Gets a value of this quantity converted into
@@ -107,13 +107,13 @@ public TemperatureGradient(double value, TemperatureGradientUnit unit)
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static TemperatureGradient FromDegreesCelciusPerKilometer(double degreescelciusperkilometer) => new TemperatureGradient(degreescelciusperkilometer, TemperatureGradientUnit.DegreeCelsiusPerKilometer);
+ public static TemperatureGradient FromDegreesCelsiusPerKilometer(double degreescelsiusperkilometer) => new TemperatureGradient(degreescelsiusperkilometer, TemperatureGradientUnit.DegreeCelsiusPerKilometer);
///
/// Creates a from .
///
/// If value is NaN or Infinity.
- public static TemperatureGradient FromDegreesCelciusPerMeter(double degreescelciuspermeter) => new TemperatureGradient(degreescelciuspermeter, TemperatureGradientUnit.DegreeCelsiusPerMeter);
+ public static TemperatureGradient FromDegreesCelsiusPerMeter(double degreescelsiuspermeter) => new TemperatureGradient(degreescelsiuspermeter, TemperatureGradientUnit.DegreeCelsiusPerMeter);
///
/// Creates a from .
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToDensityExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToDensityExtensionsTest.g.cs
index f61c2cf329..4df840f2f8 100644
--- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToDensityExtensionsTest.g.cs
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToDensityExtensionsTest.g.cs
@@ -25,8 +25,8 @@ namespace UnitsNet.Tests
public class NumberToDensityExtensionsTests
{
[Fact]
- public void NumberToCentigramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromCentigramsPerDeciLiter(2), 2.CentigramsPerDeciLiter());
+ public void NumberToCentigramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromCentigramsPerDeciliter(2), 2.CentigramsPerDeciliter());
[Fact]
public void NumberToCentigramsPerLiterTest() =>
@@ -37,8 +37,8 @@ public void NumberToCentigramsPerMilliliterTest() =>
Assert.Equal(Density.FromCentigramsPerMilliliter(2), 2.CentigramsPerMilliliter());
[Fact]
- public void NumberToDecigramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromDecigramsPerDeciLiter(2), 2.DecigramsPerDeciLiter());
+ public void NumberToDecigramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromDecigramsPerDeciliter(2), 2.DecigramsPerDeciliter());
[Fact]
public void NumberToDecigramsPerLiterTest() =>
@@ -49,8 +49,8 @@ public void NumberToDecigramsPerMilliliterTest() =>
Assert.Equal(Density.FromDecigramsPerMilliliter(2), 2.DecigramsPerMilliliter());
[Fact]
- public void NumberToFemtogramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromFemtogramsPerDeciLiter(2), 2.FemtogramsPerDeciLiter());
+ public void NumberToFemtogramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromFemtogramsPerDeciliter(2), 2.FemtogramsPerDeciliter());
[Fact]
public void NumberToFemtogramsPerLiterTest() =>
@@ -81,8 +81,8 @@ public void NumberToGramsPerCubicMillimeterTest() =>
Assert.Equal(Density.FromGramsPerCubicMillimeter(2), 2.GramsPerCubicMillimeter());
[Fact]
- public void NumberToGramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromGramsPerDeciLiter(2), 2.GramsPerDeciLiter());
+ public void NumberToGramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromGramsPerDeciliter(2), 2.GramsPerDeciliter());
[Fact]
public void NumberToGramsPerLiterTest() =>
@@ -125,8 +125,8 @@ public void NumberToMicrogramsPerCubicMeterTest() =>
Assert.Equal(Density.FromMicrogramsPerCubicMeter(2), 2.MicrogramsPerCubicMeter());
[Fact]
- public void NumberToMicrogramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromMicrogramsPerDeciLiter(2), 2.MicrogramsPerDeciLiter());
+ public void NumberToMicrogramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromMicrogramsPerDeciliter(2), 2.MicrogramsPerDeciliter());
[Fact]
public void NumberToMicrogramsPerLiterTest() =>
@@ -141,8 +141,8 @@ public void NumberToMilligramsPerCubicMeterTest() =>
Assert.Equal(Density.FromMilligramsPerCubicMeter(2), 2.MilligramsPerCubicMeter());
[Fact]
- public void NumberToMilligramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromMilligramsPerDeciLiter(2), 2.MilligramsPerDeciLiter());
+ public void NumberToMilligramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromMilligramsPerDeciliter(2), 2.MilligramsPerDeciliter());
[Fact]
public void NumberToMilligramsPerLiterTest() =>
@@ -153,8 +153,8 @@ public void NumberToMilligramsPerMilliliterTest() =>
Assert.Equal(Density.FromMilligramsPerMilliliter(2), 2.MilligramsPerMilliliter());
[Fact]
- public void NumberToNanogramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromNanogramsPerDeciLiter(2), 2.NanogramsPerDeciLiter());
+ public void NumberToNanogramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromNanogramsPerDeciliter(2), 2.NanogramsPerDeciliter());
[Fact]
public void NumberToNanogramsPerLiterTest() =>
@@ -165,8 +165,8 @@ public void NumberToNanogramsPerMilliliterTest() =>
Assert.Equal(Density.FromNanogramsPerMilliliter(2), 2.NanogramsPerMilliliter());
[Fact]
- public void NumberToPicogramsPerDeciLiterTest() =>
- Assert.Equal(Density.FromPicogramsPerDeciLiter(2), 2.PicogramsPerDeciLiter());
+ public void NumberToPicogramsPerDeciliterTest() =>
+ Assert.Equal(Density.FromPicogramsPerDeciliter(2), 2.PicogramsPerDeciliter());
[Fact]
public void NumberToPicogramsPerLiterTest() =>
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToElectricPotentialChangeRateExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToElectricPotentialChangeRateExtensionsTest.g.cs
index da8acffcc6..dda5ae8b63 100644
--- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToElectricPotentialChangeRateExtensionsTest.g.cs
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToElectricPotentialChangeRateExtensionsTest.g.cs
@@ -25,84 +25,84 @@ namespace UnitsNet.Tests
public class NumberToElectricPotentialChangeRateExtensionsTests
{
[Fact]
- public void NumberToKilovoltsPerHoursTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerHours(2), 2.KilovoltsPerHours());
+ public void NumberToKilovoltsPerHourTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerHour(2), 2.KilovoltsPerHour());
[Fact]
- public void NumberToKilovoltsPerMicrosecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerMicroseconds(2), 2.KilovoltsPerMicroseconds());
+ public void NumberToKilovoltsPerMicrosecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerMicrosecond(2), 2.KilovoltsPerMicrosecond());
[Fact]
- public void NumberToKilovoltsPerMinutesTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerMinutes(2), 2.KilovoltsPerMinutes());
+ public void NumberToKilovoltsPerMinuteTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerMinute(2), 2.KilovoltsPerMinute());
[Fact]
- public void NumberToKilovoltsPerSecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerSeconds(2), 2.KilovoltsPerSeconds());
+ public void NumberToKilovoltsPerSecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromKilovoltsPerSecond(2), 2.KilovoltsPerSecond());
[Fact]
- public void NumberToMegavoltsPerHoursTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerHours(2), 2.MegavoltsPerHours());
+ public void NumberToMegavoltsPerHourTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerHour(2), 2.MegavoltsPerHour());
[Fact]
- public void NumberToMegavoltsPerMicrosecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerMicroseconds(2), 2.MegavoltsPerMicroseconds());
+ public void NumberToMegavoltsPerMicrosecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerMicrosecond(2), 2.MegavoltsPerMicrosecond());
[Fact]
- public void NumberToMegavoltsPerMinutesTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerMinutes(2), 2.MegavoltsPerMinutes());
+ public void NumberToMegavoltsPerMinuteTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerMinute(2), 2.MegavoltsPerMinute());
[Fact]
- public void NumberToMegavoltsPerSecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerSeconds(2), 2.MegavoltsPerSeconds());
+ public void NumberToMegavoltsPerSecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMegavoltsPerSecond(2), 2.MegavoltsPerSecond());
[Fact]
- public void NumberToMicrovoltsPerHoursTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerHours(2), 2.MicrovoltsPerHours());
+ public void NumberToMicrovoltsPerHourTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerHour(2), 2.MicrovoltsPerHour());
[Fact]
- public void NumberToMicrovoltsPerMicrosecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerMicroseconds(2), 2.MicrovoltsPerMicroseconds());
+ public void NumberToMicrovoltsPerMicrosecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerMicrosecond(2), 2.MicrovoltsPerMicrosecond());
[Fact]
- public void NumberToMicrovoltsPerMinutesTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerMinutes(2), 2.MicrovoltsPerMinutes());
+ public void NumberToMicrovoltsPerMinuteTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerMinute(2), 2.MicrovoltsPerMinute());
[Fact]
- public void NumberToMicrovoltsPerSecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerSeconds(2), 2.MicrovoltsPerSeconds());
+ public void NumberToMicrovoltsPerSecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMicrovoltsPerSecond(2), 2.MicrovoltsPerSecond());
[Fact]
- public void NumberToMillivoltsPerHoursTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerHours(2), 2.MillivoltsPerHours());
+ public void NumberToMillivoltsPerHourTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerHour(2), 2.MillivoltsPerHour());
[Fact]
- public void NumberToMillivoltsPerMicrosecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerMicroseconds(2), 2.MillivoltsPerMicroseconds());
+ public void NumberToMillivoltsPerMicrosecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerMicrosecond(2), 2.MillivoltsPerMicrosecond());
[Fact]
- public void NumberToMillivoltsPerMinutesTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerMinutes(2), 2.MillivoltsPerMinutes());
+ public void NumberToMillivoltsPerMinuteTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerMinute(2), 2.MillivoltsPerMinute());
[Fact]
- public void NumberToMillivoltsPerSecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerSeconds(2), 2.MillivoltsPerSeconds());
+ public void NumberToMillivoltsPerSecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromMillivoltsPerSecond(2), 2.MillivoltsPerSecond());
[Fact]
- public void NumberToVoltsPerHoursTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerHours(2), 2.VoltsPerHours());
+ public void NumberToVoltsPerHourTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerHour(2), 2.VoltsPerHour());
[Fact]
- public void NumberToVoltsPerMicrosecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerMicroseconds(2), 2.VoltsPerMicroseconds());
+ public void NumberToVoltsPerMicrosecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerMicrosecond(2), 2.VoltsPerMicrosecond());
[Fact]
- public void NumberToVoltsPerMinutesTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerMinutes(2), 2.VoltsPerMinutes());
+ public void NumberToVoltsPerMinuteTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerMinute(2), 2.VoltsPerMinute());
[Fact]
- public void NumberToVoltsPerSecondsTest() =>
- Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerSeconds(2), 2.VoltsPerSeconds());
+ public void NumberToVoltsPerSecondTest() =>
+ Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerSecond(2), 2.VoltsPerSecond());
}
}
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFuelEfficiencyExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFuelEfficiencyExtensionsTest.g.cs
index 1a82f80799..c721dbcb09 100644
--- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFuelEfficiencyExtensionsTest.g.cs
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFuelEfficiencyExtensionsTest.g.cs
@@ -25,8 +25,8 @@ namespace UnitsNet.Tests
public class NumberToFuelEfficiencyExtensionsTests
{
[Fact]
- public void NumberToKilometersPerLitersTest() =>
- Assert.Equal(FuelEfficiency.FromKilometersPerLiters(2), 2.KilometersPerLiters());
+ public void NumberToKilometersPerLiterTest() =>
+ Assert.Equal(FuelEfficiency.FromKilometersPerLiter(2), 2.KilometersPerLiter());
[Fact]
public void NumberToLitersPer100KilometersTest() =>
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpeedExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpeedExtensionsTest.g.cs
index 7ce9151a80..770b924b14 100644
--- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpeedExtensionsTest.g.cs
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpeedExtensionsTest.g.cs
@@ -29,16 +29,16 @@ public void NumberToCentimetersPerHourTest() =>
Assert.Equal(Speed.FromCentimetersPerHour(2), 2.CentimetersPerHour());
[Fact]
- public void NumberToCentimetersPerMinutesTest() =>
- Assert.Equal(Speed.FromCentimetersPerMinutes(2), 2.CentimetersPerMinutes());
+ public void NumberToCentimetersPerMinuteTest() =>
+ Assert.Equal(Speed.FromCentimetersPerMinute(2), 2.CentimetersPerMinute());
[Fact]
public void NumberToCentimetersPerSecondTest() =>
Assert.Equal(Speed.FromCentimetersPerSecond(2), 2.CentimetersPerSecond());
[Fact]
- public void NumberToDecimetersPerMinutesTest() =>
- Assert.Equal(Speed.FromDecimetersPerMinutes(2), 2.DecimetersPerMinutes());
+ public void NumberToDecimetersPerMinuteTest() =>
+ Assert.Equal(Speed.FromDecimetersPerMinute(2), 2.DecimetersPerMinute());
[Fact]
public void NumberToDecimetersPerSecondTest() =>
@@ -73,8 +73,8 @@ public void NumberToKilometersPerHourTest() =>
Assert.Equal(Speed.FromKilometersPerHour(2), 2.KilometersPerHour());
[Fact]
- public void NumberToKilometersPerMinutesTest() =>
- Assert.Equal(Speed.FromKilometersPerMinutes(2), 2.KilometersPerMinutes());
+ public void NumberToKilometersPerMinuteTest() =>
+ Assert.Equal(Speed.FromKilometersPerMinute(2), 2.KilometersPerMinute());
[Fact]
public void NumberToKilometersPerSecondTest() =>
@@ -93,16 +93,16 @@ public void NumberToMetersPerHourTest() =>
Assert.Equal(Speed.FromMetersPerHour(2), 2.MetersPerHour());
[Fact]
- public void NumberToMetersPerMinutesTest() =>
- Assert.Equal(Speed.FromMetersPerMinutes(2), 2.MetersPerMinutes());
+ public void NumberToMetersPerMinuteTest() =>
+ Assert.Equal(Speed.FromMetersPerMinute(2), 2.MetersPerMinute());
[Fact]
public void NumberToMetersPerSecondTest() =>
Assert.Equal(Speed.FromMetersPerSecond(2), 2.MetersPerSecond());
[Fact]
- public void NumberToMicrometersPerMinutesTest() =>
- Assert.Equal(Speed.FromMicrometersPerMinutes(2), 2.MicrometersPerMinutes());
+ public void NumberToMicrometersPerMinuteTest() =>
+ Assert.Equal(Speed.FromMicrometersPerMinute(2), 2.MicrometersPerMinute());
[Fact]
public void NumberToMicrometersPerSecondTest() =>
@@ -117,16 +117,16 @@ public void NumberToMillimetersPerHourTest() =>
Assert.Equal(Speed.FromMillimetersPerHour(2), 2.MillimetersPerHour());
[Fact]
- public void NumberToMillimetersPerMinutesTest() =>
- Assert.Equal(Speed.FromMillimetersPerMinutes(2), 2.MillimetersPerMinutes());
+ public void NumberToMillimetersPerMinuteTest() =>
+ Assert.Equal(Speed.FromMillimetersPerMinute(2), 2.MillimetersPerMinute());
[Fact]
public void NumberToMillimetersPerSecondTest() =>
Assert.Equal(Speed.FromMillimetersPerSecond(2), 2.MillimetersPerSecond());
[Fact]
- public void NumberToNanometersPerMinutesTest() =>
- Assert.Equal(Speed.FromNanometersPerMinutes(2), 2.NanometersPerMinutes());
+ public void NumberToNanometersPerMinuteTest() =>
+ Assert.Equal(Speed.FromNanometersPerMinute(2), 2.NanometersPerMinute());
[Fact]
public void NumberToNanometersPerSecondTest() =>
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToTemperatureGradientExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToTemperatureGradientExtensionsTest.g.cs
index 4062ea3754..ae4c204e70 100644
--- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToTemperatureGradientExtensionsTest.g.cs
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToTemperatureGradientExtensionsTest.g.cs
@@ -25,12 +25,12 @@ namespace UnitsNet.Tests
public class NumberToTemperatureGradientExtensionsTests
{
[Fact]
- public void NumberToDegreesCelciusPerKilometerTest() =>
- Assert.Equal(TemperatureGradient.FromDegreesCelciusPerKilometer(2), 2.DegreesCelciusPerKilometer());
+ public void NumberToDegreesCelsiusPerKilometerTest() =>
+ Assert.Equal(TemperatureGradient.FromDegreesCelsiusPerKilometer(2), 2.DegreesCelsiusPerKilometer());
[Fact]
- public void NumberToDegreesCelciusPerMeterTest() =>
- Assert.Equal(TemperatureGradient.FromDegreesCelciusPerMeter(2), 2.DegreesCelciusPerMeter());
+ public void NumberToDegreesCelsiusPerMeterTest() =>
+ Assert.Equal(TemperatureGradient.FromDegreesCelsiusPerMeter(2), 2.DegreesCelsiusPerMeter());
[Fact]
public void NumberToDegreesFahrenheitPerFootTest() =>
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs
index 2ef9a7e913..fab19c64b9 100644
--- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToDensityExtensions.g.cs
@@ -32,13 +32,13 @@ namespace UnitsNet.NumberExtensions.NumberToDensity
///
public static class NumberToDensityExtensions
{
- ///
- public static Density CentigramsPerDeciLiter(this T value)
+ ///
+ public static Density CentigramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromCentigramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromCentigramsPerDeciliter(Convert.ToDouble(value));
///
public static Density CentigramsPerLiter(this T value)
@@ -56,13 +56,13 @@ public static Density CentigramsPerMilliliter(this T value)
#endif
=> Density.FromCentigramsPerMilliliter(Convert.ToDouble(value));
- ///
- public static Density DecigramsPerDeciLiter(this T value)
+ ///
+ public static Density DecigramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromDecigramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromDecigramsPerDeciliter(Convert.ToDouble(value));
///
public static Density DecigramsPerLiter(this T value)
@@ -80,13 +80,13 @@ public static Density DecigramsPerMilliliter(this T value)
#endif
=> Density.FromDecigramsPerMilliliter(Convert.ToDouble(value));
- ///
- public static Density FemtogramsPerDeciLiter(this T value)
+ ///
+ public static Density FemtogramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromFemtogramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromFemtogramsPerDeciliter(Convert.ToDouble(value));
///
public static Density FemtogramsPerLiter(this T value)
@@ -144,13 +144,13 @@ public static Density GramsPerCubicMillimeter(this T value)
#endif
=> Density.FromGramsPerCubicMillimeter(Convert.ToDouble(value));
- ///
- public static Density GramsPerDeciLiter(this T value)
+ ///
+ public static Density GramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromGramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromGramsPerDeciliter(Convert.ToDouble(value));
///
public static Density GramsPerLiter(this T value)
@@ -232,13 +232,13 @@ public static Density MicrogramsPerCubicMeter(this T value)
#endif
=> Density.FromMicrogramsPerCubicMeter(Convert.ToDouble(value));
- ///
- public static Density MicrogramsPerDeciLiter(this T value)
+ ///
+ public static Density MicrogramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromMicrogramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromMicrogramsPerDeciliter(Convert.ToDouble(value));
///
public static Density MicrogramsPerLiter(this T value)
@@ -264,13 +264,13 @@ public static Density MilligramsPerCubicMeter(this T value)
#endif
=> Density.FromMilligramsPerCubicMeter(Convert.ToDouble(value));
- ///
- public static Density MilligramsPerDeciLiter(this T value)
+ ///
+ public static Density MilligramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromMilligramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromMilligramsPerDeciliter(Convert.ToDouble(value));
///
public static Density MilligramsPerLiter(this T value)
@@ -288,13 +288,13 @@ public static Density MilligramsPerMilliliter(this T value)
#endif
=> Density.FromMilligramsPerMilliliter(Convert.ToDouble(value));
- ///
- public static Density NanogramsPerDeciLiter(this T value)
+ ///
+ public static Density NanogramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromNanogramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromNanogramsPerDeciliter(Convert.ToDouble(value));
///
public static Density NanogramsPerLiter(this T value)
@@ -312,13 +312,13 @@ public static Density NanogramsPerMilliliter(this T value)
#endif
=> Density.FromNanogramsPerMilliliter(Convert.ToDouble(value));
- ///
- public static Density PicogramsPerDeciLiter(this T value)
+ ///
+ public static Density PicogramsPerDeciliter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Density.FromPicogramsPerDeciLiter(Convert.ToDouble(value));
+ => Density.FromPicogramsPerDeciliter(Convert.ToDouble(value));
///
public static Density PicogramsPerLiter(this T value)
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs
index c277d4ab40..c41cfd13ba 100644
--- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricPotentialChangeRateExtensions.g.cs
@@ -32,165 +32,165 @@ namespace UnitsNet.NumberExtensions.NumberToElectricPotentialChangeRate
///
public static class NumberToElectricPotentialChangeRateExtensions
{
- ///
- public static ElectricPotentialChangeRate KilovoltsPerHours(this T value)
+ ///
+ public static ElectricPotentialChangeRate KilovoltsPerHour(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromKilovoltsPerHours(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromKilovoltsPerHour(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate KilovoltsPerMicroseconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate KilovoltsPerMicrosecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromKilovoltsPerMicroseconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromKilovoltsPerMicrosecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate KilovoltsPerMinutes(this T value)
+ ///
+ public static ElectricPotentialChangeRate KilovoltsPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromKilovoltsPerMinutes(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromKilovoltsPerMinute(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate KilovoltsPerSeconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate KilovoltsPerSecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromKilovoltsPerSeconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromKilovoltsPerSecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MegavoltsPerHours(this T value)
+ ///
+ public static ElectricPotentialChangeRate MegavoltsPerHour(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMegavoltsPerHours(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMegavoltsPerHour(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MegavoltsPerMicroseconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate MegavoltsPerMicrosecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMegavoltsPerMicroseconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMegavoltsPerMicrosecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MegavoltsPerMinutes(this T value)
+ ///
+ public static ElectricPotentialChangeRate MegavoltsPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMegavoltsPerMinutes(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMegavoltsPerMinute(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MegavoltsPerSeconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate MegavoltsPerSecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMegavoltsPerSeconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMegavoltsPerSecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MicrovoltsPerHours(this T value)
+ ///
+ public static ElectricPotentialChangeRate MicrovoltsPerHour(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMicrovoltsPerHours(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMicrovoltsPerHour(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MicrovoltsPerMicroseconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate MicrovoltsPerMicrosecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMicrovoltsPerMicroseconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMicrovoltsPerMicrosecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MicrovoltsPerMinutes(this T value)
+ ///
+ public static ElectricPotentialChangeRate MicrovoltsPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMicrovoltsPerMinutes(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMicrovoltsPerMinute(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MicrovoltsPerSeconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate MicrovoltsPerSecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMicrovoltsPerSeconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMicrovoltsPerSecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MillivoltsPerHours(this T value)
+ ///
+ public static ElectricPotentialChangeRate MillivoltsPerHour(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMillivoltsPerHours(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMillivoltsPerHour(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MillivoltsPerMicroseconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate MillivoltsPerMicrosecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMillivoltsPerMicroseconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMillivoltsPerMicrosecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MillivoltsPerMinutes(this T value)
+ ///
+ public static ElectricPotentialChangeRate MillivoltsPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMillivoltsPerMinutes(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMillivoltsPerMinute(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate MillivoltsPerSeconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate MillivoltsPerSecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromMillivoltsPerSeconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromMillivoltsPerSecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate VoltsPerHours(this T value)
+ ///
+ public static ElectricPotentialChangeRate VoltsPerHour(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromVoltsPerHours(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromVoltsPerHour(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate VoltsPerMicroseconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate VoltsPerMicrosecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromVoltsPerMicroseconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromVoltsPerMicrosecond(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate VoltsPerMinutes(this T value)
+ ///
+ public static ElectricPotentialChangeRate VoltsPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromVoltsPerMinutes(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromVoltsPerMinute(Convert.ToDouble(value));
- ///
- public static ElectricPotentialChangeRate VoltsPerSeconds(this T value)
+ ///
+ public static ElectricPotentialChangeRate VoltsPerSecond(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => ElectricPotentialChangeRate.FromVoltsPerSeconds(Convert.ToDouble(value));
+ => ElectricPotentialChangeRate.FromVoltsPerSecond(Convert.ToDouble(value));
}
}
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs
index da01bfdfcd..e7681b8ef9 100644
--- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFuelEfficiencyExtensions.g.cs
@@ -32,13 +32,13 @@ namespace UnitsNet.NumberExtensions.NumberToFuelEfficiency
///
public static class NumberToFuelEfficiencyExtensions
{
- ///
- public static FuelEfficiency KilometersPerLiters(this T value)
+ ///
+ public static FuelEfficiency KilometersPerLiter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => FuelEfficiency.FromKilometersPerLiters(Convert.ToDouble(value));
+ => FuelEfficiency.FromKilometersPerLiter(Convert.ToDouble(value));
///
public static FuelEfficiency LitersPer100Kilometers(this T value)
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs
index ab0cfd99cb..956e9ae248 100644
--- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpeedExtensions.g.cs
@@ -40,13 +40,13 @@ public static Speed CentimetersPerHour(this T value)
#endif
=> Speed.FromCentimetersPerHour(Convert.ToDouble(value));
- ///
- public static Speed CentimetersPerMinutes(this T value)
+ ///
+ public static Speed CentimetersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromCentimetersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromCentimetersPerMinute(Convert.ToDouble(value));
///
public static Speed CentimetersPerSecond(this T value)
@@ -56,13 +56,13 @@ public static Speed CentimetersPerSecond(this T value)
#endif
=> Speed.FromCentimetersPerSecond(Convert.ToDouble(value));
- ///
- public static Speed DecimetersPerMinutes(this T value)
+ ///
+ public static Speed DecimetersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromDecimetersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromDecimetersPerMinute(Convert.ToDouble(value));
///
public static Speed DecimetersPerSecond(this T value)
@@ -128,13 +128,13 @@ public static Speed KilometersPerHour(this T value)
#endif
=> Speed.FromKilometersPerHour(Convert.ToDouble(value));
- ///
- public static Speed KilometersPerMinutes(this T value)
+ ///
+ public static Speed KilometersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromKilometersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromKilometersPerMinute(Convert.ToDouble(value));
///
public static Speed KilometersPerSecond(this T value)
@@ -168,13 +168,13 @@ public static Speed MetersPerHour(this T value)
#endif
=> Speed.FromMetersPerHour(Convert.ToDouble(value));
- ///
- public static Speed MetersPerMinutes(this T value)
+ ///
+ public static Speed MetersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromMetersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromMetersPerMinute(Convert.ToDouble(value));
///
public static Speed MetersPerSecond(this T value)
@@ -184,13 +184,13 @@ public static Speed MetersPerSecond(this T value)
#endif
=> Speed.FromMetersPerSecond(Convert.ToDouble(value));
- ///
- public static Speed MicrometersPerMinutes(this T value)
+ ///
+ public static Speed MicrometersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromMicrometersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromMicrometersPerMinute(Convert.ToDouble(value));
///
public static Speed MicrometersPerSecond(this T value)
@@ -216,13 +216,13 @@ public static Speed MillimetersPerHour(this T value)
#endif
=> Speed.FromMillimetersPerHour(Convert.ToDouble(value));
- ///
- public static Speed MillimetersPerMinutes(this T value)
+ ///
+ public static Speed MillimetersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromMillimetersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromMillimetersPerMinute(Convert.ToDouble(value));
///
public static Speed MillimetersPerSecond(this T value)
@@ -232,13 +232,13 @@ public static Speed MillimetersPerSecond(this T value)
#endif
=> Speed.FromMillimetersPerSecond(Convert.ToDouble(value));
- ///
- public static Speed NanometersPerMinutes(this T value)
+ ///
+ public static Speed NanometersPerMinute(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => Speed.FromNanometersPerMinutes(Convert.ToDouble(value));
+ => Speed.FromNanometersPerMinute(Convert.ToDouble(value));
///
public static Speed NanometersPerSecond(this T value)
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs
index e8ad22828c..b12ee6e3bb 100644
--- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToTemperatureGradientExtensions.g.cs
@@ -32,21 +32,21 @@ namespace UnitsNet.NumberExtensions.NumberToTemperatureGradient
///
public static class NumberToTemperatureGradientExtensions
{
- ///
- public static TemperatureGradient DegreesCelciusPerKilometer(this T value)
+ ///
+ public static TemperatureGradient DegreesCelsiusPerKilometer(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => TemperatureGradient.FromDegreesCelciusPerKilometer(Convert.ToDouble(value));
+ => TemperatureGradient.FromDegreesCelsiusPerKilometer(Convert.ToDouble(value));
- ///
- public static TemperatureGradient DegreesCelciusPerMeter(this T value)
+ ///
+ public static TemperatureGradient DegreesCelsiusPerMeter(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber
#endif
- => TemperatureGradient.FromDegreesCelciusPerMeter(Convert.ToDouble(value));
+ => TemperatureGradient.FromDegreesCelsiusPerMeter(Convert.ToDouble(value));
///
public static TemperatureGradient DegreesFahrenheitPerFoot(this T value)
diff --git a/UnitsNet.Tests/CustomCode/DensityTests.cs b/UnitsNet.Tests/CustomCode/DensityTests.cs
index 1bec0dac10..0d5b42a287 100644
--- a/UnitsNet.Tests/CustomCode/DensityTests.cs
+++ b/UnitsNet.Tests/CustomCode/DensityTests.cs
@@ -47,45 +47,45 @@ public class DensityTests : DensityTestsBase
protected override double SlugsPerCubicFootInOneKilogramPerCubicMeter => 0.00194032;
- protected override double CentigramsPerDeciLiterInOneKilogramPerCubicMeter => 1e1;
+ protected override double CentigramsPerDeciliterInOneKilogramPerCubicMeter => 1e1;
protected override double CentigramsPerLiterInOneKilogramPerCubicMeter => 1e2;
protected override double CentigramsPerMilliliterInOneKilogramPerCubicMeter => 1e-1;
- protected override double DecigramsPerDeciLiterInOneKilogramPerCubicMeter => 1;
+ protected override double DecigramsPerDeciliterInOneKilogramPerCubicMeter => 1;
protected override double DecigramsPerLiterInOneKilogramPerCubicMeter => 1e1;
protected override double DecigramsPerMilliliterInOneKilogramPerCubicMeter => 1e-2;
- protected override double GramsPerDeciLiterInOneKilogramPerCubicMeter => 1e-1;
+ protected override double GramsPerDeciliterInOneKilogramPerCubicMeter => 1e-1;
protected override double GramsPerLiterInOneKilogramPerCubicMeter => 1;
protected override double GramsPerMilliliterInOneKilogramPerCubicMeter => 1e-3;
- protected override double MicrogramsPerDeciLiterInOneKilogramPerCubicMeter => 1e5;
+ protected override double MicrogramsPerDeciliterInOneKilogramPerCubicMeter => 1e5;
protected override double MicrogramsPerLiterInOneKilogramPerCubicMeter => 1e6;
protected override double MicrogramsPerMilliliterInOneKilogramPerCubicMeter => 1e3;
- protected override double MilligramsPerDeciLiterInOneKilogramPerCubicMeter => 1e2;
+ protected override double MilligramsPerDeciliterInOneKilogramPerCubicMeter => 1e2;
protected override double MilligramsPerLiterInOneKilogramPerCubicMeter => 1e3;
protected override double MilligramsPerMilliliterInOneKilogramPerCubicMeter => 1;
- protected override double NanogramsPerDeciLiterInOneKilogramPerCubicMeter => 1e8;
+ protected override double NanogramsPerDeciliterInOneKilogramPerCubicMeter => 1e8;
protected override double NanogramsPerLiterInOneKilogramPerCubicMeter => 1e9;
protected override double NanogramsPerMilliliterInOneKilogramPerCubicMeter => 1e6;
- protected override double PicogramsPerDeciLiterInOneKilogramPerCubicMeter => 1e11;
+ protected override double PicogramsPerDeciliterInOneKilogramPerCubicMeter => 1e11;
- protected override double FemtogramsPerDeciLiterInOneKilogramPerCubicMeter => 1e14;
+ protected override double FemtogramsPerDeciliterInOneKilogramPerCubicMeter => 1e14;
protected override double PicogramsPerLiterInOneKilogramPerCubicMeter => 1e12;
diff --git a/UnitsNet.Tests/CustomCode/ElectricPotentialChangeRateTests.cs b/UnitsNet.Tests/CustomCode/ElectricPotentialChangeRateTests.cs
index 478fe93087..80dd69de4d 100644
--- a/UnitsNet.Tests/CustomCode/ElectricPotentialChangeRateTests.cs
+++ b/UnitsNet.Tests/CustomCode/ElectricPotentialChangeRateTests.cs
@@ -24,25 +24,25 @@ namespace UnitsNet.Tests.CustomCode
public class ElectricPotentialChangeRateTests : ElectricPotentialChangeRateTestsBase
{
protected override bool SupportsSIUnitSystem => true;
- protected override double KilovoltsPerHoursInOneVoltPerSecond => 3.6;
- protected override double KilovoltsPerMicrosecondsInOneVoltPerSecond => 1e-09;
- protected override double KilovoltsPerMinutesInOneVoltPerSecond => 6e-2;
- protected override double KilovoltsPerSecondsInOneVoltPerSecond => 0.001;
- protected override double MegavoltsPerHoursInOneVoltPerSecond => 3.6e-3;
- protected override double MegavoltsPerMicrosecondsInOneVoltPerSecond => 1e-12;
- protected override double MegavoltsPerMinutesInOneVoltPerSecond => 6e-05;
- protected override double MegavoltsPerSecondsInOneVoltPerSecond => 1e-06;
- protected override double MicrovoltsPerHoursInOneVoltPerSecond => 3.6e9;
- protected override double MicrovoltsPerMicrosecondsInOneVoltPerSecond => 1;
- protected override double MicrovoltsPerMinutesInOneVoltPerSecond => 6e7;
- protected override double MicrovoltsPerSecondsInOneVoltPerSecond => 1e6;
- protected override double MillivoltsPerHoursInOneVoltPerSecond => 3.6e6;
- protected override double MillivoltsPerMicrosecondsInOneVoltPerSecond => 0.001;
- protected override double MillivoltsPerMinutesInOneVoltPerSecond => 6e4;
- protected override double MillivoltsPerSecondsInOneVoltPerSecond => 1000;
- protected override double VoltsPerHoursInOneVoltPerSecond => 3600;
- protected override double VoltsPerMicrosecondsInOneVoltPerSecond => 1e-06;
- protected override double VoltsPerMinutesInOneVoltPerSecond => 60;
- protected override double VoltsPerSecondsInOneVoltPerSecond => 1;
+ protected override double KilovoltsPerHourInOneVoltPerSecond => 3.6;
+ protected override double KilovoltsPerMicrosecondInOneVoltPerSecond => 1e-09;
+ protected override double KilovoltsPerMinuteInOneVoltPerSecond => 6e-2;
+ protected override double KilovoltsPerSecondInOneVoltPerSecond => 0.001;
+ protected override double MegavoltsPerHourInOneVoltPerSecond => 3.6e-3;
+ protected override double MegavoltsPerMicrosecondInOneVoltPerSecond => 1e-12;
+ protected override double MegavoltsPerMinuteInOneVoltPerSecond => 6e-05;
+ protected override double MegavoltsPerSecondInOneVoltPerSecond => 1e-06;
+ protected override double MicrovoltsPerHourInOneVoltPerSecond => 3.6e9;
+ protected override double MicrovoltsPerMicrosecondInOneVoltPerSecond => 1;
+ protected override double MicrovoltsPerMinuteInOneVoltPerSecond => 6e7;
+ protected override double MicrovoltsPerSecondInOneVoltPerSecond => 1e6;
+ protected override double MillivoltsPerHourInOneVoltPerSecond => 3.6e6;
+ protected override double MillivoltsPerMicrosecondInOneVoltPerSecond => 0.001;
+ protected override double MillivoltsPerMinuteInOneVoltPerSecond => 6e4;
+ protected override double MillivoltsPerSecondInOneVoltPerSecond => 1000;
+ protected override double VoltsPerHourInOneVoltPerSecond => 3600;
+ protected override double VoltsPerMicrosecondInOneVoltPerSecond => 1e-06;
+ protected override double VoltsPerMinuteInOneVoltPerSecond => 60;
+ protected override double VoltsPerSecondInOneVoltPerSecond => 1;
}
}
diff --git a/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs b/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs
index 3a131ba154..31da379824 100644
--- a/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs
+++ b/UnitsNet.Tests/CustomCode/FuelEfficiencyTests.cs
@@ -26,7 +26,7 @@ namespace UnitsNet.Tests.CustomCode
public class FuelEfficiencyTests : FuelEfficiencyTestsBase
{
protected override bool SupportsSIUnitSystem => false;
- protected override double KilometersPerLitersInOneLiterPer100Kilometers => 100;
+ protected override double KilometersPerLiterInOneLiterPer100Kilometers => 100;
protected override double LitersPer100KilometersInOneLiterPer100Kilometers => 1;
protected override double MilesPerUkGallonInOneLiterPer100Kilometers => 282.4809363;
protected override double MilesPerUsGallonInOneLiterPer100Kilometers => 235.2145833;
diff --git a/UnitsNet.Tests/CustomCode/SpeedTests.cs b/UnitsNet.Tests/CustomCode/SpeedTests.cs
index 70c4a569b6..629c61358e 100644
--- a/UnitsNet.Tests/CustomCode/SpeedTests.cs
+++ b/UnitsNet.Tests/CustomCode/SpeedTests.cs
@@ -33,19 +33,19 @@ public class SpeedTests : SpeedTestsBase
protected override double MetersPerHourInOneMeterPerSecond => 3.6E3;
- protected override double NanometersPerMinutesInOneMeterPerSecond => 6E10;
+ protected override double NanometersPerMinuteInOneMeterPerSecond => 6E10;
- protected override double MicrometersPerMinutesInOneMeterPerSecond => 6E7;
+ protected override double MicrometersPerMinuteInOneMeterPerSecond => 6E7;
- protected override double MillimetersPerMinutesInOneMeterPerSecond => 6E4;
+ protected override double MillimetersPerMinuteInOneMeterPerSecond => 6E4;
- protected override double CentimetersPerMinutesInOneMeterPerSecond => 6E3;
+ protected override double CentimetersPerMinuteInOneMeterPerSecond => 6E3;
- protected override double DecimetersPerMinutesInOneMeterPerSecond => 6E2;
+ protected override double DecimetersPerMinuteInOneMeterPerSecond => 6E2;
- protected override double MetersPerMinutesInOneMeterPerSecond => 6E1;
+ protected override double MetersPerMinuteInOneMeterPerSecond => 6E1;
- protected override double KilometersPerMinutesInOneMeterPerSecond => 6E-2;
+ protected override double KilometersPerMinuteInOneMeterPerSecond => 6E-2;
protected override double CentimetersPerHourInOneMeterPerSecond => 3.6E5;
diff --git a/UnitsNet.Tests/CustomCode/TemperatureGradientTests.cs b/UnitsNet.Tests/CustomCode/TemperatureGradientTests.cs
index 1a8c34c1ec..6917ede410 100644
--- a/UnitsNet.Tests/CustomCode/TemperatureGradientTests.cs
+++ b/UnitsNet.Tests/CustomCode/TemperatureGradientTests.cs
@@ -26,9 +26,9 @@ public class TemperatureGradientTests : TemperatureGradientTestsBase
{
protected override bool SupportsSIUnitSystem => true;
- protected override double DegreesCelciusPerKilometerInOneKelvinPerMeter => 1000;
+ protected override double DegreesCelsiusPerKilometerInOneKelvinPerMeter => 1000;
- protected override double DegreesCelciusPerMeterInOneKelvinPerMeter => 1;
+ protected override double DegreesCelsiusPerMeterInOneKelvinPerMeter => 1;
protected override double DegreesFahrenheitPerFootInOneKelvinPerMeter => 0.54864;
@@ -37,7 +37,7 @@ public class TemperatureGradientTests : TemperatureGradientTestsBase
[Fact]
public void TemperatureDeltaDividedByTemperatureGradientEqualsLength()
{
- Length length = TemperatureDelta.FromDegreesCelsius(50) / TemperatureGradient.FromDegreesCelciusPerKilometer(5);
+ Length length = TemperatureDelta.FromDegreesCelsius(50) / TemperatureGradient.FromDegreesCelsiusPerKilometer(5);
Assert.Equal(length, Length.FromKilometers(10));
}
@@ -45,20 +45,20 @@ public void TemperatureDeltaDividedByTemperatureGradientEqualsLength()
public void TemperatureDeltaDividedByLengthEqualsTemperatureGradient()
{
TemperatureGradient temperatureGradient = TemperatureDelta.FromDegreesCelsius(50) / Length.FromKilometers(10);
- Assert.Equal(5, temperatureGradient.DegreesCelciusPerKilometer);
+ Assert.Equal(5, temperatureGradient.DegreesCelsiusPerKilometer);
}
[Fact]
public void LengthMultipliedByTemperatureGradientEqualsTemperatureDelta()
{
- TemperatureDelta temperatureDelta = Length.FromKilometers(10) * TemperatureGradient.FromDegreesCelciusPerKilometer(5);
+ TemperatureDelta temperatureDelta = Length.FromKilometers(10) * TemperatureGradient.FromDegreesCelsiusPerKilometer(5);
Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsius(50));
}
[Fact]
public void TemperatureGradientMultipliedByLengthEqualsTemperatureDelta()
{
- TemperatureDelta temperatureDelta = TemperatureGradient.FromDegreesCelciusPerKilometer(5) * Length.FromKilometers(10);
+ TemperatureDelta temperatureDelta = TemperatureGradient.FromDegreesCelsiusPerKilometer(5) * Length.FromKilometers(10);
Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsius(50));
}
}
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs
index 55c8e33bce..5a3a67b1db 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs
@@ -127,16 +127,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AbsorbedDoseOfIonizingRadiation(double.PositiveInfinity, AbsorbedDoseOfIonizingRadiationUnit.Gray));
- Assert.Throws(() => new AbsorbedDoseOfIonizingRadiation(double.NegativeInfinity, AbsorbedDoseOfIonizingRadiationUnit.Gray));
+ var exception1 = Record.Exception(() => new AbsorbedDoseOfIonizingRadiation(double.PositiveInfinity, AbsorbedDoseOfIonizingRadiationUnit.Gray));
+ var exception2 = Record.Exception(() => new AbsorbedDoseOfIonizingRadiation(double.NegativeInfinity, AbsorbedDoseOfIonizingRadiationUnit.Gray));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AbsorbedDoseOfIonizingRadiation(double.NaN, AbsorbedDoseOfIonizingRadiationUnit.Gray));
+ var exception = Record.Exception(() => new AbsorbedDoseOfIonizingRadiation(double.NaN, AbsorbedDoseOfIonizingRadiationUnit.Gray));
+
+ Assert.Null(exception);
}
[Fact]
@@ -266,16 +271,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromGrays_WithInfinityValue_ThrowsArgumentException()
+ public void FromGrays_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AbsorbedDoseOfIonizingRadiation.FromGrays(double.PositiveInfinity));
- Assert.Throws(() => AbsorbedDoseOfIonizingRadiation.FromGrays(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => AbsorbedDoseOfIonizingRadiation.FromGrays(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => AbsorbedDoseOfIonizingRadiation.FromGrays(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromGrays_WithNanValue_ThrowsArgumentException()
+ public void FromGrays_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AbsorbedDoseOfIonizingRadiation.FromGrays(double.NaN));
+ var exception = Record.Exception(() => AbsorbedDoseOfIonizingRadiation.FromGrays(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs
index 8016edae40..6d511f82df 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs
@@ -119,16 +119,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Acceleration(double.PositiveInfinity, AccelerationUnit.MeterPerSecondSquared));
- Assert.Throws(() => new Acceleration(double.NegativeInfinity, AccelerationUnit.MeterPerSecondSquared));
+ var exception1 = Record.Exception(() => new Acceleration(double.PositiveInfinity, AccelerationUnit.MeterPerSecondSquared));
+ var exception2 = Record.Exception(() => new Acceleration(double.NegativeInfinity, AccelerationUnit.MeterPerSecondSquared));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Acceleration(double.NaN, AccelerationUnit.MeterPerSecondSquared));
+ var exception = Record.Exception(() => new Acceleration(double.NaN, AccelerationUnit.MeterPerSecondSquared));
+
+ Assert.Null(exception);
}
[Fact]
@@ -248,16 +253,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromMetersPerSecondSquared_WithInfinityValue_ThrowsArgumentException()
+ public void FromMetersPerSecondSquared_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Acceleration.FromMetersPerSecondSquared(double.PositiveInfinity));
- Assert.Throws(() => Acceleration.FromMetersPerSecondSquared(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Acceleration.FromMetersPerSecondSquared(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Acceleration.FromMetersPerSecondSquared(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromMetersPerSecondSquared_WithNanValue_ThrowsArgumentException()
+ public void FromMetersPerSecondSquared_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Acceleration.FromMetersPerSecondSquared(double.NaN));
+ var exception = Record.Exception(() => Acceleration.FromMetersPerSecondSquared(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs
index b32b6bcc56..b6ad678739 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs
@@ -131,16 +131,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AmountOfSubstance(double.PositiveInfinity, AmountOfSubstanceUnit.Mole));
- Assert.Throws(() => new AmountOfSubstance(double.NegativeInfinity, AmountOfSubstanceUnit.Mole));
+ var exception1 = Record.Exception(() => new AmountOfSubstance(double.PositiveInfinity, AmountOfSubstanceUnit.Mole));
+ var exception2 = Record.Exception(() => new AmountOfSubstance(double.NegativeInfinity, AmountOfSubstanceUnit.Mole));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AmountOfSubstance(double.NaN, AmountOfSubstanceUnit.Mole));
+ var exception = Record.Exception(() => new AmountOfSubstance(double.NaN, AmountOfSubstanceUnit.Mole));
+
+ Assert.Null(exception);
}
[Fact]
@@ -275,16 +280,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromMoles_WithInfinityValue_ThrowsArgumentException()
+ public void FromMoles_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AmountOfSubstance.FromMoles(double.PositiveInfinity));
- Assert.Throws(() => AmountOfSubstance.FromMoles(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => AmountOfSubstance.FromMoles(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => AmountOfSubstance.FromMoles(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromMoles_WithNanValue_ThrowsArgumentException()
+ public void FromMoles_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AmountOfSubstance.FromMoles(double.NaN));
+ var exception = Record.Exception(() => AmountOfSubstance.FromMoles(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs
index 8c8d952df2..8d526e5e33 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs
@@ -79,16 +79,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AmplitudeRatio(double.PositiveInfinity, AmplitudeRatioUnit.DecibelVolt));
- Assert.Throws(() => new AmplitudeRatio(double.NegativeInfinity, AmplitudeRatioUnit.DecibelVolt));
+ var exception1 = Record.Exception(() => new AmplitudeRatio(double.PositiveInfinity, AmplitudeRatioUnit.DecibelVolt));
+ var exception2 = Record.Exception(() => new AmplitudeRatio(double.NegativeInfinity, AmplitudeRatioUnit.DecibelVolt));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AmplitudeRatio(double.NaN, AmplitudeRatioUnit.DecibelVolt));
+ var exception = Record.Exception(() => new AmplitudeRatio(double.NaN, AmplitudeRatioUnit.DecibelVolt));
+
+ Assert.Null(exception);
}
[Fact]
@@ -158,16 +163,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromDecibelVolts_WithInfinityValue_ThrowsArgumentException()
+ public void FromDecibelVolts_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AmplitudeRatio.FromDecibelVolts(double.PositiveInfinity));
- Assert.Throws(() => AmplitudeRatio.FromDecibelVolts(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => AmplitudeRatio.FromDecibelVolts(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => AmplitudeRatio.FromDecibelVolts(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromDecibelVolts_WithNanValue_ThrowsArgumentException()
+ public void FromDecibelVolts_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AmplitudeRatio.FromDecibelVolts(double.NaN));
+ var exception = Record.Exception(() => AmplitudeRatio.FromDecibelVolts(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs
index 41ad0ce776..53570ce564 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs
@@ -127,16 +127,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Angle(double.PositiveInfinity, AngleUnit.Degree));
- Assert.Throws(() => new Angle(double.NegativeInfinity, AngleUnit.Degree));
+ var exception1 = Record.Exception(() => new Angle(double.PositiveInfinity, AngleUnit.Degree));
+ var exception2 = Record.Exception(() => new Angle(double.NegativeInfinity, AngleUnit.Degree));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Angle(double.NaN, AngleUnit.Degree));
+ var exception = Record.Exception(() => new Angle(double.NaN, AngleUnit.Degree));
+
+ Assert.Null(exception);
}
[Fact]
@@ -266,16 +271,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromDegrees_WithInfinityValue_ThrowsArgumentException()
+ public void FromDegrees_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Angle.FromDegrees(double.PositiveInfinity));
- Assert.Throws(() => Angle.FromDegrees(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Angle.FromDegrees(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Angle.FromDegrees(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromDegrees_WithNanValue_ThrowsArgumentException()
+ public void FromDegrees_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Angle.FromDegrees(double.NaN));
+ var exception = Record.Exception(() => Angle.FromDegrees(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs
index 517fd696e6..4a7469909b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs
@@ -75,16 +75,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ApparentEnergy(double.PositiveInfinity, ApparentEnergyUnit.VoltampereHour));
- Assert.Throws(() => new ApparentEnergy(double.NegativeInfinity, ApparentEnergyUnit.VoltampereHour));
+ var exception1 = Record.Exception(() => new ApparentEnergy(double.PositiveInfinity, ApparentEnergyUnit.VoltampereHour));
+ var exception2 = Record.Exception(() => new ApparentEnergy(double.NegativeInfinity, ApparentEnergyUnit.VoltampereHour));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ApparentEnergy(double.NaN, ApparentEnergyUnit.VoltampereHour));
+ var exception = Record.Exception(() => new ApparentEnergy(double.NaN, ApparentEnergyUnit.VoltampereHour));
+
+ Assert.Null(exception);
}
[Fact]
@@ -149,16 +154,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromVoltampereHours_WithInfinityValue_ThrowsArgumentException()
+ public void FromVoltampereHours_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ApparentEnergy.FromVoltampereHours(double.PositiveInfinity));
- Assert.Throws(() => ApparentEnergy.FromVoltampereHours(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ApparentEnergy.FromVoltampereHours(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ApparentEnergy.FromVoltampereHours(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVoltampereHours_WithNanValue_ThrowsArgumentException()
+ public void FromVoltampereHours_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ApparentEnergy.FromVoltampereHours(double.NaN));
+ var exception = Record.Exception(() => ApparentEnergy.FromVoltampereHours(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs
index c837d97039..bf80b99a6c 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs
@@ -87,16 +87,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ApparentPower(double.PositiveInfinity, ApparentPowerUnit.Voltampere));
- Assert.Throws(() => new ApparentPower(double.NegativeInfinity, ApparentPowerUnit.Voltampere));
+ var exception1 = Record.Exception(() => new ApparentPower(double.PositiveInfinity, ApparentPowerUnit.Voltampere));
+ var exception2 = Record.Exception(() => new ApparentPower(double.NegativeInfinity, ApparentPowerUnit.Voltampere));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ApparentPower(double.NaN, ApparentPowerUnit.Voltampere));
+ var exception = Record.Exception(() => new ApparentPower(double.NaN, ApparentPowerUnit.Voltampere));
+
+ Assert.Null(exception);
}
[Fact]
@@ -176,16 +181,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromVoltamperes_WithInfinityValue_ThrowsArgumentException()
+ public void FromVoltamperes_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ApparentPower.FromVoltamperes(double.PositiveInfinity));
- Assert.Throws(() => ApparentPower.FromVoltamperes(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ApparentPower.FromVoltamperes(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ApparentPower.FromVoltamperes(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVoltamperes_WithNanValue_ThrowsArgumentException()
+ public void FromVoltamperes_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ApparentPower.FromVoltamperes(double.NaN));
+ var exception = Record.Exception(() => ApparentPower.FromVoltamperes(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs
index 7a52efb886..3a7fcb6528 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs
@@ -75,16 +75,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AreaDensity(double.PositiveInfinity, AreaDensityUnit.KilogramPerSquareMeter));
- Assert.Throws(() => new AreaDensity(double.NegativeInfinity, AreaDensityUnit.KilogramPerSquareMeter));
+ var exception1 = Record.Exception(() => new AreaDensity(double.PositiveInfinity, AreaDensityUnit.KilogramPerSquareMeter));
+ var exception2 = Record.Exception(() => new AreaDensity(double.NegativeInfinity, AreaDensityUnit.KilogramPerSquareMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AreaDensity(double.NaN, AreaDensityUnit.KilogramPerSquareMeter));
+ var exception = Record.Exception(() => new AreaDensity(double.NaN, AreaDensityUnit.KilogramPerSquareMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -149,16 +154,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromKilogramsPerSquareMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromKilogramsPerSquareMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AreaDensity.FromKilogramsPerSquareMeter(double.PositiveInfinity));
- Assert.Throws(() => AreaDensity.FromKilogramsPerSquareMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => AreaDensity.FromKilogramsPerSquareMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => AreaDensity.FromKilogramsPerSquareMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromKilogramsPerSquareMeter_WithNanValue_ThrowsArgumentException()
+ public void FromKilogramsPerSquareMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AreaDensity.FromKilogramsPerSquareMeter(double.NaN));
+ var exception = Record.Exception(() => AreaDensity.FromKilogramsPerSquareMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs
index baad089fb2..d0e98f1051 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs
@@ -87,16 +87,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AreaMomentOfInertia(double.PositiveInfinity, AreaMomentOfInertiaUnit.MeterToTheFourth));
- Assert.Throws(() => new AreaMomentOfInertia(double.NegativeInfinity, AreaMomentOfInertiaUnit.MeterToTheFourth));
+ var exception1 = Record.Exception(() => new AreaMomentOfInertia(double.PositiveInfinity, AreaMomentOfInertiaUnit.MeterToTheFourth));
+ var exception2 = Record.Exception(() => new AreaMomentOfInertia(double.NegativeInfinity, AreaMomentOfInertiaUnit.MeterToTheFourth));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new AreaMomentOfInertia(double.NaN, AreaMomentOfInertiaUnit.MeterToTheFourth));
+ var exception = Record.Exception(() => new AreaMomentOfInertia(double.NaN, AreaMomentOfInertiaUnit.MeterToTheFourth));
+
+ Assert.Null(exception);
}
[Fact]
@@ -176,16 +181,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromMetersToTheFourth_WithInfinityValue_ThrowsArgumentException()
+ public void FromMetersToTheFourth_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AreaMomentOfInertia.FromMetersToTheFourth(double.PositiveInfinity));
- Assert.Throws(() => AreaMomentOfInertia.FromMetersToTheFourth(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => AreaMomentOfInertia.FromMetersToTheFourth(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => AreaMomentOfInertia.FromMetersToTheFourth(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromMetersToTheFourth_WithNanValue_ThrowsArgumentException()
+ public void FromMetersToTheFourth_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => AreaMomentOfInertia.FromMetersToTheFourth(double.NaN));
+ var exception = Record.Exception(() => AreaMomentOfInertia.FromMetersToTheFourth(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs
index a03b6f082f..5c47527b56 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs
@@ -119,16 +119,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Area(double.PositiveInfinity, AreaUnit.SquareMeter));
- Assert.Throws(() => new Area(double.NegativeInfinity, AreaUnit.SquareMeter));
+ var exception1 = Record.Exception(() => new Area(double.PositiveInfinity, AreaUnit.SquareMeter));
+ var exception2 = Record.Exception(() => new Area(double.NegativeInfinity, AreaUnit.SquareMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Area(double.NaN, AreaUnit.SquareMeter));
+ var exception = Record.Exception(() => new Area(double.NaN, AreaUnit.SquareMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -248,16 +253,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromSquareMeters_WithInfinityValue_ThrowsArgumentException()
+ public void FromSquareMeters_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Area.FromSquareMeters(double.PositiveInfinity));
- Assert.Throws(() => Area.FromSquareMeters(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Area.FromSquareMeters(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Area.FromSquareMeters(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromSquareMeters_WithNanValue_ThrowsArgumentException()
+ public void FromSquareMeters_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Area.FromSquareMeters(double.NaN));
+ var exception = Record.Exception(() => Area.FromSquareMeters(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs
index 48160ebe70..43cf8ecc6f 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs
@@ -75,16 +75,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new BrakeSpecificFuelConsumption(double.PositiveInfinity, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule));
- Assert.Throws(() => new BrakeSpecificFuelConsumption(double.NegativeInfinity, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule));
+ var exception1 = Record.Exception(() => new BrakeSpecificFuelConsumption(double.PositiveInfinity, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule));
+ var exception2 = Record.Exception(() => new BrakeSpecificFuelConsumption(double.NegativeInfinity, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new BrakeSpecificFuelConsumption(double.NaN, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule));
+ var exception = Record.Exception(() => new BrakeSpecificFuelConsumption(double.NaN, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule));
+
+ Assert.Null(exception);
}
[Fact]
@@ -149,16 +154,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromKilogramsPerJoule_WithInfinityValue_ThrowsArgumentException()
+ public void FromKilogramsPerJoule_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(double.PositiveInfinity));
- Assert.Throws(() => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromKilogramsPerJoule_WithNanValue_ThrowsArgumentException()
+ public void FromKilogramsPerJoule_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(double.NaN));
+ var exception = Record.Exception(() => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs
index f4c69001a6..a29bdaa0fc 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs
@@ -91,16 +91,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Capacitance(double.PositiveInfinity, CapacitanceUnit.Farad));
- Assert.Throws(() => new Capacitance(double.NegativeInfinity, CapacitanceUnit.Farad));
+ var exception1 = Record.Exception(() => new Capacitance(double.PositiveInfinity, CapacitanceUnit.Farad));
+ var exception2 = Record.Exception(() => new Capacitance(double.NegativeInfinity, CapacitanceUnit.Farad));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Capacitance(double.NaN, CapacitanceUnit.Farad));
+ var exception = Record.Exception(() => new Capacitance(double.NaN, CapacitanceUnit.Farad));
+
+ Assert.Null(exception);
}
[Fact]
@@ -185,16 +190,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromFarads_WithInfinityValue_ThrowsArgumentException()
+ public void FromFarads_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Capacitance.FromFarads(double.PositiveInfinity));
- Assert.Throws(() => Capacitance.FromFarads(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Capacitance.FromFarads(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Capacitance.FromFarads(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromFarads_WithNanValue_ThrowsArgumentException()
+ public void FromFarads_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Capacitance.FromFarads(double.NaN));
+ var exception = Record.Exception(() => Capacitance.FromFarads(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs
index eb9c8774ac..9f12014fbd 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs
@@ -99,16 +99,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new CoefficientOfThermalExpansion(double.PositiveInfinity, CoefficientOfThermalExpansionUnit.PerKelvin));
- Assert.Throws(() => new CoefficientOfThermalExpansion(double.NegativeInfinity, CoefficientOfThermalExpansionUnit.PerKelvin));
+ var exception1 = Record.Exception(() => new CoefficientOfThermalExpansion(double.PositiveInfinity, CoefficientOfThermalExpansionUnit.PerKelvin));
+ var exception2 = Record.Exception(() => new CoefficientOfThermalExpansion(double.NegativeInfinity, CoefficientOfThermalExpansionUnit.PerKelvin));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new CoefficientOfThermalExpansion(double.NaN, CoefficientOfThermalExpansionUnit.PerKelvin));
+ var exception = Record.Exception(() => new CoefficientOfThermalExpansion(double.NaN, CoefficientOfThermalExpansionUnit.PerKelvin));
+
+ Assert.Null(exception);
}
[Fact]
@@ -203,16 +208,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromPerKelvin_WithInfinityValue_ThrowsArgumentException()
+ public void FromPerKelvin_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => CoefficientOfThermalExpansion.FromPerKelvin(double.PositiveInfinity));
- Assert.Throws(() => CoefficientOfThermalExpansion.FromPerKelvin(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => CoefficientOfThermalExpansion.FromPerKelvin(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => CoefficientOfThermalExpansion.FromPerKelvin(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromPerKelvin_WithNanValue_ThrowsArgumentException()
+ public void FromPerKelvin_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => CoefficientOfThermalExpansion.FromPerKelvin(double.NaN));
+ var exception = Record.Exception(() => CoefficientOfThermalExpansion.FromPerKelvin(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs
index cd16c66174..aad597d478 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs
@@ -91,16 +91,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Compressibility(double.PositiveInfinity, CompressibilityUnit.InversePascal));
- Assert.Throws(() => new Compressibility(double.NegativeInfinity, CompressibilityUnit.InversePascal));
+ var exception1 = Record.Exception(() => new Compressibility(double.PositiveInfinity, CompressibilityUnit.InversePascal));
+ var exception2 = Record.Exception(() => new Compressibility(double.NegativeInfinity, CompressibilityUnit.InversePascal));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Compressibility(double.NaN, CompressibilityUnit.InversePascal));
+ var exception = Record.Exception(() => new Compressibility(double.NaN, CompressibilityUnit.InversePascal));
+
+ Assert.Null(exception);
}
[Fact]
@@ -185,16 +190,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromInversePascals_WithInfinityValue_ThrowsArgumentException()
+ public void FromInversePascals_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Compressibility.FromInversePascals(double.PositiveInfinity));
- Assert.Throws(() => Compressibility.FromInversePascals(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Compressibility.FromInversePascals(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Compressibility.FromInversePascals(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromInversePascals_WithNanValue_ThrowsArgumentException()
+ public void FromInversePascals_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Compressibility.FromInversePascals(double.NaN));
+ var exception = Record.Exception(() => Compressibility.FromInversePascals(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs
index 9d12072063..e7e3a06fa4 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs
@@ -38,13 +38,13 @@ namespace UnitsNet.Tests
// ReSharper disable once PartialTypeWithSinglePart
public abstract partial class DensityTestsBase : QuantityTestsBase
{
- protected abstract double CentigramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double CentigramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double CentigramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double CentigramsPerMilliliterInOneKilogramPerCubicMeter { get; }
- protected abstract double DecigramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double DecigramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double DecigramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double DecigramsPerMilliliterInOneKilogramPerCubicMeter { get; }
- protected abstract double FemtogramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double FemtogramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double FemtogramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double FemtogramsPerMilliliterInOneKilogramPerCubicMeter { get; }
protected abstract double GramsPerCubicCentimeterInOneKilogramPerCubicMeter { get; }
@@ -52,7 +52,7 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
protected abstract double GramsPerCubicInchInOneKilogramPerCubicMeter { get; }
protected abstract double GramsPerCubicMeterInOneKilogramPerCubicMeter { get; }
protected abstract double GramsPerCubicMillimeterInOneKilogramPerCubicMeter { get; }
- protected abstract double GramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double GramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double GramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double GramsPerMilliliterInOneKilogramPerCubicMeter { get; }
protected abstract double KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter { get; }
@@ -63,17 +63,17 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
protected abstract double KilopoundsPerCubicInchInOneKilogramPerCubicMeter { get; }
protected abstract double KilopoundsPerCubicYardInOneKilogramPerCubicMeter { get; }
protected abstract double MicrogramsPerCubicMeterInOneKilogramPerCubicMeter { get; }
- protected abstract double MicrogramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double MicrogramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double MicrogramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double MicrogramsPerMilliliterInOneKilogramPerCubicMeter { get; }
protected abstract double MilligramsPerCubicMeterInOneKilogramPerCubicMeter { get; }
- protected abstract double MilligramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double MilligramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double MilligramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double MilligramsPerMilliliterInOneKilogramPerCubicMeter { get; }
- protected abstract double NanogramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double NanogramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double NanogramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double NanogramsPerMilliliterInOneKilogramPerCubicMeter { get; }
- protected abstract double PicogramsPerDeciLiterInOneKilogramPerCubicMeter { get; }
+ protected abstract double PicogramsPerDeciliterInOneKilogramPerCubicMeter { get; }
protected abstract double PicogramsPerLiterInOneKilogramPerCubicMeter { get; }
protected abstract double PicogramsPerMilliliterInOneKilogramPerCubicMeter { get; }
protected abstract double PoundsPerCubicCentimeterInOneKilogramPerCubicMeter { get; }
@@ -96,13 +96,13 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
protected abstract double TonnesPerCubicMillimeterInOneKilogramPerCubicMeter { get; }
// ReSharper disable VirtualMemberNeverOverriden.Global
- protected virtual double CentigramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double CentigramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double CentigramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double CentigramsPerMilliliterTolerance { get { return 1e-5; } }
- protected virtual double DecigramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double DecigramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double DecigramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double DecigramsPerMilliliterTolerance { get { return 1e-5; } }
- protected virtual double FemtogramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double FemtogramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double FemtogramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double FemtogramsPerMilliliterTolerance { get { return 1e-5; } }
protected virtual double GramsPerCubicCentimeterTolerance { get { return 1e-5; } }
@@ -110,7 +110,7 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
protected virtual double GramsPerCubicInchTolerance { get { return 1e-5; } }
protected virtual double GramsPerCubicMeterTolerance { get { return 1e-5; } }
protected virtual double GramsPerCubicMillimeterTolerance { get { return 1e-5; } }
- protected virtual double GramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double GramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double GramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double GramsPerMilliliterTolerance { get { return 1e-5; } }
protected virtual double KilogramsPerCubicCentimeterTolerance { get { return 1e-5; } }
@@ -121,17 +121,17 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
protected virtual double KilopoundsPerCubicInchTolerance { get { return 1e-5; } }
protected virtual double KilopoundsPerCubicYardTolerance { get { return 1e-5; } }
protected virtual double MicrogramsPerCubicMeterTolerance { get { return 1e-5; } }
- protected virtual double MicrogramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double MicrogramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double MicrogramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double MicrogramsPerMilliliterTolerance { get { return 1e-5; } }
protected virtual double MilligramsPerCubicMeterTolerance { get { return 1e-5; } }
- protected virtual double MilligramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double MilligramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double MilligramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double MilligramsPerMilliliterTolerance { get { return 1e-5; } }
- protected virtual double NanogramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double NanogramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double NanogramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double NanogramsPerMilliliterTolerance { get { return 1e-5; } }
- protected virtual double PicogramsPerDeciLiterTolerance { get { return 1e-5; } }
+ protected virtual double PicogramsPerDeciliterTolerance { get { return 1e-5; } }
protected virtual double PicogramsPerLiterTolerance { get { return 1e-5; } }
protected virtual double PicogramsPerMilliliterTolerance { get { return 1e-5; } }
protected virtual double PoundsPerCubicCentimeterTolerance { get { return 1e-5; } }
@@ -158,13 +158,13 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
{
return unit switch
{
- DensityUnit.CentigramPerDeciliter => (CentigramsPerDeciLiterInOneKilogramPerCubicMeter, CentigramsPerDeciLiterTolerance),
+ DensityUnit.CentigramPerDeciliter => (CentigramsPerDeciliterInOneKilogramPerCubicMeter, CentigramsPerDeciliterTolerance),
DensityUnit.CentigramPerLiter => (CentigramsPerLiterInOneKilogramPerCubicMeter, CentigramsPerLiterTolerance),
DensityUnit.CentigramPerMilliliter => (CentigramsPerMilliliterInOneKilogramPerCubicMeter, CentigramsPerMilliliterTolerance),
- DensityUnit.DecigramPerDeciliter => (DecigramsPerDeciLiterInOneKilogramPerCubicMeter, DecigramsPerDeciLiterTolerance),
+ DensityUnit.DecigramPerDeciliter => (DecigramsPerDeciliterInOneKilogramPerCubicMeter, DecigramsPerDeciliterTolerance),
DensityUnit.DecigramPerLiter => (DecigramsPerLiterInOneKilogramPerCubicMeter, DecigramsPerLiterTolerance),
DensityUnit.DecigramPerMilliliter => (DecigramsPerMilliliterInOneKilogramPerCubicMeter, DecigramsPerMilliliterTolerance),
- DensityUnit.FemtogramPerDeciliter => (FemtogramsPerDeciLiterInOneKilogramPerCubicMeter, FemtogramsPerDeciLiterTolerance),
+ DensityUnit.FemtogramPerDeciliter => (FemtogramsPerDeciliterInOneKilogramPerCubicMeter, FemtogramsPerDeciliterTolerance),
DensityUnit.FemtogramPerLiter => (FemtogramsPerLiterInOneKilogramPerCubicMeter, FemtogramsPerLiterTolerance),
DensityUnit.FemtogramPerMilliliter => (FemtogramsPerMilliliterInOneKilogramPerCubicMeter, FemtogramsPerMilliliterTolerance),
DensityUnit.GramPerCubicCentimeter => (GramsPerCubicCentimeterInOneKilogramPerCubicMeter, GramsPerCubicCentimeterTolerance),
@@ -172,7 +172,7 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
DensityUnit.GramPerCubicInch => (GramsPerCubicInchInOneKilogramPerCubicMeter, GramsPerCubicInchTolerance),
DensityUnit.GramPerCubicMeter => (GramsPerCubicMeterInOneKilogramPerCubicMeter, GramsPerCubicMeterTolerance),
DensityUnit.GramPerCubicMillimeter => (GramsPerCubicMillimeterInOneKilogramPerCubicMeter, GramsPerCubicMillimeterTolerance),
- DensityUnit.GramPerDeciliter => (GramsPerDeciLiterInOneKilogramPerCubicMeter, GramsPerDeciLiterTolerance),
+ DensityUnit.GramPerDeciliter => (GramsPerDeciliterInOneKilogramPerCubicMeter, GramsPerDeciliterTolerance),
DensityUnit.GramPerLiter => (GramsPerLiterInOneKilogramPerCubicMeter, GramsPerLiterTolerance),
DensityUnit.GramPerMilliliter => (GramsPerMilliliterInOneKilogramPerCubicMeter, GramsPerMilliliterTolerance),
DensityUnit.KilogramPerCubicCentimeter => (KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, KilogramsPerCubicCentimeterTolerance),
@@ -183,17 +183,17 @@ public abstract partial class DensityTestsBase : QuantityTestsBase
DensityUnit.KilopoundPerCubicInch => (KilopoundsPerCubicInchInOneKilogramPerCubicMeter, KilopoundsPerCubicInchTolerance),
DensityUnit.KilopoundPerCubicYard => (KilopoundsPerCubicYardInOneKilogramPerCubicMeter, KilopoundsPerCubicYardTolerance),
DensityUnit.MicrogramPerCubicMeter => (MicrogramsPerCubicMeterInOneKilogramPerCubicMeter, MicrogramsPerCubicMeterTolerance),
- DensityUnit.MicrogramPerDeciliter => (MicrogramsPerDeciLiterInOneKilogramPerCubicMeter, MicrogramsPerDeciLiterTolerance),
+ DensityUnit.MicrogramPerDeciliter => (MicrogramsPerDeciliterInOneKilogramPerCubicMeter, MicrogramsPerDeciliterTolerance),
DensityUnit.MicrogramPerLiter => (MicrogramsPerLiterInOneKilogramPerCubicMeter, MicrogramsPerLiterTolerance),
DensityUnit.MicrogramPerMilliliter => (MicrogramsPerMilliliterInOneKilogramPerCubicMeter, MicrogramsPerMilliliterTolerance),
DensityUnit.MilligramPerCubicMeter => (MilligramsPerCubicMeterInOneKilogramPerCubicMeter, MilligramsPerCubicMeterTolerance),
- DensityUnit.MilligramPerDeciliter => (MilligramsPerDeciLiterInOneKilogramPerCubicMeter, MilligramsPerDeciLiterTolerance),
+ DensityUnit.MilligramPerDeciliter => (MilligramsPerDeciliterInOneKilogramPerCubicMeter, MilligramsPerDeciliterTolerance),
DensityUnit.MilligramPerLiter => (MilligramsPerLiterInOneKilogramPerCubicMeter, MilligramsPerLiterTolerance),
DensityUnit.MilligramPerMilliliter => (MilligramsPerMilliliterInOneKilogramPerCubicMeter, MilligramsPerMilliliterTolerance),
- DensityUnit.NanogramPerDeciliter => (NanogramsPerDeciLiterInOneKilogramPerCubicMeter, NanogramsPerDeciLiterTolerance),
+ DensityUnit.NanogramPerDeciliter => (NanogramsPerDeciliterInOneKilogramPerCubicMeter, NanogramsPerDeciliterTolerance),
DensityUnit.NanogramPerLiter => (NanogramsPerLiterInOneKilogramPerCubicMeter, NanogramsPerLiterTolerance),
DensityUnit.NanogramPerMilliliter => (NanogramsPerMilliliterInOneKilogramPerCubicMeter, NanogramsPerMilliliterTolerance),
- DensityUnit.PicogramPerDeciliter => (PicogramsPerDeciLiterInOneKilogramPerCubicMeter, PicogramsPerDeciLiterTolerance),
+ DensityUnit.PicogramPerDeciliter => (PicogramsPerDeciliterInOneKilogramPerCubicMeter, PicogramsPerDeciliterTolerance),
DensityUnit.PicogramPerLiter => (PicogramsPerLiterInOneKilogramPerCubicMeter, PicogramsPerLiterTolerance),
DensityUnit.PicogramPerMilliliter => (PicogramsPerMilliliterInOneKilogramPerCubicMeter, PicogramsPerMilliliterTolerance),
DensityUnit.PoundPerCubicCentimeter => (PoundsPerCubicCentimeterInOneKilogramPerCubicMeter, PoundsPerCubicCentimeterTolerance),
@@ -287,16 +287,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Density(double.PositiveInfinity, DensityUnit.KilogramPerCubicMeter));
- Assert.Throws(() => new Density(double.NegativeInfinity, DensityUnit.KilogramPerCubicMeter));
+ var exception1 = Record.Exception(() => new Density(double.PositiveInfinity, DensityUnit.KilogramPerCubicMeter));
+ var exception2 = Record.Exception(() => new Density(double.NegativeInfinity, DensityUnit.KilogramPerCubicMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Density(double.NaN, DensityUnit.KilogramPerCubicMeter));
+ var exception = Record.Exception(() => new Density(double.NaN, DensityUnit.KilogramPerCubicMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -338,13 +343,13 @@ public void Density_QuantityInfo_ReturnsQuantityInfoDescribingQuantity()
public void KilogramPerCubicMeterToDensityUnits()
{
Density kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1);
- AssertEx.EqualTolerance(CentigramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerDeciLiter, CentigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(CentigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerDeciliter, CentigramsPerDeciliterTolerance);
AssertEx.EqualTolerance(CentigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerLiter, CentigramsPerLiterTolerance);
AssertEx.EqualTolerance(CentigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.CentigramsPerMilliliter, CentigramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(DecigramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerDeciLiter, DecigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(DecigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerDeciliter, DecigramsPerDeciliterTolerance);
AssertEx.EqualTolerance(DecigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerLiter, DecigramsPerLiterTolerance);
AssertEx.EqualTolerance(DecigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.DecigramsPerMilliliter, DecigramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(FemtogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.FemtogramsPerDeciLiter, FemtogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(FemtogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.FemtogramsPerDeciliter, FemtogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(FemtogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.FemtogramsPerLiter, FemtogramsPerLiterTolerance);
AssertEx.EqualTolerance(FemtogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.FemtogramsPerMilliliter, FemtogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicCentimeter, GramsPerCubicCentimeterTolerance);
@@ -352,7 +357,7 @@ public void KilogramPerCubicMeterToDensityUnits()
AssertEx.EqualTolerance(GramsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicInch, GramsPerCubicInchTolerance);
AssertEx.EqualTolerance(GramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicMeter, GramsPerCubicMeterTolerance);
AssertEx.EqualTolerance(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerCubicMillimeter, GramsPerCubicMillimeterTolerance);
- AssertEx.EqualTolerance(GramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerDeciLiter, GramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(GramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerDeciliter, GramsPerDeciliterTolerance);
AssertEx.EqualTolerance(GramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerLiter, GramsPerLiterTolerance);
AssertEx.EqualTolerance(GramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.GramsPerMilliliter, GramsPerMilliliterTolerance);
AssertEx.EqualTolerance(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilogramsPerCubicCentimeter, KilogramsPerCubicCentimeterTolerance);
@@ -363,17 +368,17 @@ public void KilogramPerCubicMeterToDensityUnits()
AssertEx.EqualTolerance(KilopoundsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilopoundsPerCubicInch, KilopoundsPerCubicInchTolerance);
AssertEx.EqualTolerance(KilopoundsPerCubicYardInOneKilogramPerCubicMeter, kilogrampercubicmeter.KilopoundsPerCubicYard, KilopoundsPerCubicYardTolerance);
AssertEx.EqualTolerance(MicrogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerCubicMeter, MicrogramsPerCubicMeterTolerance);
- AssertEx.EqualTolerance(MicrogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerDeciLiter, MicrogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(MicrogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerDeciliter, MicrogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(MicrogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerLiter, MicrogramsPerLiterTolerance);
AssertEx.EqualTolerance(MicrogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MicrogramsPerMilliliter, MicrogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(MilligramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerCubicMeter, MilligramsPerCubicMeterTolerance);
- AssertEx.EqualTolerance(MilligramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerDeciLiter, MilligramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(MilligramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerDeciliter, MilligramsPerDeciliterTolerance);
AssertEx.EqualTolerance(MilligramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerLiter, MilligramsPerLiterTolerance);
AssertEx.EqualTolerance(MilligramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.MilligramsPerMilliliter, MilligramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(NanogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerDeciLiter, NanogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(NanogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerDeciliter, NanogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(NanogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerLiter, NanogramsPerLiterTolerance);
AssertEx.EqualTolerance(NanogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.NanogramsPerMilliliter, NanogramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(PicogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerDeciLiter, PicogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(PicogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerDeciliter, PicogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(PicogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerLiter, PicogramsPerLiterTolerance);
AssertEx.EqualTolerance(PicogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PicogramsPerMilliliter, PicogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(PoundsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.PoundsPerCubicCentimeter, PoundsPerCubicCentimeterTolerance);
@@ -400,7 +405,7 @@ public void KilogramPerCubicMeterToDensityUnits()
public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
{
var quantity00 = Density.From(1, DensityUnit.CentigramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity00.CentigramsPerDeciLiter, CentigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity00.CentigramsPerDeciliter, CentigramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.CentigramPerDeciliter, quantity00.Unit);
var quantity01 = Density.From(1, DensityUnit.CentigramPerLiter);
@@ -412,7 +417,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.CentigramPerMilliliter, quantity02.Unit);
var quantity03 = Density.From(1, DensityUnit.DecigramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity03.DecigramsPerDeciLiter, DecigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity03.DecigramsPerDeciliter, DecigramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.DecigramPerDeciliter, quantity03.Unit);
var quantity04 = Density.From(1, DensityUnit.DecigramPerLiter);
@@ -424,7 +429,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.DecigramPerMilliliter, quantity05.Unit);
var quantity06 = Density.From(1, DensityUnit.FemtogramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity06.FemtogramsPerDeciLiter, FemtogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity06.FemtogramsPerDeciliter, FemtogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.FemtogramPerDeciliter, quantity06.Unit);
var quantity07 = Density.From(1, DensityUnit.FemtogramPerLiter);
@@ -456,7 +461,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.GramPerCubicMillimeter, quantity13.Unit);
var quantity14 = Density.From(1, DensityUnit.GramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity14.GramsPerDeciLiter, GramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity14.GramsPerDeciliter, GramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.GramPerDeciliter, quantity14.Unit);
var quantity15 = Density.From(1, DensityUnit.GramPerLiter);
@@ -500,7 +505,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.MicrogramPerCubicMeter, quantity24.Unit);
var quantity25 = Density.From(1, DensityUnit.MicrogramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity25.MicrogramsPerDeciLiter, MicrogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity25.MicrogramsPerDeciliter, MicrogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.MicrogramPerDeciliter, quantity25.Unit);
var quantity26 = Density.From(1, DensityUnit.MicrogramPerLiter);
@@ -516,7 +521,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.MilligramPerCubicMeter, quantity28.Unit);
var quantity29 = Density.From(1, DensityUnit.MilligramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity29.MilligramsPerDeciLiter, MilligramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity29.MilligramsPerDeciliter, MilligramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.MilligramPerDeciliter, quantity29.Unit);
var quantity30 = Density.From(1, DensityUnit.MilligramPerLiter);
@@ -528,7 +533,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.MilligramPerMilliliter, quantity31.Unit);
var quantity32 = Density.From(1, DensityUnit.NanogramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity32.NanogramsPerDeciLiter, NanogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity32.NanogramsPerDeciliter, NanogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.NanogramPerDeciliter, quantity32.Unit);
var quantity33 = Density.From(1, DensityUnit.NanogramPerLiter);
@@ -540,7 +545,7 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
Assert.Equal(DensityUnit.NanogramPerMilliliter, quantity34.Unit);
var quantity35 = Density.From(1, DensityUnit.PicogramPerDeciliter);
- AssertEx.EqualTolerance(1, quantity35.PicogramsPerDeciLiter, PicogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, quantity35.PicogramsPerDeciliter, PicogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.PicogramPerDeciliter, quantity35.Unit);
var quantity36 = Density.From(1, DensityUnit.PicogramPerLiter);
@@ -626,29 +631,34 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromKilogramsPerCubicMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromKilogramsPerCubicMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Density.FromKilogramsPerCubicMeter(double.PositiveInfinity));
- Assert.Throws(() => Density.FromKilogramsPerCubicMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Density.FromKilogramsPerCubicMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Density.FromKilogramsPerCubicMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromKilogramsPerCubicMeter_WithNanValue_ThrowsArgumentException()
+ public void FromKilogramsPerCubicMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Density.FromKilogramsPerCubicMeter(double.NaN));
+ var exception = Record.Exception(() => Density.FromKilogramsPerCubicMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
public void As()
{
var kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1);
- AssertEx.EqualTolerance(CentigramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.CentigramPerDeciliter), CentigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(CentigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.CentigramPerDeciliter), CentigramsPerDeciliterTolerance);
AssertEx.EqualTolerance(CentigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.CentigramPerLiter), CentigramsPerLiterTolerance);
AssertEx.EqualTolerance(CentigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.CentigramPerMilliliter), CentigramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(DecigramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.DecigramPerDeciliter), DecigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(DecigramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.DecigramPerDeciliter), DecigramsPerDeciliterTolerance);
AssertEx.EqualTolerance(DecigramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.DecigramPerLiter), DecigramsPerLiterTolerance);
AssertEx.EqualTolerance(DecigramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.DecigramPerMilliliter), DecigramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(FemtogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.FemtogramPerDeciliter), FemtogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(FemtogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.FemtogramPerDeciliter), FemtogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(FemtogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.FemtogramPerLiter), FemtogramsPerLiterTolerance);
AssertEx.EqualTolerance(FemtogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.FemtogramPerMilliliter), FemtogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(GramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicCentimeter), GramsPerCubicCentimeterTolerance);
@@ -656,7 +666,7 @@ public void As()
AssertEx.EqualTolerance(GramsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicInch), GramsPerCubicInchTolerance);
AssertEx.EqualTolerance(GramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicMeter), GramsPerCubicMeterTolerance);
AssertEx.EqualTolerance(GramsPerCubicMillimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerCubicMillimeter), GramsPerCubicMillimeterTolerance);
- AssertEx.EqualTolerance(GramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerDeciliter), GramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(GramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerDeciliter), GramsPerDeciliterTolerance);
AssertEx.EqualTolerance(GramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerLiter), GramsPerLiterTolerance);
AssertEx.EqualTolerance(GramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.GramPerMilliliter), GramsPerMilliliterTolerance);
AssertEx.EqualTolerance(KilogramsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.KilogramPerCubicCentimeter), KilogramsPerCubicCentimeterTolerance);
@@ -667,17 +677,17 @@ public void As()
AssertEx.EqualTolerance(KilopoundsPerCubicInchInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.KilopoundPerCubicInch), KilopoundsPerCubicInchTolerance);
AssertEx.EqualTolerance(KilopoundsPerCubicYardInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.KilopoundPerCubicYard), KilopoundsPerCubicYardTolerance);
AssertEx.EqualTolerance(MicrogramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MicrogramPerCubicMeter), MicrogramsPerCubicMeterTolerance);
- AssertEx.EqualTolerance(MicrogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MicrogramPerDeciliter), MicrogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(MicrogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MicrogramPerDeciliter), MicrogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(MicrogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MicrogramPerLiter), MicrogramsPerLiterTolerance);
AssertEx.EqualTolerance(MicrogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MicrogramPerMilliliter), MicrogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(MilligramsPerCubicMeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MilligramPerCubicMeter), MilligramsPerCubicMeterTolerance);
- AssertEx.EqualTolerance(MilligramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MilligramPerDeciliter), MilligramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(MilligramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MilligramPerDeciliter), MilligramsPerDeciliterTolerance);
AssertEx.EqualTolerance(MilligramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MilligramPerLiter), MilligramsPerLiterTolerance);
AssertEx.EqualTolerance(MilligramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.MilligramPerMilliliter), MilligramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(NanogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.NanogramPerDeciliter), NanogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(NanogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.NanogramPerDeciliter), NanogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(NanogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.NanogramPerLiter), NanogramsPerLiterTolerance);
AssertEx.EqualTolerance(NanogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.NanogramPerMilliliter), NanogramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(PicogramsPerDeciLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.PicogramPerDeciliter), PicogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(PicogramsPerDeciliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.PicogramPerDeciliter), PicogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(PicogramsPerLiterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.PicogramPerLiter), PicogramsPerLiterTolerance);
AssertEx.EqualTolerance(PicogramsPerMilliliterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.PicogramPerMilliliter), PicogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(PoundsPerCubicCentimeterInOneKilogramPerCubicMeter, kilogrampercubicmeter.As(DensityUnit.PoundPerCubicCentimeter), PoundsPerCubicCentimeterTolerance);
@@ -723,7 +733,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 cg/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.CentigramsPerDeciLiter, CentigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.CentigramsPerDeciliter, CentigramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.CentigramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -744,7 +754,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 dg/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.DecigramsPerDeciLiter, DecigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.DecigramsPerDeciliter, DecigramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.DecigramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -765,7 +775,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 fg/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.FemtogramsPerDeciLiter, FemtogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.FemtogramsPerDeciliter, FemtogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.FemtogramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -828,7 +838,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 g/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.GramsPerDeciLiter, GramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.GramsPerDeciliter, GramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.GramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -919,7 +929,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 µg/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MicrogramsPerDeciLiter, MicrogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrogramsPerDeciliter, MicrogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.MicrogramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -954,7 +964,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 mg/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MilligramsPerDeciLiter, MilligramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.MilligramsPerDeciliter, MilligramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.MilligramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -975,7 +985,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 ng/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.NanogramsPerDeciLiter, NanogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.NanogramsPerDeciliter, NanogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.NanogramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -996,7 +1006,7 @@ public void Parse()
try
{
var parsed = Density.Parse("1 pg/dl", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.PicogramsPerDeciLiter, PicogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.PicogramsPerDeciliter, PicogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.PicogramPerDeciliter, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -1147,7 +1157,7 @@ public void TryParse()
{
{
Assert.True(Density.TryParse("1 cg/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.CentigramsPerDeciLiter, CentigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.CentigramsPerDeciliter, CentigramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.CentigramPerDeciliter, parsed.Unit);
}
@@ -1165,7 +1175,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 dg/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.DecigramsPerDeciLiter, DecigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.DecigramsPerDeciliter, DecigramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.DecigramPerDeciliter, parsed.Unit);
}
@@ -1183,7 +1193,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 fg/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.FemtogramsPerDeciLiter, FemtogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.FemtogramsPerDeciliter, FemtogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.FemtogramPerDeciliter, parsed.Unit);
}
@@ -1237,7 +1247,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 g/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.GramsPerDeciLiter, GramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.GramsPerDeciliter, GramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.GramPerDeciliter, parsed.Unit);
}
@@ -1315,7 +1325,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 µg/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.MicrogramsPerDeciLiter, MicrogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrogramsPerDeciliter, MicrogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.MicrogramPerDeciliter, parsed.Unit);
}
@@ -1345,7 +1355,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 mg/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.MilligramsPerDeciLiter, MilligramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.MilligramsPerDeciliter, MilligramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.MilligramPerDeciliter, parsed.Unit);
}
@@ -1363,7 +1373,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 ng/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.NanogramsPerDeciLiter, NanogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.NanogramsPerDeciliter, NanogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.NanogramPerDeciliter, parsed.Unit);
}
@@ -1381,7 +1391,7 @@ public void TryParse()
{
Assert.True(Density.TryParse("1 pg/dl", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.PicogramsPerDeciLiter, PicogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, parsed.PicogramsPerDeciliter, PicogramsPerDeciliterTolerance);
Assert.Equal(DensityUnit.PicogramPerDeciliter, parsed.Unit);
}
@@ -2223,13 +2233,13 @@ public virtual void ToUnit_FromDefaultQuantity_ReturnsQuantityWithGivenUnit(Dens
public void ConversionRoundTrip()
{
Density kilogrampercubicmeter = Density.FromKilogramsPerCubicMeter(1);
- AssertEx.EqualTolerance(1, Density.FromCentigramsPerDeciLiter(kilogrampercubicmeter.CentigramsPerDeciLiter).KilogramsPerCubicMeter, CentigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromCentigramsPerDeciliter(kilogrampercubicmeter.CentigramsPerDeciliter).KilogramsPerCubicMeter, CentigramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromCentigramsPerLiter(kilogrampercubicmeter.CentigramsPerLiter).KilogramsPerCubicMeter, CentigramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromCentigramsPerMilliliter(kilogrampercubicmeter.CentigramsPerMilliliter).KilogramsPerCubicMeter, CentigramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(1, Density.FromDecigramsPerDeciLiter(kilogrampercubicmeter.DecigramsPerDeciLiter).KilogramsPerCubicMeter, DecigramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromDecigramsPerDeciliter(kilogrampercubicmeter.DecigramsPerDeciliter).KilogramsPerCubicMeter, DecigramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromDecigramsPerLiter(kilogrampercubicmeter.DecigramsPerLiter).KilogramsPerCubicMeter, DecigramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromDecigramsPerMilliliter(kilogrampercubicmeter.DecigramsPerMilliliter).KilogramsPerCubicMeter, DecigramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(1, Density.FromFemtogramsPerDeciLiter(kilogrampercubicmeter.FemtogramsPerDeciLiter).KilogramsPerCubicMeter, FemtogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromFemtogramsPerDeciliter(kilogrampercubicmeter.FemtogramsPerDeciliter).KilogramsPerCubicMeter, FemtogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromFemtogramsPerLiter(kilogrampercubicmeter.FemtogramsPerLiter).KilogramsPerCubicMeter, FemtogramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromFemtogramsPerMilliliter(kilogrampercubicmeter.FemtogramsPerMilliliter).KilogramsPerCubicMeter, FemtogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(1, Density.FromGramsPerCubicCentimeter(kilogrampercubicmeter.GramsPerCubicCentimeter).KilogramsPerCubicMeter, GramsPerCubicCentimeterTolerance);
@@ -2237,7 +2247,7 @@ public void ConversionRoundTrip()
AssertEx.EqualTolerance(1, Density.FromGramsPerCubicInch(kilogrampercubicmeter.GramsPerCubicInch).KilogramsPerCubicMeter, GramsPerCubicInchTolerance);
AssertEx.EqualTolerance(1, Density.FromGramsPerCubicMeter(kilogrampercubicmeter.GramsPerCubicMeter).KilogramsPerCubicMeter, GramsPerCubicMeterTolerance);
AssertEx.EqualTolerance(1, Density.FromGramsPerCubicMillimeter(kilogrampercubicmeter.GramsPerCubicMillimeter).KilogramsPerCubicMeter, GramsPerCubicMillimeterTolerance);
- AssertEx.EqualTolerance(1, Density.FromGramsPerDeciLiter(kilogrampercubicmeter.GramsPerDeciLiter).KilogramsPerCubicMeter, GramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromGramsPerDeciliter(kilogrampercubicmeter.GramsPerDeciliter).KilogramsPerCubicMeter, GramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromGramsPerLiter(kilogrampercubicmeter.GramsPerLiter).KilogramsPerCubicMeter, GramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromGramsPerMilliliter(kilogrampercubicmeter.GramsPerMilliliter).KilogramsPerCubicMeter, GramsPerMilliliterTolerance);
AssertEx.EqualTolerance(1, Density.FromKilogramsPerCubicCentimeter(kilogrampercubicmeter.KilogramsPerCubicCentimeter).KilogramsPerCubicMeter, KilogramsPerCubicCentimeterTolerance);
@@ -2248,17 +2258,17 @@ public void ConversionRoundTrip()
AssertEx.EqualTolerance(1, Density.FromKilopoundsPerCubicInch(kilogrampercubicmeter.KilopoundsPerCubicInch).KilogramsPerCubicMeter, KilopoundsPerCubicInchTolerance);
AssertEx.EqualTolerance(1, Density.FromKilopoundsPerCubicYard(kilogrampercubicmeter.KilopoundsPerCubicYard).KilogramsPerCubicMeter, KilopoundsPerCubicYardTolerance);
AssertEx.EqualTolerance(1, Density.FromMicrogramsPerCubicMeter(kilogrampercubicmeter.MicrogramsPerCubicMeter).KilogramsPerCubicMeter, MicrogramsPerCubicMeterTolerance);
- AssertEx.EqualTolerance(1, Density.FromMicrogramsPerDeciLiter(kilogrampercubicmeter.MicrogramsPerDeciLiter).KilogramsPerCubicMeter, MicrogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromMicrogramsPerDeciliter(kilogrampercubicmeter.MicrogramsPerDeciliter).KilogramsPerCubicMeter, MicrogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromMicrogramsPerLiter(kilogrampercubicmeter.MicrogramsPerLiter).KilogramsPerCubicMeter, MicrogramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromMicrogramsPerMilliliter(kilogrampercubicmeter.MicrogramsPerMilliliter).KilogramsPerCubicMeter, MicrogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(1, Density.FromMilligramsPerCubicMeter(kilogrampercubicmeter.MilligramsPerCubicMeter).KilogramsPerCubicMeter, MilligramsPerCubicMeterTolerance);
- AssertEx.EqualTolerance(1, Density.FromMilligramsPerDeciLiter(kilogrampercubicmeter.MilligramsPerDeciLiter).KilogramsPerCubicMeter, MilligramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromMilligramsPerDeciliter(kilogrampercubicmeter.MilligramsPerDeciliter).KilogramsPerCubicMeter, MilligramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromMilligramsPerLiter(kilogrampercubicmeter.MilligramsPerLiter).KilogramsPerCubicMeter, MilligramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromMilligramsPerMilliliter(kilogrampercubicmeter.MilligramsPerMilliliter).KilogramsPerCubicMeter, MilligramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(1, Density.FromNanogramsPerDeciLiter(kilogrampercubicmeter.NanogramsPerDeciLiter).KilogramsPerCubicMeter, NanogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromNanogramsPerDeciliter(kilogrampercubicmeter.NanogramsPerDeciliter).KilogramsPerCubicMeter, NanogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromNanogramsPerLiter(kilogrampercubicmeter.NanogramsPerLiter).KilogramsPerCubicMeter, NanogramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromNanogramsPerMilliliter(kilogrampercubicmeter.NanogramsPerMilliliter).KilogramsPerCubicMeter, NanogramsPerMilliliterTolerance);
- AssertEx.EqualTolerance(1, Density.FromPicogramsPerDeciLiter(kilogrampercubicmeter.PicogramsPerDeciLiter).KilogramsPerCubicMeter, PicogramsPerDeciLiterTolerance);
+ AssertEx.EqualTolerance(1, Density.FromPicogramsPerDeciliter(kilogrampercubicmeter.PicogramsPerDeciliter).KilogramsPerCubicMeter, PicogramsPerDeciliterTolerance);
AssertEx.EqualTolerance(1, Density.FromPicogramsPerLiter(kilogrampercubicmeter.PicogramsPerLiter).KilogramsPerCubicMeter, PicogramsPerLiterTolerance);
AssertEx.EqualTolerance(1, Density.FromPicogramsPerMilliliter(kilogrampercubicmeter.PicogramsPerMilliliter).KilogramsPerCubicMeter, PicogramsPerMilliliterTolerance);
AssertEx.EqualTolerance(1, Density.FromPoundsPerCubicCentimeter(kilogrampercubicmeter.PoundsPerCubicCentimeter).KilogramsPerCubicMeter, PoundsPerCubicCentimeterTolerance);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs
index f894a93107..b6b8eb6e17 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs
@@ -107,16 +107,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Duration(double.PositiveInfinity, DurationUnit.Second));
- Assert.Throws(() => new Duration(double.NegativeInfinity, DurationUnit.Second));
+ var exception1 = Record.Exception(() => new Duration(double.PositiveInfinity, DurationUnit.Second));
+ var exception2 = Record.Exception(() => new Duration(double.NegativeInfinity, DurationUnit.Second));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Duration(double.NaN, DurationUnit.Second));
+ var exception = Record.Exception(() => new Duration(double.NaN, DurationUnit.Second));
+
+ Assert.Null(exception);
}
[Fact]
@@ -221,16 +226,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromSeconds_WithInfinityValue_ThrowsArgumentException()
+ public void FromSeconds_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Duration.FromSeconds(double.PositiveInfinity));
- Assert.Throws(() => Duration.FromSeconds(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Duration.FromSeconds(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Duration.FromSeconds(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromSeconds_WithNanValue_ThrowsArgumentException()
+ public void FromSeconds_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Duration.FromSeconds(double.NaN));
+ var exception = Record.Exception(() => Duration.FromSeconds(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs
index dd8bc8d531..04783059d7 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs
@@ -103,16 +103,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new DynamicViscosity(double.PositiveInfinity, DynamicViscosityUnit.NewtonSecondPerMeterSquared));
- Assert.Throws(() => new DynamicViscosity(double.NegativeInfinity, DynamicViscosityUnit.NewtonSecondPerMeterSquared));
+ var exception1 = Record.Exception(() => new DynamicViscosity(double.PositiveInfinity, DynamicViscosityUnit.NewtonSecondPerMeterSquared));
+ var exception2 = Record.Exception(() => new DynamicViscosity(double.NegativeInfinity, DynamicViscosityUnit.NewtonSecondPerMeterSquared));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new DynamicViscosity(double.NaN, DynamicViscosityUnit.NewtonSecondPerMeterSquared));
+ var exception = Record.Exception(() => new DynamicViscosity(double.NaN, DynamicViscosityUnit.NewtonSecondPerMeterSquared));
+
+ Assert.Null(exception);
}
[Fact]
@@ -212,16 +217,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromNewtonSecondsPerMeterSquared_WithInfinityValue_ThrowsArgumentException()
+ public void FromNewtonSecondsPerMeterSquared_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.PositiveInfinity));
- Assert.Throws(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromNewtonSecondsPerMeterSquared_WithNanValue_ThrowsArgumentException()
+ public void FromNewtonSecondsPerMeterSquared_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NaN));
+ var exception = Record.Exception(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs
index b38c2598ff..d8116b6226 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs
@@ -79,16 +79,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricAdmittance(double.PositiveInfinity, ElectricAdmittanceUnit.Siemens));
- Assert.Throws(() => new ElectricAdmittance(double.NegativeInfinity, ElectricAdmittanceUnit.Siemens));
+ var exception1 = Record.Exception(() => new ElectricAdmittance(double.PositiveInfinity, ElectricAdmittanceUnit.Siemens));
+ var exception2 = Record.Exception(() => new ElectricAdmittance(double.NegativeInfinity, ElectricAdmittanceUnit.Siemens));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricAdmittance(double.NaN, ElectricAdmittanceUnit.Siemens));
+ var exception = Record.Exception(() => new ElectricAdmittance(double.NaN, ElectricAdmittanceUnit.Siemens));
+
+ Assert.Null(exception);
}
[Fact]
@@ -158,16 +163,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromSiemens_WithInfinityValue_ThrowsArgumentException()
+ public void FromSiemens_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricAdmittance.FromSiemens(double.PositiveInfinity));
- Assert.Throws(() => ElectricAdmittance.FromSiemens(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricAdmittance.FromSiemens(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricAdmittance.FromSiemens(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromSiemens_WithNanValue_ThrowsArgumentException()
+ public void FromSiemens_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricAdmittance.FromSiemens(double.NaN));
+ var exception = Record.Exception(() => ElectricAdmittance.FromSiemens(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs
index 0633765b22..dbfcedc08f 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs
@@ -67,16 +67,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricChargeDensity(double.PositiveInfinity, ElectricChargeDensityUnit.CoulombPerCubicMeter));
- Assert.Throws(() => new ElectricChargeDensity(double.NegativeInfinity, ElectricChargeDensityUnit.CoulombPerCubicMeter));
+ var exception1 = Record.Exception(() => new ElectricChargeDensity(double.PositiveInfinity, ElectricChargeDensityUnit.CoulombPerCubicMeter));
+ var exception2 = Record.Exception(() => new ElectricChargeDensity(double.NegativeInfinity, ElectricChargeDensityUnit.CoulombPerCubicMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricChargeDensity(double.NaN, ElectricChargeDensityUnit.CoulombPerCubicMeter));
+ var exception = Record.Exception(() => new ElectricChargeDensity(double.NaN, ElectricChargeDensityUnit.CoulombPerCubicMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -131,16 +136,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromCoulombsPerCubicMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromCoulombsPerCubicMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricChargeDensity.FromCoulombsPerCubicMeter(double.PositiveInfinity));
- Assert.Throws(() => ElectricChargeDensity.FromCoulombsPerCubicMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricChargeDensity.FromCoulombsPerCubicMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricChargeDensity.FromCoulombsPerCubicMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromCoulombsPerCubicMeter_WithNanValue_ThrowsArgumentException()
+ public void FromCoulombsPerCubicMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricChargeDensity.FromCoulombsPerCubicMeter(double.NaN));
+ var exception = Record.Exception(() => ElectricChargeDensity.FromCoulombsPerCubicMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs
index 0307409152..bfd453e100 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs
@@ -107,16 +107,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCharge(double.PositiveInfinity, ElectricChargeUnit.Coulomb));
- Assert.Throws(() => new ElectricCharge(double.NegativeInfinity, ElectricChargeUnit.Coulomb));
+ var exception1 = Record.Exception(() => new ElectricCharge(double.PositiveInfinity, ElectricChargeUnit.Coulomb));
+ var exception2 = Record.Exception(() => new ElectricCharge(double.NegativeInfinity, ElectricChargeUnit.Coulomb));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCharge(double.NaN, ElectricChargeUnit.Coulomb));
+ var exception = Record.Exception(() => new ElectricCharge(double.NaN, ElectricChargeUnit.Coulomb));
+
+ Assert.Null(exception);
}
[Fact]
@@ -221,16 +226,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromCoulombs_WithInfinityValue_ThrowsArgumentException()
+ public void FromCoulombs_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCharge.FromCoulombs(double.PositiveInfinity));
- Assert.Throws(() => ElectricCharge.FromCoulombs(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricCharge.FromCoulombs(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricCharge.FromCoulombs(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromCoulombs_WithNanValue_ThrowsArgumentException()
+ public void FromCoulombs_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCharge.FromCoulombs(double.NaN));
+ var exception = Record.Exception(() => ElectricCharge.FromCoulombs(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs
index 5c9c9a2388..ab6dbeb4a1 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs
@@ -83,16 +83,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricConductance(double.PositiveInfinity, ElectricConductanceUnit.Siemens));
- Assert.Throws(() => new ElectricConductance(double.NegativeInfinity, ElectricConductanceUnit.Siemens));
+ var exception1 = Record.Exception(() => new ElectricConductance(double.PositiveInfinity, ElectricConductanceUnit.Siemens));
+ var exception2 = Record.Exception(() => new ElectricConductance(double.NegativeInfinity, ElectricConductanceUnit.Siemens));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricConductance(double.NaN, ElectricConductanceUnit.Siemens));
+ var exception = Record.Exception(() => new ElectricConductance(double.NaN, ElectricConductanceUnit.Siemens));
+
+ Assert.Null(exception);
}
[Fact]
@@ -167,16 +172,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromSiemens_WithInfinityValue_ThrowsArgumentException()
+ public void FromSiemens_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricConductance.FromSiemens(double.PositiveInfinity));
- Assert.Throws(() => ElectricConductance.FromSiemens(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricConductance.FromSiemens(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricConductance.FromSiemens(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromSiemens_WithNanValue_ThrowsArgumentException()
+ public void FromSiemens_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricConductance.FromSiemens(double.NaN));
+ var exception = Record.Exception(() => ElectricConductance.FromSiemens(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs
index 5495b54c60..db74c22833 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs
@@ -87,16 +87,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricConductivity(double.PositiveInfinity, ElectricConductivityUnit.SiemensPerMeter));
- Assert.Throws(() => new ElectricConductivity(double.NegativeInfinity, ElectricConductivityUnit.SiemensPerMeter));
+ var exception1 = Record.Exception(() => new ElectricConductivity(double.PositiveInfinity, ElectricConductivityUnit.SiemensPerMeter));
+ var exception2 = Record.Exception(() => new ElectricConductivity(double.NegativeInfinity, ElectricConductivityUnit.SiemensPerMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricConductivity(double.NaN, ElectricConductivityUnit.SiemensPerMeter));
+ var exception = Record.Exception(() => new ElectricConductivity(double.NaN, ElectricConductivityUnit.SiemensPerMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -176,16 +181,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromSiemensPerMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromSiemensPerMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricConductivity.FromSiemensPerMeter(double.PositiveInfinity));
- Assert.Throws(() => ElectricConductivity.FromSiemensPerMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricConductivity.FromSiemensPerMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricConductivity.FromSiemensPerMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromSiemensPerMeter_WithNanValue_ThrowsArgumentException()
+ public void FromSiemensPerMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricConductivity.FromSiemensPerMeter(double.NaN));
+ var exception = Record.Exception(() => ElectricConductivity.FromSiemensPerMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs
index 1e8f4d08e3..36a051e746 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs
@@ -75,16 +75,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCurrentDensity(double.PositiveInfinity, ElectricCurrentDensityUnit.AmperePerSquareMeter));
- Assert.Throws(() => new ElectricCurrentDensity(double.NegativeInfinity, ElectricCurrentDensityUnit.AmperePerSquareMeter));
+ var exception1 = Record.Exception(() => new ElectricCurrentDensity(double.PositiveInfinity, ElectricCurrentDensityUnit.AmperePerSquareMeter));
+ var exception2 = Record.Exception(() => new ElectricCurrentDensity(double.NegativeInfinity, ElectricCurrentDensityUnit.AmperePerSquareMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCurrentDensity(double.NaN, ElectricCurrentDensityUnit.AmperePerSquareMeter));
+ var exception = Record.Exception(() => new ElectricCurrentDensity(double.NaN, ElectricCurrentDensityUnit.AmperePerSquareMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -149,16 +154,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromAmperesPerSquareMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromAmperesPerSquareMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCurrentDensity.FromAmperesPerSquareMeter(double.PositiveInfinity));
- Assert.Throws(() => ElectricCurrentDensity.FromAmperesPerSquareMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricCurrentDensity.FromAmperesPerSquareMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricCurrentDensity.FromAmperesPerSquareMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromAmperesPerSquareMeter_WithNanValue_ThrowsArgumentException()
+ public void FromAmperesPerSquareMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCurrentDensity.FromAmperesPerSquareMeter(double.NaN));
+ var exception = Record.Exception(() => ElectricCurrentDensity.FromAmperesPerSquareMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs
index 9f712eba0f..7850e56594 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs
@@ -91,16 +91,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCurrentGradient(double.PositiveInfinity, ElectricCurrentGradientUnit.AmperePerSecond));
- Assert.Throws(() => new ElectricCurrentGradient(double.NegativeInfinity, ElectricCurrentGradientUnit.AmperePerSecond));
+ var exception1 = Record.Exception(() => new ElectricCurrentGradient(double.PositiveInfinity, ElectricCurrentGradientUnit.AmperePerSecond));
+ var exception2 = Record.Exception(() => new ElectricCurrentGradient(double.NegativeInfinity, ElectricCurrentGradientUnit.AmperePerSecond));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCurrentGradient(double.NaN, ElectricCurrentGradientUnit.AmperePerSecond));
+ var exception = Record.Exception(() => new ElectricCurrentGradient(double.NaN, ElectricCurrentGradientUnit.AmperePerSecond));
+
+ Assert.Null(exception);
}
[Fact]
@@ -185,16 +190,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromAmperesPerSecond_WithInfinityValue_ThrowsArgumentException()
+ public void FromAmperesPerSecond_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCurrentGradient.FromAmperesPerSecond(double.PositiveInfinity));
- Assert.Throws(() => ElectricCurrentGradient.FromAmperesPerSecond(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricCurrentGradient.FromAmperesPerSecond(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricCurrentGradient.FromAmperesPerSecond(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromAmperesPerSecond_WithNanValue_ThrowsArgumentException()
+ public void FromAmperesPerSecond_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCurrentGradient.FromAmperesPerSecond(double.NaN));
+ var exception = Record.Exception(() => ElectricCurrentGradient.FromAmperesPerSecond(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs
index a562934178..fb478daebd 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs
@@ -99,16 +99,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCurrent(double.PositiveInfinity, ElectricCurrentUnit.Ampere));
- Assert.Throws(() => new ElectricCurrent(double.NegativeInfinity, ElectricCurrentUnit.Ampere));
+ var exception1 = Record.Exception(() => new ElectricCurrent(double.PositiveInfinity, ElectricCurrentUnit.Ampere));
+ var exception2 = Record.Exception(() => new ElectricCurrent(double.NegativeInfinity, ElectricCurrentUnit.Ampere));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricCurrent(double.NaN, ElectricCurrentUnit.Ampere));
+ var exception = Record.Exception(() => new ElectricCurrent(double.NaN, ElectricCurrentUnit.Ampere));
+
+ Assert.Null(exception);
}
[Fact]
@@ -203,16 +208,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromAmperes_WithInfinityValue_ThrowsArgumentException()
+ public void FromAmperes_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCurrent.FromAmperes(double.PositiveInfinity));
- Assert.Throws(() => ElectricCurrent.FromAmperes(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricCurrent.FromAmperes(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricCurrent.FromAmperes(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromAmperes_WithNanValue_ThrowsArgumentException()
+ public void FromAmperes_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricCurrent.FromAmperes(double.NaN));
+ var exception = Record.Exception(() => ElectricCurrent.FromAmperes(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs
index e45dad4e08..c0ed5996c6 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs
@@ -67,16 +67,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricField(double.PositiveInfinity, ElectricFieldUnit.VoltPerMeter));
- Assert.Throws(() => new ElectricField(double.NegativeInfinity, ElectricFieldUnit.VoltPerMeter));
+ var exception1 = Record.Exception(() => new ElectricField(double.PositiveInfinity, ElectricFieldUnit.VoltPerMeter));
+ var exception2 = Record.Exception(() => new ElectricField(double.NegativeInfinity, ElectricFieldUnit.VoltPerMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricField(double.NaN, ElectricFieldUnit.VoltPerMeter));
+ var exception = Record.Exception(() => new ElectricField(double.NaN, ElectricFieldUnit.VoltPerMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -131,16 +136,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromVoltsPerMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromVoltsPerMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricField.FromVoltsPerMeter(double.PositiveInfinity));
- Assert.Throws(() => ElectricField.FromVoltsPerMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricField.FromVoltsPerMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricField.FromVoltsPerMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVoltsPerMeter_WithNanValue_ThrowsArgumentException()
+ public void FromVoltsPerMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricField.FromVoltsPerMeter(double.NaN));
+ var exception = Record.Exception(() => ElectricField.FromVoltsPerMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs
index b96c40371f..5277d5929e 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs
@@ -83,16 +83,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricInductance(double.PositiveInfinity, ElectricInductanceUnit.Henry));
- Assert.Throws(() => new ElectricInductance(double.NegativeInfinity, ElectricInductanceUnit.Henry));
+ var exception1 = Record.Exception(() => new ElectricInductance(double.PositiveInfinity, ElectricInductanceUnit.Henry));
+ var exception2 = Record.Exception(() => new ElectricInductance(double.NegativeInfinity, ElectricInductanceUnit.Henry));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricInductance(double.NaN, ElectricInductanceUnit.Henry));
+ var exception = Record.Exception(() => new ElectricInductance(double.NaN, ElectricInductanceUnit.Henry));
+
+ Assert.Null(exception);
}
[Fact]
@@ -167,16 +172,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromHenries_WithInfinityValue_ThrowsArgumentException()
+ public void FromHenries_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricInductance.FromHenries(double.PositiveInfinity));
- Assert.Throws(() => ElectricInductance.FromHenries(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricInductance.FromHenries(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricInductance.FromHenries(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromHenries_WithNanValue_ThrowsArgumentException()
+ public void FromHenries_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricInductance.FromHenries(double.NaN));
+ var exception = Record.Exception(() => ElectricInductance.FromHenries(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs
index d1219793c5..c8afc29b25 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs
@@ -83,16 +83,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotentialAc(double.PositiveInfinity, ElectricPotentialAcUnit.VoltAc));
- Assert.Throws(() => new ElectricPotentialAc(double.NegativeInfinity, ElectricPotentialAcUnit.VoltAc));
+ var exception1 = Record.Exception(() => new ElectricPotentialAc(double.PositiveInfinity, ElectricPotentialAcUnit.VoltAc));
+ var exception2 = Record.Exception(() => new ElectricPotentialAc(double.NegativeInfinity, ElectricPotentialAcUnit.VoltAc));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotentialAc(double.NaN, ElectricPotentialAcUnit.VoltAc));
+ var exception = Record.Exception(() => new ElectricPotentialAc(double.NaN, ElectricPotentialAcUnit.VoltAc));
+
+ Assert.Null(exception);
}
[Fact]
@@ -167,16 +172,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromVoltsAc_WithInfinityValue_ThrowsArgumentException()
+ public void FromVoltsAc_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotentialAc.FromVoltsAc(double.PositiveInfinity));
- Assert.Throws(() => ElectricPotentialAc.FromVoltsAc(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricPotentialAc.FromVoltsAc(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricPotentialAc.FromVoltsAc(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVoltsAc_WithNanValue_ThrowsArgumentException()
+ public void FromVoltsAc_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotentialAc.FromVoltsAc(double.NaN));
+ var exception = Record.Exception(() => ElectricPotentialAc.FromVoltsAc(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs
index e30643eb12..3f496d9d3d 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs
@@ -38,74 +38,74 @@ namespace UnitsNet.Tests
// ReSharper disable once PartialTypeWithSinglePart
public abstract partial class ElectricPotentialChangeRateTestsBase : QuantityTestsBase
{
- protected abstract double KilovoltsPerHoursInOneVoltPerSecond { get; }
- protected abstract double KilovoltsPerMicrosecondsInOneVoltPerSecond { get; }
- protected abstract double KilovoltsPerMinutesInOneVoltPerSecond { get; }
- protected abstract double KilovoltsPerSecondsInOneVoltPerSecond { get; }
- protected abstract double MegavoltsPerHoursInOneVoltPerSecond { get; }
- protected abstract double MegavoltsPerMicrosecondsInOneVoltPerSecond { get; }
- protected abstract double MegavoltsPerMinutesInOneVoltPerSecond { get; }
- protected abstract double MegavoltsPerSecondsInOneVoltPerSecond { get; }
- protected abstract double MicrovoltsPerHoursInOneVoltPerSecond { get; }
- protected abstract double MicrovoltsPerMicrosecondsInOneVoltPerSecond { get; }
- protected abstract double MicrovoltsPerMinutesInOneVoltPerSecond { get; }
- protected abstract double MicrovoltsPerSecondsInOneVoltPerSecond { get; }
- protected abstract double MillivoltsPerHoursInOneVoltPerSecond { get; }
- protected abstract double MillivoltsPerMicrosecondsInOneVoltPerSecond { get; }
- protected abstract double MillivoltsPerMinutesInOneVoltPerSecond { get; }
- protected abstract double MillivoltsPerSecondsInOneVoltPerSecond { get; }
- protected abstract double VoltsPerHoursInOneVoltPerSecond { get; }
- protected abstract double VoltsPerMicrosecondsInOneVoltPerSecond { get; }
- protected abstract double VoltsPerMinutesInOneVoltPerSecond { get; }
- protected abstract double VoltsPerSecondsInOneVoltPerSecond { get; }
+ protected abstract double KilovoltsPerHourInOneVoltPerSecond { get; }
+ protected abstract double KilovoltsPerMicrosecondInOneVoltPerSecond { get; }
+ protected abstract double KilovoltsPerMinuteInOneVoltPerSecond { get; }
+ protected abstract double KilovoltsPerSecondInOneVoltPerSecond { get; }
+ protected abstract double MegavoltsPerHourInOneVoltPerSecond { get; }
+ protected abstract double MegavoltsPerMicrosecondInOneVoltPerSecond { get; }
+ protected abstract double MegavoltsPerMinuteInOneVoltPerSecond { get; }
+ protected abstract double MegavoltsPerSecondInOneVoltPerSecond { get; }
+ protected abstract double MicrovoltsPerHourInOneVoltPerSecond { get; }
+ protected abstract double MicrovoltsPerMicrosecondInOneVoltPerSecond { get; }
+ protected abstract double MicrovoltsPerMinuteInOneVoltPerSecond { get; }
+ protected abstract double MicrovoltsPerSecondInOneVoltPerSecond { get; }
+ protected abstract double MillivoltsPerHourInOneVoltPerSecond { get; }
+ protected abstract double MillivoltsPerMicrosecondInOneVoltPerSecond { get; }
+ protected abstract double MillivoltsPerMinuteInOneVoltPerSecond { get; }
+ protected abstract double MillivoltsPerSecondInOneVoltPerSecond { get; }
+ protected abstract double VoltsPerHourInOneVoltPerSecond { get; }
+ protected abstract double VoltsPerMicrosecondInOneVoltPerSecond { get; }
+ protected abstract double VoltsPerMinuteInOneVoltPerSecond { get; }
+ protected abstract double VoltsPerSecondInOneVoltPerSecond { get; }
// ReSharper disable VirtualMemberNeverOverriden.Global
- protected virtual double KilovoltsPerHoursTolerance { get { return 1e-5; } }
- protected virtual double KilovoltsPerMicrosecondsTolerance { get { return 1e-5; } }
- protected virtual double KilovoltsPerMinutesTolerance { get { return 1e-5; } }
- protected virtual double KilovoltsPerSecondsTolerance { get { return 1e-5; } }
- protected virtual double MegavoltsPerHoursTolerance { get { return 1e-5; } }
- protected virtual double MegavoltsPerMicrosecondsTolerance { get { return 1e-5; } }
- protected virtual double MegavoltsPerMinutesTolerance { get { return 1e-5; } }
- protected virtual double MegavoltsPerSecondsTolerance { get { return 1e-5; } }
- protected virtual double MicrovoltsPerHoursTolerance { get { return 1e-5; } }
- protected virtual double MicrovoltsPerMicrosecondsTolerance { get { return 1e-5; } }
- protected virtual double MicrovoltsPerMinutesTolerance { get { return 1e-5; } }
- protected virtual double MicrovoltsPerSecondsTolerance { get { return 1e-5; } }
- protected virtual double MillivoltsPerHoursTolerance { get { return 1e-5; } }
- protected virtual double MillivoltsPerMicrosecondsTolerance { get { return 1e-5; } }
- protected virtual double MillivoltsPerMinutesTolerance { get { return 1e-5; } }
- protected virtual double MillivoltsPerSecondsTolerance { get { return 1e-5; } }
- protected virtual double VoltsPerHoursTolerance { get { return 1e-5; } }
- protected virtual double VoltsPerMicrosecondsTolerance { get { return 1e-5; } }
- protected virtual double VoltsPerMinutesTolerance { get { return 1e-5; } }
- protected virtual double VoltsPerSecondsTolerance { get { return 1e-5; } }
+ protected virtual double KilovoltsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double KilovoltsPerMicrosecondTolerance { get { return 1e-5; } }
+ protected virtual double KilovoltsPerMinuteTolerance { get { return 1e-5; } }
+ protected virtual double KilovoltsPerSecondTolerance { get { return 1e-5; } }
+ protected virtual double MegavoltsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double MegavoltsPerMicrosecondTolerance { get { return 1e-5; } }
+ protected virtual double MegavoltsPerMinuteTolerance { get { return 1e-5; } }
+ protected virtual double MegavoltsPerSecondTolerance { get { return 1e-5; } }
+ protected virtual double MicrovoltsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double MicrovoltsPerMicrosecondTolerance { get { return 1e-5; } }
+ protected virtual double MicrovoltsPerMinuteTolerance { get { return 1e-5; } }
+ protected virtual double MicrovoltsPerSecondTolerance { get { return 1e-5; } }
+ protected virtual double MillivoltsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double MillivoltsPerMicrosecondTolerance { get { return 1e-5; } }
+ protected virtual double MillivoltsPerMinuteTolerance { get { return 1e-5; } }
+ protected virtual double MillivoltsPerSecondTolerance { get { return 1e-5; } }
+ protected virtual double VoltsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double VoltsPerMicrosecondTolerance { get { return 1e-5; } }
+ protected virtual double VoltsPerMinuteTolerance { get { return 1e-5; } }
+ protected virtual double VoltsPerSecondTolerance { get { return 1e-5; } }
// ReSharper restore VirtualMemberNeverOverriden.Global
protected (double UnitsInBaseUnit, double Tolerence) GetConversionFactor(ElectricPotentialChangeRateUnit unit)
{
return unit switch
{
- ElectricPotentialChangeRateUnit.KilovoltPerHour => (KilovoltsPerHoursInOneVoltPerSecond, KilovoltsPerHoursTolerance),
- ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond => (KilovoltsPerMicrosecondsInOneVoltPerSecond, KilovoltsPerMicrosecondsTolerance),
- ElectricPotentialChangeRateUnit.KilovoltPerMinute => (KilovoltsPerMinutesInOneVoltPerSecond, KilovoltsPerMinutesTolerance),
- ElectricPotentialChangeRateUnit.KilovoltPerSecond => (KilovoltsPerSecondsInOneVoltPerSecond, KilovoltsPerSecondsTolerance),
- ElectricPotentialChangeRateUnit.MegavoltPerHour => (MegavoltsPerHoursInOneVoltPerSecond, MegavoltsPerHoursTolerance),
- ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond => (MegavoltsPerMicrosecondsInOneVoltPerSecond, MegavoltsPerMicrosecondsTolerance),
- ElectricPotentialChangeRateUnit.MegavoltPerMinute => (MegavoltsPerMinutesInOneVoltPerSecond, MegavoltsPerMinutesTolerance),
- ElectricPotentialChangeRateUnit.MegavoltPerSecond => (MegavoltsPerSecondsInOneVoltPerSecond, MegavoltsPerSecondsTolerance),
- ElectricPotentialChangeRateUnit.MicrovoltPerHour => (MicrovoltsPerHoursInOneVoltPerSecond, MicrovoltsPerHoursTolerance),
- ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond => (MicrovoltsPerMicrosecondsInOneVoltPerSecond, MicrovoltsPerMicrosecondsTolerance),
- ElectricPotentialChangeRateUnit.MicrovoltPerMinute => (MicrovoltsPerMinutesInOneVoltPerSecond, MicrovoltsPerMinutesTolerance),
- ElectricPotentialChangeRateUnit.MicrovoltPerSecond => (MicrovoltsPerSecondsInOneVoltPerSecond, MicrovoltsPerSecondsTolerance),
- ElectricPotentialChangeRateUnit.MillivoltPerHour => (MillivoltsPerHoursInOneVoltPerSecond, MillivoltsPerHoursTolerance),
- ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond => (MillivoltsPerMicrosecondsInOneVoltPerSecond, MillivoltsPerMicrosecondsTolerance),
- ElectricPotentialChangeRateUnit.MillivoltPerMinute => (MillivoltsPerMinutesInOneVoltPerSecond, MillivoltsPerMinutesTolerance),
- ElectricPotentialChangeRateUnit.MillivoltPerSecond => (MillivoltsPerSecondsInOneVoltPerSecond, MillivoltsPerSecondsTolerance),
- ElectricPotentialChangeRateUnit.VoltPerHour => (VoltsPerHoursInOneVoltPerSecond, VoltsPerHoursTolerance),
- ElectricPotentialChangeRateUnit.VoltPerMicrosecond => (VoltsPerMicrosecondsInOneVoltPerSecond, VoltsPerMicrosecondsTolerance),
- ElectricPotentialChangeRateUnit.VoltPerMinute => (VoltsPerMinutesInOneVoltPerSecond, VoltsPerMinutesTolerance),
- ElectricPotentialChangeRateUnit.VoltPerSecond => (VoltsPerSecondsInOneVoltPerSecond, VoltsPerSecondsTolerance),
+ ElectricPotentialChangeRateUnit.KilovoltPerHour => (KilovoltsPerHourInOneVoltPerSecond, KilovoltsPerHourTolerance),
+ ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond => (KilovoltsPerMicrosecondInOneVoltPerSecond, KilovoltsPerMicrosecondTolerance),
+ ElectricPotentialChangeRateUnit.KilovoltPerMinute => (KilovoltsPerMinuteInOneVoltPerSecond, KilovoltsPerMinuteTolerance),
+ ElectricPotentialChangeRateUnit.KilovoltPerSecond => (KilovoltsPerSecondInOneVoltPerSecond, KilovoltsPerSecondTolerance),
+ ElectricPotentialChangeRateUnit.MegavoltPerHour => (MegavoltsPerHourInOneVoltPerSecond, MegavoltsPerHourTolerance),
+ ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond => (MegavoltsPerMicrosecondInOneVoltPerSecond, MegavoltsPerMicrosecondTolerance),
+ ElectricPotentialChangeRateUnit.MegavoltPerMinute => (MegavoltsPerMinuteInOneVoltPerSecond, MegavoltsPerMinuteTolerance),
+ ElectricPotentialChangeRateUnit.MegavoltPerSecond => (MegavoltsPerSecondInOneVoltPerSecond, MegavoltsPerSecondTolerance),
+ ElectricPotentialChangeRateUnit.MicrovoltPerHour => (MicrovoltsPerHourInOneVoltPerSecond, MicrovoltsPerHourTolerance),
+ ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond => (MicrovoltsPerMicrosecondInOneVoltPerSecond, MicrovoltsPerMicrosecondTolerance),
+ ElectricPotentialChangeRateUnit.MicrovoltPerMinute => (MicrovoltsPerMinuteInOneVoltPerSecond, MicrovoltsPerMinuteTolerance),
+ ElectricPotentialChangeRateUnit.MicrovoltPerSecond => (MicrovoltsPerSecondInOneVoltPerSecond, MicrovoltsPerSecondTolerance),
+ ElectricPotentialChangeRateUnit.MillivoltPerHour => (MillivoltsPerHourInOneVoltPerSecond, MillivoltsPerHourTolerance),
+ ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond => (MillivoltsPerMicrosecondInOneVoltPerSecond, MillivoltsPerMicrosecondTolerance),
+ ElectricPotentialChangeRateUnit.MillivoltPerMinute => (MillivoltsPerMinuteInOneVoltPerSecond, MillivoltsPerMinuteTolerance),
+ ElectricPotentialChangeRateUnit.MillivoltPerSecond => (MillivoltsPerSecondInOneVoltPerSecond, MillivoltsPerSecondTolerance),
+ ElectricPotentialChangeRateUnit.VoltPerHour => (VoltsPerHourInOneVoltPerSecond, VoltsPerHourTolerance),
+ ElectricPotentialChangeRateUnit.VoltPerMicrosecond => (VoltsPerMicrosecondInOneVoltPerSecond, VoltsPerMicrosecondTolerance),
+ ElectricPotentialChangeRateUnit.VoltPerMinute => (VoltsPerMinuteInOneVoltPerSecond, VoltsPerMinuteTolerance),
+ ElectricPotentialChangeRateUnit.VoltPerSecond => (VoltsPerSecondInOneVoltPerSecond, VoltsPerSecondTolerance),
_ => throw new NotSupportedException()
};
}
@@ -143,16 +143,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotentialChangeRate(double.PositiveInfinity, ElectricPotentialChangeRateUnit.VoltPerSecond));
- Assert.Throws(() => new ElectricPotentialChangeRate(double.NegativeInfinity, ElectricPotentialChangeRateUnit.VoltPerSecond));
+ var exception1 = Record.Exception(() => new ElectricPotentialChangeRate(double.PositiveInfinity, ElectricPotentialChangeRateUnit.VoltPerSecond));
+ var exception2 = Record.Exception(() => new ElectricPotentialChangeRate(double.NegativeInfinity, ElectricPotentialChangeRateUnit.VoltPerSecond));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotentialChangeRate(double.NaN, ElectricPotentialChangeRateUnit.VoltPerSecond));
+ var exception = Record.Exception(() => new ElectricPotentialChangeRate(double.NaN, ElectricPotentialChangeRateUnit.VoltPerSecond));
+
+ Assert.Null(exception);
}
[Fact]
@@ -193,151 +198,156 @@ public void ElectricPotentialChangeRate_QuantityInfo_ReturnsQuantityInfoDescribi
[Fact]
public void VoltPerSecondToElectricPotentialChangeRateUnits()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- AssertEx.EqualTolerance(KilovoltsPerHoursInOneVoltPerSecond, voltpersecond.KilovoltsPerHours, KilovoltsPerHoursTolerance);
- AssertEx.EqualTolerance(KilovoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.KilovoltsPerMicroseconds, KilovoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(KilovoltsPerMinutesInOneVoltPerSecond, voltpersecond.KilovoltsPerMinutes, KilovoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(KilovoltsPerSecondsInOneVoltPerSecond, voltpersecond.KilovoltsPerSeconds, KilovoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(MegavoltsPerHoursInOneVoltPerSecond, voltpersecond.MegavoltsPerHours, MegavoltsPerHoursTolerance);
- AssertEx.EqualTolerance(MegavoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.MegavoltsPerMicroseconds, MegavoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(MegavoltsPerMinutesInOneVoltPerSecond, voltpersecond.MegavoltsPerMinutes, MegavoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(MegavoltsPerSecondsInOneVoltPerSecond, voltpersecond.MegavoltsPerSeconds, MegavoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerHoursInOneVoltPerSecond, voltpersecond.MicrovoltsPerHours, MicrovoltsPerHoursTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.MicrovoltsPerMicroseconds, MicrovoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerMinutesInOneVoltPerSecond, voltpersecond.MicrovoltsPerMinutes, MicrovoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerSecondsInOneVoltPerSecond, voltpersecond.MicrovoltsPerSeconds, MicrovoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(MillivoltsPerHoursInOneVoltPerSecond, voltpersecond.MillivoltsPerHours, MillivoltsPerHoursTolerance);
- AssertEx.EqualTolerance(MillivoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.MillivoltsPerMicroseconds, MillivoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(MillivoltsPerMinutesInOneVoltPerSecond, voltpersecond.MillivoltsPerMinutes, MillivoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(MillivoltsPerSecondsInOneVoltPerSecond, voltpersecond.MillivoltsPerSeconds, MillivoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(VoltsPerHoursInOneVoltPerSecond, voltpersecond.VoltsPerHours, VoltsPerHoursTolerance);
- AssertEx.EqualTolerance(VoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.VoltsPerMicroseconds, VoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(VoltsPerMinutesInOneVoltPerSecond, voltpersecond.VoltsPerMinutes, VoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(VoltsPerSecondsInOneVoltPerSecond, voltpersecond.VoltsPerSeconds, VoltsPerSecondsTolerance);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ AssertEx.EqualTolerance(KilovoltsPerHourInOneVoltPerSecond, voltpersecond.KilovoltsPerHour, KilovoltsPerHourTolerance);
+ AssertEx.EqualTolerance(KilovoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.KilovoltsPerMicrosecond, KilovoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(KilovoltsPerMinuteInOneVoltPerSecond, voltpersecond.KilovoltsPerMinute, KilovoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(KilovoltsPerSecondInOneVoltPerSecond, voltpersecond.KilovoltsPerSecond, KilovoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerHourInOneVoltPerSecond, voltpersecond.MegavoltsPerHour, MegavoltsPerHourTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.MegavoltsPerMicrosecond, MegavoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerMinuteInOneVoltPerSecond, voltpersecond.MegavoltsPerMinute, MegavoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerSecondInOneVoltPerSecond, voltpersecond.MegavoltsPerSecond, MegavoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerHourInOneVoltPerSecond, voltpersecond.MicrovoltsPerHour, MicrovoltsPerHourTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.MicrovoltsPerMicrosecond, MicrovoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerMinuteInOneVoltPerSecond, voltpersecond.MicrovoltsPerMinute, MicrovoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerSecondInOneVoltPerSecond, voltpersecond.MicrovoltsPerSecond, MicrovoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerHourInOneVoltPerSecond, voltpersecond.MillivoltsPerHour, MillivoltsPerHourTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.MillivoltsPerMicrosecond, MillivoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerMinuteInOneVoltPerSecond, voltpersecond.MillivoltsPerMinute, MillivoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerSecondInOneVoltPerSecond, voltpersecond.MillivoltsPerSecond, MillivoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(VoltsPerHourInOneVoltPerSecond, voltpersecond.VoltsPerHour, VoltsPerHourTolerance);
+ AssertEx.EqualTolerance(VoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.VoltsPerMicrosecond, VoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(VoltsPerMinuteInOneVoltPerSecond, voltpersecond.VoltsPerMinute, VoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(VoltsPerSecondInOneVoltPerSecond, voltpersecond.VoltsPerSecond, VoltsPerSecondTolerance);
}
[Fact]
public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
{
var quantity00 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.KilovoltPerHour);
- AssertEx.EqualTolerance(1, quantity00.KilovoltsPerHours, KilovoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, quantity00.KilovoltsPerHour, KilovoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerHour, quantity00.Unit);
var quantity01 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond);
- AssertEx.EqualTolerance(1, quantity01.KilovoltsPerMicroseconds, KilovoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity01.KilovoltsPerMicrosecond, KilovoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond, quantity01.Unit);
var quantity02 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.KilovoltPerMinute);
- AssertEx.EqualTolerance(1, quantity02.KilovoltsPerMinutes, KilovoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, quantity02.KilovoltsPerMinute, KilovoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerMinute, quantity02.Unit);
var quantity03 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.KilovoltPerSecond);
- AssertEx.EqualTolerance(1, quantity03.KilovoltsPerSeconds, KilovoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity03.KilovoltsPerSecond, KilovoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerSecond, quantity03.Unit);
var quantity04 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MegavoltPerHour);
- AssertEx.EqualTolerance(1, quantity04.MegavoltsPerHours, MegavoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, quantity04.MegavoltsPerHour, MegavoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerHour, quantity04.Unit);
var quantity05 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond);
- AssertEx.EqualTolerance(1, quantity05.MegavoltsPerMicroseconds, MegavoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity05.MegavoltsPerMicrosecond, MegavoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond, quantity05.Unit);
var quantity06 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MegavoltPerMinute);
- AssertEx.EqualTolerance(1, quantity06.MegavoltsPerMinutes, MegavoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, quantity06.MegavoltsPerMinute, MegavoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerMinute, quantity06.Unit);
var quantity07 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MegavoltPerSecond);
- AssertEx.EqualTolerance(1, quantity07.MegavoltsPerSeconds, MegavoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity07.MegavoltsPerSecond, MegavoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerSecond, quantity07.Unit);
var quantity08 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MicrovoltPerHour);
- AssertEx.EqualTolerance(1, quantity08.MicrovoltsPerHours, MicrovoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, quantity08.MicrovoltsPerHour, MicrovoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerHour, quantity08.Unit);
var quantity09 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond);
- AssertEx.EqualTolerance(1, quantity09.MicrovoltsPerMicroseconds, MicrovoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity09.MicrovoltsPerMicrosecond, MicrovoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond, quantity09.Unit);
var quantity10 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MicrovoltPerMinute);
- AssertEx.EqualTolerance(1, quantity10.MicrovoltsPerMinutes, MicrovoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, quantity10.MicrovoltsPerMinute, MicrovoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerMinute, quantity10.Unit);
var quantity11 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MicrovoltPerSecond);
- AssertEx.EqualTolerance(1, quantity11.MicrovoltsPerSeconds, MicrovoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity11.MicrovoltsPerSecond, MicrovoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerSecond, quantity11.Unit);
var quantity12 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MillivoltPerHour);
- AssertEx.EqualTolerance(1, quantity12.MillivoltsPerHours, MillivoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, quantity12.MillivoltsPerHour, MillivoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerHour, quantity12.Unit);
var quantity13 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond);
- AssertEx.EqualTolerance(1, quantity13.MillivoltsPerMicroseconds, MillivoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity13.MillivoltsPerMicrosecond, MillivoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond, quantity13.Unit);
var quantity14 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MillivoltPerMinute);
- AssertEx.EqualTolerance(1, quantity14.MillivoltsPerMinutes, MillivoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, quantity14.MillivoltsPerMinute, MillivoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerMinute, quantity14.Unit);
var quantity15 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.MillivoltPerSecond);
- AssertEx.EqualTolerance(1, quantity15.MillivoltsPerSeconds, MillivoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity15.MillivoltsPerSecond, MillivoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerSecond, quantity15.Unit);
var quantity16 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.VoltPerHour);
- AssertEx.EqualTolerance(1, quantity16.VoltsPerHours, VoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, quantity16.VoltsPerHour, VoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerHour, quantity16.Unit);
var quantity17 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.VoltPerMicrosecond);
- AssertEx.EqualTolerance(1, quantity17.VoltsPerMicroseconds, VoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity17.VoltsPerMicrosecond, VoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerMicrosecond, quantity17.Unit);
var quantity18 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.VoltPerMinute);
- AssertEx.EqualTolerance(1, quantity18.VoltsPerMinutes, VoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, quantity18.VoltsPerMinute, VoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerMinute, quantity18.Unit);
var quantity19 = ElectricPotentialChangeRate.From(1, ElectricPotentialChangeRateUnit.VoltPerSecond);
- AssertEx.EqualTolerance(1, quantity19.VoltsPerSeconds, VoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, quantity19.VoltsPerSecond, VoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerSecond, quantity19.Unit);
}
[Fact]
- public void FromVoltsPerSeconds_WithInfinityValue_ThrowsArgumentException()
+ public void FromVoltsPerSecond_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotentialChangeRate.FromVoltsPerSeconds(double.PositiveInfinity));
- Assert.Throws(() => ElectricPotentialChangeRate.FromVoltsPerSeconds(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricPotentialChangeRate.FromVoltsPerSecond(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricPotentialChangeRate.FromVoltsPerSecond(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVoltsPerSeconds_WithNanValue_ThrowsArgumentException()
+ public void FromVoltsPerSecond_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotentialChangeRate.FromVoltsPerSeconds(double.NaN));
+ var exception = Record.Exception(() => ElectricPotentialChangeRate.FromVoltsPerSecond(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
public void As()
{
- var voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- AssertEx.EqualTolerance(KilovoltsPerHoursInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerHour), KilovoltsPerHoursTolerance);
- AssertEx.EqualTolerance(KilovoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond), KilovoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(KilovoltsPerMinutesInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerMinute), KilovoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(KilovoltsPerSecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerSecond), KilovoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(MegavoltsPerHoursInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerHour), MegavoltsPerHoursTolerance);
- AssertEx.EqualTolerance(MegavoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond), MegavoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(MegavoltsPerMinutesInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerMinute), MegavoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(MegavoltsPerSecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerSecond), MegavoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerHoursInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerHour), MicrovoltsPerHoursTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond), MicrovoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerMinutesInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerMinute), MicrovoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(MicrovoltsPerSecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerSecond), MicrovoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(MillivoltsPerHoursInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerHour), MillivoltsPerHoursTolerance);
- AssertEx.EqualTolerance(MillivoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond), MillivoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(MillivoltsPerMinutesInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerMinute), MillivoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(MillivoltsPerSecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerSecond), MillivoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(VoltsPerHoursInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerHour), VoltsPerHoursTolerance);
- AssertEx.EqualTolerance(VoltsPerMicrosecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerMicrosecond), VoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(VoltsPerMinutesInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerMinute), VoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(VoltsPerSecondsInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerSecond), VoltsPerSecondsTolerance);
+ var voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ AssertEx.EqualTolerance(KilovoltsPerHourInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerHour), KilovoltsPerHourTolerance);
+ AssertEx.EqualTolerance(KilovoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond), KilovoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(KilovoltsPerMinuteInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerMinute), KilovoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(KilovoltsPerSecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.KilovoltPerSecond), KilovoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerHourInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerHour), MegavoltsPerHourTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond), MegavoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerMinuteInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerMinute), MegavoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(MegavoltsPerSecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MegavoltPerSecond), MegavoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerHourInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerHour), MicrovoltsPerHourTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond), MicrovoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerMinuteInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerMinute), MicrovoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(MicrovoltsPerSecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MicrovoltPerSecond), MicrovoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerHourInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerHour), MillivoltsPerHourTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond), MillivoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerMinuteInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerMinute), MillivoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(MillivoltsPerSecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.MillivoltPerSecond), MillivoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(VoltsPerHourInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerHour), VoltsPerHourTolerance);
+ AssertEx.EqualTolerance(VoltsPerMicrosecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerMicrosecond), VoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(VoltsPerMinuteInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerMinute), VoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(VoltsPerSecondInOneVoltPerSecond, voltpersecond.As(ElectricPotentialChangeRateUnit.VoltPerSecond), VoltsPerSecondTolerance);
}
[Fact]
@@ -363,140 +373,140 @@ public void Parse()
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 kV/h", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerHours, KilovoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerHour, KilovoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerHour, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 kV/μs", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerMicroseconds, KilovoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerMicrosecond, KilovoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 kV/min", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerMinutes, KilovoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerMinute, KilovoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerMinute, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 kV/s", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerSeconds, KilovoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerSecond, KilovoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerSecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 MV/h", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MegavoltsPerHours, MegavoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.MegavoltsPerHour, MegavoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerHour, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 MV/μs", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MegavoltsPerMicroseconds, MegavoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MegavoltsPerMicrosecond, MegavoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 MV/min", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MegavoltsPerMinutes, MegavoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.MegavoltsPerMinute, MegavoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerMinute, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 MV/s", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MegavoltsPerSeconds, MegavoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MegavoltsPerSecond, MegavoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MegavoltPerSecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 µV/h", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerHours, MicrovoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerHour, MicrovoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerHour, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 µV/μs", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMicroseconds, MicrovoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMicrosecond, MicrovoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 µV/min", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMinutes, MicrovoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMinute, MicrovoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerMinute, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 µV/s", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerSeconds, MicrovoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerSecond, MicrovoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerSecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 mV/h", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MillivoltsPerHours, MillivoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.MillivoltsPerHour, MillivoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerHour, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 mV/μs", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MillivoltsPerMicroseconds, MillivoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MillivoltsPerMicrosecond, MillivoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 mV/min", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MillivoltsPerMinutes, MillivoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.MillivoltsPerMinute, MillivoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerMinute, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 mV/s", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.MillivoltsPerSeconds, MillivoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MillivoltsPerSecond, MillivoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MillivoltPerSecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 V/h", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.VoltsPerHours, VoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerHour, VoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerHour, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 V/μs", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.VoltsPerMicroseconds, VoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerMicrosecond, VoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerMicrosecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 V/min", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.VoltsPerMinutes, VoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerMinute, VoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerMinute, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
try
{
var parsed = ElectricPotentialChangeRate.Parse("1 V/s", CultureInfo.GetCultureInfo("en-US"));
- AssertEx.EqualTolerance(1, parsed.VoltsPerSeconds, VoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerSecond, VoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerSecond, parsed.Unit);
} catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ }
@@ -507,73 +517,73 @@ public void TryParse()
{
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 kV/h", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerHours, KilovoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerHour, KilovoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerHour, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 kV/μs", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerMicroseconds, KilovoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerMicrosecond, KilovoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 kV/min", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerMinutes, KilovoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerMinute, KilovoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerMinute, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 kV/s", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.KilovoltsPerSeconds, KilovoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.KilovoltsPerSecond, KilovoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.KilovoltPerSecond, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 µV/h", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerHours, MicrovoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerHour, MicrovoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerHour, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 µV/μs", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMicroseconds, MicrovoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMicrosecond, MicrovoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 µV/min", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMinutes, MicrovoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerMinute, MicrovoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerMinute, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 µV/s", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.MicrovoltsPerSeconds, MicrovoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.MicrovoltsPerSecond, MicrovoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.MicrovoltPerSecond, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 V/h", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.VoltsPerHours, VoltsPerHoursTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerHour, VoltsPerHourTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerHour, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 V/μs", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.VoltsPerMicroseconds, VoltsPerMicrosecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerMicrosecond, VoltsPerMicrosecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerMicrosecond, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 V/min", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.VoltsPerMinutes, VoltsPerMinutesTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerMinute, VoltsPerMinuteTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerMinute, parsed.Unit);
}
{
Assert.True(ElectricPotentialChangeRate.TryParse("1 V/s", CultureInfo.GetCultureInfo("en-US"), out var parsed));
- AssertEx.EqualTolerance(1, parsed.VoltsPerSeconds, VoltsPerSecondsTolerance);
+ AssertEx.EqualTolerance(1, parsed.VoltsPerSecond, VoltsPerSecondTolerance);
Assert.Equal(ElectricPotentialChangeRateUnit.VoltPerSecond, parsed.Unit);
}
@@ -814,63 +824,63 @@ public virtual void ToUnit_FromDefaultQuantity_ReturnsQuantityWithGivenUnit(Elec
[Fact]
public void ConversionRoundTrip()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerHours(voltpersecond.KilovoltsPerHours).VoltsPerSeconds, KilovoltsPerHoursTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerMicroseconds(voltpersecond.KilovoltsPerMicroseconds).VoltsPerSeconds, KilovoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerMinutes(voltpersecond.KilovoltsPerMinutes).VoltsPerSeconds, KilovoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerSeconds(voltpersecond.KilovoltsPerSeconds).VoltsPerSeconds, KilovoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerHours(voltpersecond.MegavoltsPerHours).VoltsPerSeconds, MegavoltsPerHoursTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerMicroseconds(voltpersecond.MegavoltsPerMicroseconds).VoltsPerSeconds, MegavoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerMinutes(voltpersecond.MegavoltsPerMinutes).VoltsPerSeconds, MegavoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerSeconds(voltpersecond.MegavoltsPerSeconds).VoltsPerSeconds, MegavoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerHours(voltpersecond.MicrovoltsPerHours).VoltsPerSeconds, MicrovoltsPerHoursTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerMicroseconds(voltpersecond.MicrovoltsPerMicroseconds).VoltsPerSeconds, MicrovoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerMinutes(voltpersecond.MicrovoltsPerMinutes).VoltsPerSeconds, MicrovoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerSeconds(voltpersecond.MicrovoltsPerSeconds).VoltsPerSeconds, MicrovoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerHours(voltpersecond.MillivoltsPerHours).VoltsPerSeconds, MillivoltsPerHoursTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerMicroseconds(voltpersecond.MillivoltsPerMicroseconds).VoltsPerSeconds, MillivoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerMinutes(voltpersecond.MillivoltsPerMinutes).VoltsPerSeconds, MillivoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerSeconds(voltpersecond.MillivoltsPerSeconds).VoltsPerSeconds, MillivoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerHours(voltpersecond.VoltsPerHours).VoltsPerSeconds, VoltsPerHoursTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerMicroseconds(voltpersecond.VoltsPerMicroseconds).VoltsPerSeconds, VoltsPerMicrosecondsTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerMinutes(voltpersecond.VoltsPerMinutes).VoltsPerSeconds, VoltsPerMinutesTolerance);
- AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerSeconds(voltpersecond.VoltsPerSeconds).VoltsPerSeconds, VoltsPerSecondsTolerance);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerHour(voltpersecond.KilovoltsPerHour).VoltsPerSecond, KilovoltsPerHourTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerMicrosecond(voltpersecond.KilovoltsPerMicrosecond).VoltsPerSecond, KilovoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerMinute(voltpersecond.KilovoltsPerMinute).VoltsPerSecond, KilovoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromKilovoltsPerSecond(voltpersecond.KilovoltsPerSecond).VoltsPerSecond, KilovoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerHour(voltpersecond.MegavoltsPerHour).VoltsPerSecond, MegavoltsPerHourTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerMicrosecond(voltpersecond.MegavoltsPerMicrosecond).VoltsPerSecond, MegavoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerMinute(voltpersecond.MegavoltsPerMinute).VoltsPerSecond, MegavoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMegavoltsPerSecond(voltpersecond.MegavoltsPerSecond).VoltsPerSecond, MegavoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerHour(voltpersecond.MicrovoltsPerHour).VoltsPerSecond, MicrovoltsPerHourTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerMicrosecond(voltpersecond.MicrovoltsPerMicrosecond).VoltsPerSecond, MicrovoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerMinute(voltpersecond.MicrovoltsPerMinute).VoltsPerSecond, MicrovoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMicrovoltsPerSecond(voltpersecond.MicrovoltsPerSecond).VoltsPerSecond, MicrovoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerHour(voltpersecond.MillivoltsPerHour).VoltsPerSecond, MillivoltsPerHourTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerMicrosecond(voltpersecond.MillivoltsPerMicrosecond).VoltsPerSecond, MillivoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerMinute(voltpersecond.MillivoltsPerMinute).VoltsPerSecond, MillivoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromMillivoltsPerSecond(voltpersecond.MillivoltsPerSecond).VoltsPerSecond, MillivoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerHour(voltpersecond.VoltsPerHour).VoltsPerSecond, VoltsPerHourTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerMicrosecond(voltpersecond.VoltsPerMicrosecond).VoltsPerSecond, VoltsPerMicrosecondTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerMinute(voltpersecond.VoltsPerMinute).VoltsPerSecond, VoltsPerMinuteTolerance);
+ AssertEx.EqualTolerance(1, ElectricPotentialChangeRate.FromVoltsPerSecond(voltpersecond.VoltsPerSecond).VoltsPerSecond, VoltsPerSecondTolerance);
}
[Fact]
public void ArithmeticOperators()
{
- ElectricPotentialChangeRate v = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- AssertEx.EqualTolerance(-1, -v.VoltsPerSeconds, VoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(2, (ElectricPotentialChangeRate.FromVoltsPerSeconds(3)-v).VoltsPerSeconds, VoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(2, (v + v).VoltsPerSeconds, VoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(10, (v*10).VoltsPerSeconds, VoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(10, (10*v).VoltsPerSeconds, VoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(2, (ElectricPotentialChangeRate.FromVoltsPerSeconds(10)/5).VoltsPerSeconds, VoltsPerSecondsTolerance);
- AssertEx.EqualTolerance(2, ElectricPotentialChangeRate.FromVoltsPerSeconds(10)/ElectricPotentialChangeRate.FromVoltsPerSeconds(5), VoltsPerSecondsTolerance);
+ ElectricPotentialChangeRate v = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ AssertEx.EqualTolerance(-1, -v.VoltsPerSecond, VoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(2, (ElectricPotentialChangeRate.FromVoltsPerSecond(3)-v).VoltsPerSecond, VoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(2, (v + v).VoltsPerSecond, VoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(10, (v*10).VoltsPerSecond, VoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(10, (10*v).VoltsPerSecond, VoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(2, (ElectricPotentialChangeRate.FromVoltsPerSecond(10)/5).VoltsPerSecond, VoltsPerSecondTolerance);
+ AssertEx.EqualTolerance(2, ElectricPotentialChangeRate.FromVoltsPerSecond(10)/ElectricPotentialChangeRate.FromVoltsPerSecond(5), VoltsPerSecondTolerance);
}
[Fact]
public void ComparisonOperators()
{
- ElectricPotentialChangeRate oneVoltPerSecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- ElectricPotentialChangeRate twoVoltsPerSeconds = ElectricPotentialChangeRate.FromVoltsPerSeconds(2);
+ ElectricPotentialChangeRate oneVoltPerSecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ ElectricPotentialChangeRate twoVoltsPerSecond = ElectricPotentialChangeRate.FromVoltsPerSecond(2);
- Assert.True(oneVoltPerSecond < twoVoltsPerSeconds);
- Assert.True(oneVoltPerSecond <= twoVoltsPerSeconds);
- Assert.True(twoVoltsPerSeconds > oneVoltPerSecond);
- Assert.True(twoVoltsPerSeconds >= oneVoltPerSecond);
+ Assert.True(oneVoltPerSecond < twoVoltsPerSecond);
+ Assert.True(oneVoltPerSecond <= twoVoltsPerSecond);
+ Assert.True(twoVoltsPerSecond > oneVoltPerSecond);
+ Assert.True(twoVoltsPerSecond >= oneVoltPerSecond);
- Assert.False(oneVoltPerSecond > twoVoltsPerSeconds);
- Assert.False(oneVoltPerSecond >= twoVoltsPerSeconds);
- Assert.False(twoVoltsPerSeconds < oneVoltPerSecond);
- Assert.False(twoVoltsPerSeconds <= oneVoltPerSecond);
+ Assert.False(oneVoltPerSecond > twoVoltsPerSecond);
+ Assert.False(oneVoltPerSecond >= twoVoltsPerSecond);
+ Assert.False(twoVoltsPerSecond < oneVoltPerSecond);
+ Assert.False(twoVoltsPerSecond <= oneVoltPerSecond);
}
[Fact]
public void CompareToIsImplemented()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
Assert.Equal(0, voltpersecond.CompareTo(voltpersecond));
Assert.True(voltpersecond.CompareTo(ElectricPotentialChangeRate.Zero) > 0);
Assert.True(ElectricPotentialChangeRate.Zero.CompareTo(voltpersecond) < 0);
@@ -879,14 +889,14 @@ public void CompareToIsImplemented()
[Fact]
public void CompareToThrowsOnTypeMismatch()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
Assert.Throws(() => voltpersecond.CompareTo(new object()));
}
[Fact]
public void CompareToThrowsOnNull()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
Assert.Throws(() => voltpersecond.CompareTo(null));
}
@@ -934,29 +944,29 @@ public void Equals_Null_ReturnsFalse()
[Fact]
public void Equals_RelativeTolerance_IsImplemented()
{
- var v = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- Assert.True(v.Equals(ElectricPotentialChangeRate.FromVoltsPerSeconds(1), VoltsPerSecondsTolerance, ComparisonType.Relative));
- Assert.False(v.Equals(ElectricPotentialChangeRate.Zero, VoltsPerSecondsTolerance, ComparisonType.Relative));
+ var v = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ Assert.True(v.Equals(ElectricPotentialChangeRate.FromVoltsPerSecond(1), VoltsPerSecondTolerance, ComparisonType.Relative));
+ Assert.False(v.Equals(ElectricPotentialChangeRate.Zero, VoltsPerSecondTolerance, ComparisonType.Relative));
}
[Fact]
public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException()
{
- var v = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
- Assert.Throws(() => v.Equals(ElectricPotentialChangeRate.FromVoltsPerSeconds(1), -1, ComparisonType.Relative));
+ var v = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
+ Assert.Throws(() => v.Equals(ElectricPotentialChangeRate.FromVoltsPerSecond(1), -1, ComparisonType.Relative));
}
[Fact]
public void EqualsReturnsFalseOnTypeMismatch()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
Assert.False(voltpersecond.Equals(new object()));
}
[Fact]
public void EqualsReturnsFalseOnNull()
{
- ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSeconds(1);
+ ElectricPotentialChangeRate voltpersecond = ElectricPotentialChangeRate.FromVoltsPerSecond(1);
Assert.False(voltpersecond.Equals(null));
}
@@ -1070,7 +1080,7 @@ public void ToString_SFormatAndCulture_FormatsNumberWithGivenDigitsAfterRadixFor
[InlineData("en-US")]
public void ToString_NullFormat_DefaultsToGeneralFormat(string cultureName)
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
CultureInfo formatProvider = cultureName == null
? null
: CultureInfo.GetCultureInfo(cultureName);
@@ -1083,154 +1093,154 @@ public void ToString_NullFormat_DefaultsToGeneralFormat(string cultureName)
[InlineData("g")]
public void ToString_NullProvider_EqualsCurrentCulture(string format)
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(quantity.ToString(format, CultureInfo.CurrentCulture), quantity.ToString(format, null));
}
[Fact]
public void Convert_ToBool_ThrowsInvalidCastException()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Throws(() => Convert.ToBoolean(quantity));
}
[Fact]
public void Convert_ToByte_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((byte)quantity.Value, Convert.ToByte(quantity));
}
[Fact]
public void Convert_ToChar_ThrowsInvalidCastException()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Throws(() => Convert.ToChar(quantity));
}
[Fact]
public void Convert_ToDateTime_ThrowsInvalidCastException()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Throws(() => Convert.ToDateTime(quantity));
}
[Fact]
public void Convert_ToDecimal_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity));
}
[Fact]
public void Convert_ToDouble_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((double)quantity.Value, Convert.ToDouble(quantity));
}
[Fact]
public void Convert_ToInt16_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((short)quantity.Value, Convert.ToInt16(quantity));
}
[Fact]
public void Convert_ToInt32_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((int)quantity.Value, Convert.ToInt32(quantity));
}
[Fact]
public void Convert_ToInt64_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((long)quantity.Value, Convert.ToInt64(quantity));
}
[Fact]
public void Convert_ToSByte_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((sbyte)quantity.Value, Convert.ToSByte(quantity));
}
[Fact]
public void Convert_ToSingle_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity));
}
[Fact]
public void Convert_ToString_EqualsToString()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(quantity.ToString(), Convert.ToString(quantity));
}
[Fact]
public void Convert_ToUInt16_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((ushort)quantity.Value, Convert.ToUInt16(quantity));
}
[Fact]
public void Convert_ToUInt32_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((uint)quantity.Value, Convert.ToUInt32(quantity));
}
[Fact]
public void Convert_ToUInt64_EqualsValueAsSameType()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity));
}
[Fact]
public void Convert_ChangeType_SelfType_EqualsSelf()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(ElectricPotentialChangeRate)));
}
[Fact]
public void Convert_ChangeType_UnitType_EqualsUnit()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(ElectricPotentialChangeRateUnit)));
}
[Fact]
public void Convert_ChangeType_QuantityInfo_EqualsQuantityInfo()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(ElectricPotentialChangeRate.Info, Convert.ChangeType(quantity, typeof(QuantityInfo)));
}
[Fact]
public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(ElectricPotentialChangeRate.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions)));
}
[Fact]
public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Throws(() => Convert.ChangeType(quantity, typeof(QuantityFormatter)));
}
[Fact]
public void GetHashCode_Equals()
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(1.0);
Assert.Equal(new {ElectricPotentialChangeRate.Info.Name, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode());
}
@@ -1239,8 +1249,8 @@ public void GetHashCode_Equals()
[InlineData(-1.0)]
public void NegationOperator_ReturnsQuantity_WithNegatedValue(double value)
{
- var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(value);
- Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerSeconds(-value), -quantity);
+ var quantity = ElectricPotentialChangeRate.FromVoltsPerSecond(value);
+ Assert.Equal(ElectricPotentialChangeRate.FromVoltsPerSecond(-value), -quantity);
}
}
}
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs
index 15669faa28..ce6513981b 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs
@@ -83,16 +83,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotentialDc(double.PositiveInfinity, ElectricPotentialDcUnit.VoltDc));
- Assert.Throws(() => new ElectricPotentialDc(double.NegativeInfinity, ElectricPotentialDcUnit.VoltDc));
+ var exception1 = Record.Exception(() => new ElectricPotentialDc(double.PositiveInfinity, ElectricPotentialDcUnit.VoltDc));
+ var exception2 = Record.Exception(() => new ElectricPotentialDc(double.NegativeInfinity, ElectricPotentialDcUnit.VoltDc));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotentialDc(double.NaN, ElectricPotentialDcUnit.VoltDc));
+ var exception = Record.Exception(() => new ElectricPotentialDc(double.NaN, ElectricPotentialDcUnit.VoltDc));
+
+ Assert.Null(exception);
}
[Fact]
@@ -167,16 +172,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromVoltsDc_WithInfinityValue_ThrowsArgumentException()
+ public void FromVoltsDc_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotentialDc.FromVoltsDc(double.PositiveInfinity));
- Assert.Throws(() => ElectricPotentialDc.FromVoltsDc(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricPotentialDc.FromVoltsDc(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricPotentialDc.FromVoltsDc(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVoltsDc_WithNanValue_ThrowsArgumentException()
+ public void FromVoltsDc_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotentialDc.FromVoltsDc(double.NaN));
+ var exception = Record.Exception(() => ElectricPotentialDc.FromVoltsDc(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs
index b375ce83d4..7dc092cc39 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs
@@ -87,16 +87,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotential(double.PositiveInfinity, ElectricPotentialUnit.Volt));
- Assert.Throws(() => new ElectricPotential(double.NegativeInfinity, ElectricPotentialUnit.Volt));
+ var exception1 = Record.Exception(() => new ElectricPotential(double.PositiveInfinity, ElectricPotentialUnit.Volt));
+ var exception2 = Record.Exception(() => new ElectricPotential(double.NegativeInfinity, ElectricPotentialUnit.Volt));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricPotential(double.NaN, ElectricPotentialUnit.Volt));
+ var exception = Record.Exception(() => new ElectricPotential(double.NaN, ElectricPotentialUnit.Volt));
+
+ Assert.Null(exception);
}
[Fact]
@@ -176,16 +181,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromVolts_WithInfinityValue_ThrowsArgumentException()
+ public void FromVolts_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotential.FromVolts(double.PositiveInfinity));
- Assert.Throws(() => ElectricPotential.FromVolts(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricPotential.FromVolts(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricPotential.FromVolts(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromVolts_WithNanValue_ThrowsArgumentException()
+ public void FromVolts_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricPotential.FromVolts(double.NaN));
+ var exception = Record.Exception(() => ElectricPotential.FromVolts(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
index c69fe1611c..c11e686600 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
@@ -91,16 +91,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricResistance(double.PositiveInfinity, ElectricResistanceUnit.Ohm));
- Assert.Throws(() => new ElectricResistance(double.NegativeInfinity, ElectricResistanceUnit.Ohm));
+ var exception1 = Record.Exception(() => new ElectricResistance(double.PositiveInfinity, ElectricResistanceUnit.Ohm));
+ var exception2 = Record.Exception(() => new ElectricResistance(double.NegativeInfinity, ElectricResistanceUnit.Ohm));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricResistance(double.NaN, ElectricResistanceUnit.Ohm));
+ var exception = Record.Exception(() => new ElectricResistance(double.NaN, ElectricResistanceUnit.Ohm));
+
+ Assert.Null(exception);
}
[Fact]
@@ -185,16 +190,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromOhms_WithInfinityValue_ThrowsArgumentException()
+ public void FromOhms_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricResistance.FromOhms(double.PositiveInfinity));
- Assert.Throws(() => ElectricResistance.FromOhms(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricResistance.FromOhms(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricResistance.FromOhms(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromOhms_WithNanValue_ThrowsArgumentException()
+ public void FromOhms_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricResistance.FromOhms(double.NaN));
+ var exception = Record.Exception(() => ElectricResistance.FromOhms(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs
index 2ce41ad10e..f6b8d3931d 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs
@@ -119,16 +119,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricResistivity(double.PositiveInfinity, ElectricResistivityUnit.OhmMeter));
- Assert.Throws(() => new ElectricResistivity(double.NegativeInfinity, ElectricResistivityUnit.OhmMeter));
+ var exception1 = Record.Exception(() => new ElectricResistivity(double.PositiveInfinity, ElectricResistivityUnit.OhmMeter));
+ var exception2 = Record.Exception(() => new ElectricResistivity(double.NegativeInfinity, ElectricResistivityUnit.OhmMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricResistivity(double.NaN, ElectricResistivityUnit.OhmMeter));
+ var exception = Record.Exception(() => new ElectricResistivity(double.NaN, ElectricResistivityUnit.OhmMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -248,16 +253,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromOhmMeters_WithInfinityValue_ThrowsArgumentException()
+ public void FromOhmMeters_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricResistivity.FromOhmMeters(double.PositiveInfinity));
- Assert.Throws(() => ElectricResistivity.FromOhmMeters(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricResistivity.FromOhmMeters(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricResistivity.FromOhmMeters(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromOhmMeters_WithNanValue_ThrowsArgumentException()
+ public void FromOhmMeters_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricResistivity.FromOhmMeters(double.NaN));
+ var exception = Record.Exception(() => ElectricResistivity.FromOhmMeters(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs
index 04af0291fe..4fe2ba0dc5 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs
@@ -75,16 +75,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricSurfaceChargeDensity(double.PositiveInfinity, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter));
- Assert.Throws(() => new ElectricSurfaceChargeDensity(double.NegativeInfinity, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter));
+ var exception1 = Record.Exception(() => new ElectricSurfaceChargeDensity(double.PositiveInfinity, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter));
+ var exception2 = Record.Exception(() => new ElectricSurfaceChargeDensity(double.NegativeInfinity, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new ElectricSurfaceChargeDensity(double.NaN, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter));
+ var exception = Record.Exception(() => new ElectricSurfaceChargeDensity(double.NaN, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -149,16 +154,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromCoulombsPerSquareMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromCoulombsPerSquareMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(double.PositiveInfinity));
- Assert.Throws(() => ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromCoulombsPerSquareMeter_WithNanValue_ThrowsArgumentException()
+ public void FromCoulombsPerSquareMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(double.NaN));
+ var exception = Record.Exception(() => ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs
index 57502ee676..8cd2c3b07c 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs
@@ -111,16 +111,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new EnergyDensity(double.PositiveInfinity, EnergyDensityUnit.JoulePerCubicMeter));
- Assert.Throws(() => new EnergyDensity(double.NegativeInfinity, EnergyDensityUnit.JoulePerCubicMeter));
+ var exception1 = Record.Exception(() => new EnergyDensity(double.PositiveInfinity, EnergyDensityUnit.JoulePerCubicMeter));
+ var exception2 = Record.Exception(() => new EnergyDensity(double.NegativeInfinity, EnergyDensityUnit.JoulePerCubicMeter));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new EnergyDensity(double.NaN, EnergyDensityUnit.JoulePerCubicMeter));
+ var exception = Record.Exception(() => new EnergyDensity(double.NaN, EnergyDensityUnit.JoulePerCubicMeter));
+
+ Assert.Null(exception);
}
[Fact]
@@ -230,16 +235,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromJoulesPerCubicMeter_WithInfinityValue_ThrowsArgumentException()
+ public void FromJoulesPerCubicMeter_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => EnergyDensity.FromJoulesPerCubicMeter(double.PositiveInfinity));
- Assert.Throws(() => EnergyDensity.FromJoulesPerCubicMeter(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => EnergyDensity.FromJoulesPerCubicMeter(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => EnergyDensity.FromJoulesPerCubicMeter(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromJoulesPerCubicMeter_WithNanValue_ThrowsArgumentException()
+ public void FromJoulesPerCubicMeter_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => EnergyDensity.FromJoulesPerCubicMeter(double.NaN));
+ var exception = Record.Exception(() => EnergyDensity.FromJoulesPerCubicMeter(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs
index 5ddc7afd48..7595d23197 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs
@@ -223,16 +223,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Energy(double.PositiveInfinity, EnergyUnit.Joule));
- Assert.Throws(() => new Energy(double.NegativeInfinity, EnergyUnit.Joule));
+ var exception1 = Record.Exception(() => new Energy(double.PositiveInfinity, EnergyUnit.Joule));
+ var exception2 = Record.Exception(() => new Energy(double.NegativeInfinity, EnergyUnit.Joule));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Energy(double.NaN, EnergyUnit.Joule));
+ var exception = Record.Exception(() => new Energy(double.NaN, EnergyUnit.Joule));
+
+ Assert.Null(exception);
}
[Fact]
@@ -482,16 +487,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromJoules_WithInfinityValue_ThrowsArgumentException()
+ public void FromJoules_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Energy.FromJoules(double.PositiveInfinity));
- Assert.Throws(() => Energy.FromJoules(double.NegativeInfinity));
+ var exception1 = Record.Exception(() => Energy.FromJoules(double.PositiveInfinity));
+ var exception2 = Record.Exception(() => Energy.FromJoules(double.NegativeInfinity));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void FromJoules_WithNanValue_ThrowsArgumentException()
+ public void FromJoules_WithNanValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Energy.FromJoules(double.NaN));
+ var exception = Record.Exception(() => Energy.FromJoules(double.NaN));
+
+ Assert.Null(exception);
}
[Fact]
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs
index 65737394af..716f46113e 100644
--- a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs
@@ -91,16 +91,21 @@ public void DefaultCtor_ReturnsQuantityWithZeroValueAndBaseUnit()
}
[Fact]
- public void Ctor_WithInfinityValue_ThrowsArgumentException()
+ public void Ctor_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Entropy(double.PositiveInfinity, EntropyUnit.JoulePerKelvin));
- Assert.Throws(() => new Entropy(double.NegativeInfinity, EntropyUnit.JoulePerKelvin));
+ var exception1 = Record.Exception(() => new Entropy(double.PositiveInfinity, EntropyUnit.JoulePerKelvin));
+ var exception2 = Record.Exception(() => new Entropy(double.NegativeInfinity, EntropyUnit.JoulePerKelvin));
+
+ Assert.Null(exception1);
+ Assert.Null(exception2);
}
[Fact]
- public void Ctor_WithNaNValue_ThrowsArgumentException()
+ public void Ctor_WithNaNValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => new Entropy(double.NaN, EntropyUnit.JoulePerKelvin));
+ var exception = Record.Exception(() => new Entropy(double.NaN, EntropyUnit.JoulePerKelvin));
+
+ Assert.Null(exception);
}
[Fact]
@@ -185,16 +190,21 @@ public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
}
[Fact]
- public void FromJoulesPerKelvin_WithInfinityValue_ThrowsArgumentException()
+ public void FromJoulesPerKelvin_WithInfinityValue_DoNotThrowsArgumentException()
{
- Assert.Throws(() => Entropy.FromJoulesPerKelvin(double.PositiveInfinity));
- Assert.Throws