diff --git a/Common/UnitDefinitions/SpecificEnergy.json b/Common/UnitDefinitions/SpecificEnergy.json index 2fa10c2ccc..30d8aac0db 100644 --- a/Common/UnitDefinitions/SpecificEnergy.json +++ b/Common/UnitDefinitions/SpecificEnergy.json @@ -26,8 +26,8 @@ ] }, { - "SingularName": "MegaJoulePerTonne", - "PluralName": "MegaJoulesPerTonne", + "SingularName": "MegajoulePerTonne", + "PluralName": "MegajoulesPerTonne", "FromUnitToBaseFunc": "{x} * 1e3", "FromBaseToUnitFunc": "{x} / 1e3", "Localization": [ diff --git a/Common/UnitEnumValues.g.json b/Common/UnitEnumValues.g.json index c86691d40c..8ee877aa32 100644 --- a/Common/UnitEnumValues.g.json +++ b/Common/UnitEnumValues.g.json @@ -1345,7 +1345,7 @@ "WattDayPerTonne": 27, "WattHourPerKilogram": 28, "WattHourPerPound": 29, - "MegaJoulePerTonne": 37 + "MegajoulePerTonne": 37 }, "SpecificEntropy": { "BtuPerPoundFahrenheit": 1, diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs index aa57d5540c..294728402a 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -162,9 +162,9 @@ public SpecificEnergy(double value, SpecificEnergyUnit unit) public double MegajoulesPerKilogram => As(SpecificEnergyUnit.MegajoulePerKilogram); /// - /// Gets a value of this quantity converted into + /// Gets a value of this quantity converted into /// - public double MegaJoulesPerTonne => As(SpecificEnergyUnit.MegaJoulePerTonne); + public double MegajoulesPerTonne => As(SpecificEnergyUnit.MegajoulePerTonne); /// /// Gets a value of this quantity converted into @@ -316,9 +316,9 @@ public SpecificEnergy(double value, SpecificEnergyUnit unit) public static SpecificEnergy FromMegajoulesPerKilogram(double megajoulesperkilogram) => new SpecificEnergy(megajoulesperkilogram, SpecificEnergyUnit.MegajoulePerKilogram); /// - /// Creates a from . + /// Creates a from . /// - public static SpecificEnergy FromMegaJoulesPerTonne(double megajoulespertonne) => new SpecificEnergy(megajoulespertonne, SpecificEnergyUnit.MegaJoulePerTonne); + public static SpecificEnergy FromMegajoulesPerTonne(double megajoulespertonne) => new SpecificEnergy(megajoulespertonne, SpecificEnergyUnit.MegajoulePerTonne); /// /// Creates a from . @@ -441,7 +441,7 @@ private double GetValueInBaseUnit() SpecificEnergyUnit.KilowattHourPerKilogram => (_value * 3.6e3) * 1e3d, SpecificEnergyUnit.KilowattHourPerPound => (_value * 7.93664e3) * 1e3d, SpecificEnergyUnit.MegajoulePerKilogram => (_value) * 1e6d, - SpecificEnergyUnit.MegaJoulePerTonne => _value * 1e3, + SpecificEnergyUnit.MegajoulePerTonne => _value * 1e3, SpecificEnergyUnit.MegawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e6d, SpecificEnergyUnit.MegawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e6d, SpecificEnergyUnit.MegawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e6d, @@ -484,7 +484,7 @@ private double GetValueAs(SpecificEnergyUnit unit) SpecificEnergyUnit.KilowattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e3d, SpecificEnergyUnit.KilowattHourPerPound => (baseUnitValue / 7.93664e3) / 1e3d, SpecificEnergyUnit.MegajoulePerKilogram => (baseUnitValue) / 1e6d, - SpecificEnergyUnit.MegaJoulePerTonne => baseUnitValue / 1e3, + SpecificEnergyUnit.MegajoulePerTonne => baseUnitValue / 1e3, SpecificEnergyUnit.MegawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e6d, SpecificEnergyUnit.MegawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e6d, SpecificEnergyUnit.MegawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e6d, diff --git a/UnitsNet.NanoFramework/GeneratedCode/Units/SpecificEnergyUnit.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Units/SpecificEnergyUnit.g.cs index 1960ecfb3a..1bc0278878 100644 --- a/UnitsNet.NanoFramework/GeneratedCode/Units/SpecificEnergyUnit.g.cs +++ b/UnitsNet.NanoFramework/GeneratedCode/Units/SpecificEnergyUnit.g.cs @@ -41,7 +41,7 @@ public enum SpecificEnergyUnit KilowattHourPerKilogram = 14, KilowattHourPerPound = 15, MegajoulePerKilogram = 16, - MegaJoulePerTonne = 37, + MegajoulePerTonne = 37, MegawattDayPerKilogram = 17, MegawattDayPerShortTon = 18, MegawattDayPerTonne = 19, diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpecificEnergyExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpecificEnergyExtensionsTest.g.cs index bee8a06755..d64e402d85 100644 --- a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpecificEnergyExtensionsTest.g.cs +++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpecificEnergyExtensionsTest.g.cs @@ -89,8 +89,8 @@ public void NumberToMegajoulesPerKilogramTest() => Assert.Equal(SpecificEnergy.FromMegajoulesPerKilogram(2), 2.MegajoulesPerKilogram()); [Fact] - public void NumberToMegaJoulesPerTonneTest() => - Assert.Equal(SpecificEnergy.FromMegaJoulesPerTonne(2), 2.MegaJoulesPerTonne()); + public void NumberToMegajoulesPerTonneTest() => + Assert.Equal(SpecificEnergy.FromMegajoulesPerTonne(2), 2.MegajoulesPerTonne()); [Fact] public void NumberToMegawattDaysPerKilogramTest() => diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs index f277486178..b3805d2950 100644 --- a/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs +++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs @@ -208,15 +208,15 @@ public static SpecificEnergy MegajoulesPerKilogram(this T value) => SpecificEnergy.FromMegajoulesPerKilogram(value.ToDouble(null)); #endif - /// - public static SpecificEnergy MegaJoulesPerTonne(this T value) + /// + public static SpecificEnergy MegajoulesPerTonne(this T value) where T : notnull #if NET7_0_OR_GREATER , INumber - => SpecificEnergy.FromMegaJoulesPerTonne(double.CreateChecked(value)); + => SpecificEnergy.FromMegajoulesPerTonne(double.CreateChecked(value)); #else , IConvertible - => SpecificEnergy.FromMegaJoulesPerTonne(value.ToDouble(null)); + => SpecificEnergy.FromMegajoulesPerTonne(value.ToDouble(null)); #endif /// diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs index 814dce6411..fa19fcdca9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs @@ -56,7 +56,7 @@ public abstract partial class SpecificEnergyTestsBase : QuantityTestsBase protected abstract double KilowattHoursPerKilogramInOneJoulePerKilogram { get; } protected abstract double KilowattHoursPerPoundInOneJoulePerKilogram { get; } protected abstract double MegajoulesPerKilogramInOneJoulePerKilogram { get; } - protected abstract double MegaJoulesPerTonneInOneJoulePerKilogram { get; } + protected abstract double MegajoulesPerTonneInOneJoulePerKilogram { get; } protected abstract double MegawattDaysPerKilogramInOneJoulePerKilogram { get; } protected abstract double MegawattDaysPerShortTonInOneJoulePerKilogram { get; } protected abstract double MegawattDaysPerTonneInOneJoulePerKilogram { get; } @@ -88,7 +88,7 @@ public abstract partial class SpecificEnergyTestsBase : QuantityTestsBase protected virtual double KilowattHoursPerKilogramTolerance { get { return 1e-5; } } protected virtual double KilowattHoursPerPoundTolerance { get { return 1e-5; } } protected virtual double MegajoulesPerKilogramTolerance { get { return 1e-5; } } - protected virtual double MegaJoulesPerTonneTolerance { get { return 1e-5; } } + protected virtual double MegajoulesPerTonneTolerance { get { return 1e-5; } } protected virtual double MegawattDaysPerKilogramTolerance { get { return 1e-5; } } protected virtual double MegawattDaysPerShortTonTolerance { get { return 1e-5; } } protected virtual double MegawattDaysPerTonneTolerance { get { return 1e-5; } } @@ -124,7 +124,7 @@ public abstract partial class SpecificEnergyTestsBase : QuantityTestsBase SpecificEnergyUnit.KilowattHourPerKilogram => (KilowattHoursPerKilogramInOneJoulePerKilogram, KilowattHoursPerKilogramTolerance), SpecificEnergyUnit.KilowattHourPerPound => (KilowattHoursPerPoundInOneJoulePerKilogram, KilowattHoursPerPoundTolerance), SpecificEnergyUnit.MegajoulePerKilogram => (MegajoulesPerKilogramInOneJoulePerKilogram, MegajoulesPerKilogramTolerance), - SpecificEnergyUnit.MegaJoulePerTonne => (MegaJoulesPerTonneInOneJoulePerKilogram, MegaJoulesPerTonneTolerance), + SpecificEnergyUnit.MegajoulePerTonne => (MegajoulesPerTonneInOneJoulePerKilogram, MegajoulesPerTonneTolerance), SpecificEnergyUnit.MegawattDayPerKilogram => (MegawattDaysPerKilogramInOneJoulePerKilogram, MegawattDaysPerKilogramTolerance), SpecificEnergyUnit.MegawattDayPerShortTon => (MegawattDaysPerShortTonInOneJoulePerKilogram, MegawattDaysPerShortTonTolerance), SpecificEnergyUnit.MegawattDayPerTonne => (MegawattDaysPerTonneInOneJoulePerKilogram, MegawattDaysPerTonneTolerance), @@ -160,7 +160,7 @@ public abstract partial class SpecificEnergyTestsBase : QuantityTestsBase new object[] { SpecificEnergyUnit.KilowattHourPerKilogram }, new object[] { SpecificEnergyUnit.KilowattHourPerPound }, new object[] { SpecificEnergyUnit.MegajoulePerKilogram }, - new object[] { SpecificEnergyUnit.MegaJoulePerTonne }, + new object[] { SpecificEnergyUnit.MegajoulePerTonne }, new object[] { SpecificEnergyUnit.MegawattDayPerKilogram }, new object[] { SpecificEnergyUnit.MegawattDayPerShortTon }, new object[] { SpecificEnergyUnit.MegawattDayPerTonne }, @@ -261,7 +261,7 @@ public void JoulePerKilogramToSpecificEnergyUnits() AssertEx.EqualTolerance(KilowattHoursPerKilogramInOneJoulePerKilogram, jouleperkilogram.KilowattHoursPerKilogram, KilowattHoursPerKilogramTolerance); AssertEx.EqualTolerance(KilowattHoursPerPoundInOneJoulePerKilogram, jouleperkilogram.KilowattHoursPerPound, KilowattHoursPerPoundTolerance); AssertEx.EqualTolerance(MegajoulesPerKilogramInOneJoulePerKilogram, jouleperkilogram.MegajoulesPerKilogram, MegajoulesPerKilogramTolerance); - AssertEx.EqualTolerance(MegaJoulesPerTonneInOneJoulePerKilogram, jouleperkilogram.MegaJoulesPerTonne, MegaJoulesPerTonneTolerance); + AssertEx.EqualTolerance(MegajoulesPerTonneInOneJoulePerKilogram, jouleperkilogram.MegajoulesPerTonne, MegajoulesPerTonneTolerance); AssertEx.EqualTolerance(MegawattDaysPerKilogramInOneJoulePerKilogram, jouleperkilogram.MegawattDaysPerKilogram, MegawattDaysPerKilogramTolerance); AssertEx.EqualTolerance(MegawattDaysPerShortTonInOneJoulePerKilogram, jouleperkilogram.MegawattDaysPerShortTon, MegawattDaysPerShortTonTolerance); AssertEx.EqualTolerance(MegawattDaysPerTonneInOneJoulePerKilogram, jouleperkilogram.MegawattDaysPerTonne, MegawattDaysPerTonneTolerance); @@ -326,7 +326,7 @@ public void As() AssertEx.EqualTolerance(KilowattHoursPerKilogramInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.KilowattHourPerKilogram), KilowattHoursPerKilogramTolerance); AssertEx.EqualTolerance(KilowattHoursPerPoundInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.KilowattHourPerPound), KilowattHoursPerPoundTolerance); AssertEx.EqualTolerance(MegajoulesPerKilogramInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.MegajoulePerKilogram), MegajoulesPerKilogramTolerance); - AssertEx.EqualTolerance(MegaJoulesPerTonneInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.MegaJoulePerTonne), MegaJoulesPerTonneTolerance); + AssertEx.EqualTolerance(MegajoulesPerTonneInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.MegajoulePerTonne), MegajoulesPerTonneTolerance); AssertEx.EqualTolerance(MegawattDaysPerKilogramInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.MegawattDayPerKilogram), MegawattDaysPerKilogramTolerance); AssertEx.EqualTolerance(MegawattDaysPerShortTonInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.MegawattDayPerShortTon), MegawattDaysPerShortTonTolerance); AssertEx.EqualTolerance(MegawattDaysPerTonneInOneJoulePerKilogram, jouleperkilogram.As(SpecificEnergyUnit.MegawattDayPerTonne), MegawattDaysPerTonneTolerance); @@ -465,7 +465,7 @@ public void ToUnit_UnitSystem_ThrowsArgumentExceptionIfNotSupported() [InlineData("en-US", "4.2 kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram, 4.2)] [InlineData("en-US", "4.2 kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound, 4.2)] [InlineData("en-US", "4.2 MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram, 4.2)] - [InlineData("en-US", "4.2 MJ/t", SpecificEnergyUnit.MegaJoulePerTonne, 4.2)] + [InlineData("en-US", "4.2 MJ/t", SpecificEnergyUnit.MegajoulePerTonne, 4.2)] [InlineData("en-US", "4.2 MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram, 4.2)] [InlineData("en-US", "4.2 MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon, 4.2)] [InlineData("en-US", "4.2 MWd/t", SpecificEnergyUnit.MegawattDayPerTonne, 4.2)] @@ -504,7 +504,7 @@ public void Parse(string culture, string quantityString, SpecificEnergyUnit expe [InlineData("en-US", "4.2 kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram, 4.2)] [InlineData("en-US", "4.2 kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound, 4.2)] [InlineData("en-US", "4.2 MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram, 4.2)] - [InlineData("en-US", "4.2 MJ/t", SpecificEnergyUnit.MegaJoulePerTonne, 4.2)] + [InlineData("en-US", "4.2 MJ/t", SpecificEnergyUnit.MegajoulePerTonne, 4.2)] [InlineData("en-US", "4.2 MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram, 4.2)] [InlineData("en-US", "4.2 MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon, 4.2)] [InlineData("en-US", "4.2 MWd/t", SpecificEnergyUnit.MegawattDayPerTonne, 4.2)] @@ -543,7 +543,7 @@ public void TryParse(string culture, string quantityString, SpecificEnergyUnit e [InlineData("kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -582,7 +582,7 @@ public void ParseUnit_WithUsEnglishCurrentCulture(string abbreviation, SpecificE [InlineData("kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -621,7 +621,7 @@ public void ParseUnit_WithUnsupportedCurrentCulture_FallsBackToUsEnglish(string [InlineData("en-US", "kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("en-US", "kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("en-US", "MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("en-US", "MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("en-US", "MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("en-US", "MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -659,7 +659,7 @@ public void ParseUnit_WithCurrentCulture(string culture, string abbreviation, Sp [InlineData("en-US", "kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("en-US", "kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("en-US", "MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("en-US", "MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("en-US", "MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("en-US", "MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -696,7 +696,7 @@ public void ParseUnit_WithCulture(string culture, string abbreviation, SpecificE [InlineData("kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -735,7 +735,7 @@ public void TryParseUnit_WithUsEnglishCurrentCulture(string abbreviation, Specif [InlineData("kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -774,7 +774,7 @@ public void TryParseUnit_WithUnsupportedCurrentCulture_FallsBackToUsEnglish(stri [InlineData("en-US", "kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("en-US", "kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("en-US", "MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("en-US", "MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("en-US", "MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("en-US", "MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -812,7 +812,7 @@ public void TryParseUnit_WithCurrentCulture(string culture, string abbreviation, [InlineData("en-US", "kWh/kg", SpecificEnergyUnit.KilowattHourPerKilogram)] [InlineData("en-US", "kWh/lbs", SpecificEnergyUnit.KilowattHourPerPound)] [InlineData("en-US", "MJ/kg", SpecificEnergyUnit.MegajoulePerKilogram)] - [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegaJoulePerTonne)] + [InlineData("en-US", "MJ/t", SpecificEnergyUnit.MegajoulePerTonne)] [InlineData("en-US", "MWd/kg", SpecificEnergyUnit.MegawattDayPerKilogram)] [InlineData("en-US", "MWd/ST", SpecificEnergyUnit.MegawattDayPerShortTon)] [InlineData("en-US", "MWd/t", SpecificEnergyUnit.MegawattDayPerTonne)] @@ -849,7 +849,7 @@ public void TryParseUnit_WithCulture(string culture, string abbreviation, Specif [InlineData("en-US", SpecificEnergyUnit.KilowattHourPerKilogram, "kWh/kg")] [InlineData("en-US", SpecificEnergyUnit.KilowattHourPerPound, "kWh/lbs")] [InlineData("en-US", SpecificEnergyUnit.MegajoulePerKilogram, "MJ/kg")] - [InlineData("en-US", SpecificEnergyUnit.MegaJoulePerTonne, "MJ/t")] + [InlineData("en-US", SpecificEnergyUnit.MegajoulePerTonne, "MJ/t")] [InlineData("en-US", SpecificEnergyUnit.MegawattDayPerKilogram, "MWd/kg")] [InlineData("en-US", SpecificEnergyUnit.MegawattDayPerShortTon, "MWd/ST")] [InlineData("en-US", SpecificEnergyUnit.MegawattDayPerTonne, "MWd/t")] @@ -963,7 +963,7 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, SpecificEnergy.FromKilowattHoursPerKilogram(jouleperkilogram.KilowattHoursPerKilogram).JoulesPerKilogram, KilowattHoursPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.FromKilowattHoursPerPound(jouleperkilogram.KilowattHoursPerPound).JoulesPerKilogram, KilowattHoursPerPoundTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.FromMegajoulesPerKilogram(jouleperkilogram.MegajoulesPerKilogram).JoulesPerKilogram, MegajoulesPerKilogramTolerance); - AssertEx.EqualTolerance(1, SpecificEnergy.FromMegaJoulesPerTonne(jouleperkilogram.MegaJoulesPerTonne).JoulesPerKilogram, MegaJoulesPerTonneTolerance); + AssertEx.EqualTolerance(1, SpecificEnergy.FromMegajoulesPerTonne(jouleperkilogram.MegajoulesPerTonne).JoulesPerKilogram, MegajoulesPerTonneTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.FromMegawattDaysPerKilogram(jouleperkilogram.MegawattDaysPerKilogram).JoulesPerKilogram, MegawattDaysPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.FromMegawattDaysPerShortTon(jouleperkilogram.MegawattDaysPerShortTon).JoulesPerKilogram, MegawattDaysPerShortTonTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.FromMegawattDaysPerTonne(jouleperkilogram.MegawattDaysPerTonne).JoulesPerKilogram, MegawattDaysPerTonneTolerance); @@ -1149,7 +1149,7 @@ public void ToString_ReturnsValueAndUnitAbbreviationInCurrentCulture() Assert.Equal("1 kWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerKilogram).ToString()); Assert.Equal("1 kWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerPound).ToString()); Assert.Equal("1 MJ/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegajoulePerKilogram).ToString()); - Assert.Equal("1 MJ/t", new SpecificEnergy(1, SpecificEnergyUnit.MegaJoulePerTonne).ToString()); + Assert.Equal("1 MJ/t", new SpecificEnergy(1, SpecificEnergyUnit.MegajoulePerTonne).ToString()); Assert.Equal("1 MWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerKilogram).ToString()); Assert.Equal("1 MWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerShortTon).ToString()); Assert.Equal("1 MWd/t", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerTonne).ToString()); @@ -1187,7 +1187,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture Assert.Equal("1 kWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerKilogram).ToString(swedishCulture)); Assert.Equal("1 kWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerPound).ToString(swedishCulture)); Assert.Equal("1 MJ/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegajoulePerKilogram).ToString(swedishCulture)); - Assert.Equal("1 MJ/t", new SpecificEnergy(1, SpecificEnergyUnit.MegaJoulePerTonne).ToString(swedishCulture)); + Assert.Equal("1 MJ/t", new SpecificEnergy(1, SpecificEnergyUnit.MegajoulePerTonne).ToString(swedishCulture)); Assert.Equal("1 MWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerKilogram).ToString(swedishCulture)); Assert.Equal("1 MWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerShortTon).ToString(swedishCulture)); Assert.Equal("1 MWd/t", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerTonne).ToString(swedishCulture)); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 92f2fea62f..cd59a55d27 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -143,7 +143,7 @@ public static IEnumerable> GetDefaultMappings yield return new (SpecificEnergyUnit.KilowattHourPerKilogram, "KilowattHourPerKilogram", "KilowattHoursPerKilogram", BaseUnits.Undefined); yield return new (SpecificEnergyUnit.KilowattHourPerPound, "KilowattHourPerPound", "KilowattHoursPerPound", BaseUnits.Undefined); yield return new (SpecificEnergyUnit.MegajoulePerKilogram, "MegajoulePerKilogram", "MegajoulesPerKilogram", new BaseUnits(length: LengthUnit.Kilometer, time: DurationUnit.Second)); - yield return new (SpecificEnergyUnit.MegaJoulePerTonne, "MegaJoulePerTonne", "MegaJoulesPerTonne", BaseUnits.Undefined); + yield return new (SpecificEnergyUnit.MegajoulePerTonne, "MegajoulePerTonne", "MegajoulesPerTonne", BaseUnits.Undefined); yield return new (SpecificEnergyUnit.MegawattDayPerKilogram, "MegawattDayPerKilogram", "MegawattDaysPerKilogram", BaseUnits.Undefined); yield return new (SpecificEnergyUnit.MegawattDayPerShortTon, "MegawattDayPerShortTon", "MegawattDaysPerShortTon", BaseUnits.Undefined); yield return new (SpecificEnergyUnit.MegawattDayPerTonne, "MegawattDayPerTonne", "MegawattDaysPerTonne", BaseUnits.Undefined); @@ -348,9 +348,9 @@ public SpecificEnergy(double value, UnitSystem unitSystem) public double MegajoulesPerKilogram => As(SpecificEnergyUnit.MegajoulePerKilogram); /// - /// Gets a value of this quantity converted into + /// Gets a value of this quantity converted into /// - public double MegaJoulesPerTonne => As(SpecificEnergyUnit.MegaJoulePerTonne); + public double MegajoulesPerTonne => As(SpecificEnergyUnit.MegajoulePerTonne); /// /// Gets a value of this quantity converted into @@ -443,7 +443,7 @@ internal static void RegisterDefaultConversions(UnitConverter unitConverter) unitConverter.SetConversionFunction(SpecificEnergyUnit.KilowattHourPerKilogram, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.KilowattHourPerPound, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.MegajoulePerKilogram, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); - unitConverter.SetConversionFunction(SpecificEnergyUnit.MegaJoulePerTonne, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); + unitConverter.SetConversionFunction(SpecificEnergyUnit.MegajoulePerTonne, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.MegawattDayPerKilogram, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.MegawattDayPerShortTon, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.MegawattDayPerTonne, SpecificEnergyUnit.JoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.JoulePerKilogram)); @@ -477,7 +477,7 @@ internal static void RegisterDefaultConversions(UnitConverter unitConverter) unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.KilowattHourPerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.KilowattHourPerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.KilowattHourPerPound, quantity => quantity.ToUnit(SpecificEnergyUnit.KilowattHourPerPound)); unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegajoulePerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.MegajoulePerKilogram)); - unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegaJoulePerTonne, quantity => quantity.ToUnit(SpecificEnergyUnit.MegaJoulePerTonne)); + unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegajoulePerTonne, quantity => quantity.ToUnit(SpecificEnergyUnit.MegajoulePerTonne)); unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegawattDayPerKilogram, quantity => quantity.ToUnit(SpecificEnergyUnit.MegawattDayPerKilogram)); unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegawattDayPerShortTon, quantity => quantity.ToUnit(SpecificEnergyUnit.MegawattDayPerShortTon)); unitConverter.SetConversionFunction(SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegawattDayPerTonne, quantity => quantity.ToUnit(SpecificEnergyUnit.MegawattDayPerTonne)); @@ -647,11 +647,11 @@ public static SpecificEnergy FromMegajoulesPerKilogram(double value) } /// - /// Creates a from . + /// Creates a from . /// - public static SpecificEnergy FromMegaJoulesPerTonne(double value) + public static SpecificEnergy FromMegajoulesPerTonne(double value) { - return new SpecificEnergy(value, SpecificEnergyUnit.MegaJoulePerTonne); + return new SpecificEnergy(value, SpecificEnergyUnit.MegajoulePerTonne); } /// @@ -1218,7 +1218,7 @@ private bool TryToUnit(SpecificEnergyUnit unit, [NotNullWhen(true)] out Specific (SpecificEnergyUnit.KilowattHourPerKilogram, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy((_value * 3.6e3) * 1e3d, SpecificEnergyUnit.JoulePerKilogram), (SpecificEnergyUnit.KilowattHourPerPound, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy((_value * 7.93664e3) * 1e3d, SpecificEnergyUnit.JoulePerKilogram), (SpecificEnergyUnit.MegajoulePerKilogram, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy((_value) * 1e6d, SpecificEnergyUnit.JoulePerKilogram), - (SpecificEnergyUnit.MegaJoulePerTonne, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy(_value * 1e3, SpecificEnergyUnit.JoulePerKilogram), + (SpecificEnergyUnit.MegajoulePerTonne, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy(_value * 1e3, SpecificEnergyUnit.JoulePerKilogram), (SpecificEnergyUnit.MegawattDayPerKilogram, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy((_value * (24 * 3.6e3)) * 1e6d, SpecificEnergyUnit.JoulePerKilogram), (SpecificEnergyUnit.MegawattDayPerShortTon, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy((_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e6d, SpecificEnergyUnit.JoulePerKilogram), (SpecificEnergyUnit.MegawattDayPerTonne, SpecificEnergyUnit.JoulePerKilogram) => new SpecificEnergy((_value * ((24 * 3.6e3) / 1e3)) * 1e6d, SpecificEnergyUnit.JoulePerKilogram), @@ -1249,7 +1249,7 @@ private bool TryToUnit(SpecificEnergyUnit unit, [NotNullWhen(true)] out Specific (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.KilowattHourPerKilogram) => new SpecificEnergy((_value / 3.6e3) / 1e3d, SpecificEnergyUnit.KilowattHourPerKilogram), (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.KilowattHourPerPound) => new SpecificEnergy((_value / 7.93664e3) / 1e3d, SpecificEnergyUnit.KilowattHourPerPound), (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegajoulePerKilogram) => new SpecificEnergy((_value) / 1e6d, SpecificEnergyUnit.MegajoulePerKilogram), - (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegaJoulePerTonne) => new SpecificEnergy(_value / 1e3, SpecificEnergyUnit.MegaJoulePerTonne), + (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegajoulePerTonne) => new SpecificEnergy(_value / 1e3, SpecificEnergyUnit.MegajoulePerTonne), (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegawattDayPerKilogram) => new SpecificEnergy((_value / (24 * 3.6e3)) / 1e6d, SpecificEnergyUnit.MegawattDayPerKilogram), (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegawattDayPerShortTon) => new SpecificEnergy((_value / ((24 * 3.6e3) / 9.0718474e2)) / 1e6d, SpecificEnergyUnit.MegawattDayPerShortTon), (SpecificEnergyUnit.JoulePerKilogram, SpecificEnergyUnit.MegawattDayPerTonne) => new SpecificEnergy((_value / ((24 * 3.6e3) / 1e3)) / 1e6d, SpecificEnergyUnit.MegawattDayPerTonne), diff --git a/UnitsNet/GeneratedCode/Resources/SpecificEnergy.restext b/UnitsNet/GeneratedCode/Resources/SpecificEnergy.restext index 23d2275a4f..1e9e034fc2 100644 --- a/UnitsNet/GeneratedCode/Resources/SpecificEnergy.restext +++ b/UnitsNet/GeneratedCode/Resources/SpecificEnergy.restext @@ -14,7 +14,7 @@ KilowattDaysPerTonne=kWd/t KilowattHoursPerKilogram=kWh/kg KilowattHoursPerPound=kWh/lbs MegajoulesPerKilogram=MJ/kg -MegaJoulesPerTonne=MJ/t +MegajoulesPerTonne=MJ/t MegawattDaysPerKilogram=MWd/kg MegawattDaysPerShortTon=MWd/ST MegawattDaysPerTonne=MWd/t diff --git a/UnitsNet/GeneratedCode/Units/SpecificEnergyUnit.g.cs b/UnitsNet/GeneratedCode/Units/SpecificEnergyUnit.g.cs index 1960ecfb3a..1bc0278878 100644 --- a/UnitsNet/GeneratedCode/Units/SpecificEnergyUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/SpecificEnergyUnit.g.cs @@ -41,7 +41,7 @@ public enum SpecificEnergyUnit KilowattHourPerKilogram = 14, KilowattHourPerPound = 15, MegajoulePerKilogram = 16, - MegaJoulePerTonne = 37, + MegajoulePerTonne = 37, MegawattDayPerKilogram = 17, MegawattDayPerShortTon = 18, MegawattDayPerTonne = 19,