diff --git a/Common/UnitDefinitions/RadiationEquivalentDoseRate.json b/Common/UnitDefinitions/RadiationEquivalentDoseRate.json
new file mode 100644
index 0000000000..70e4541e83
--- /dev/null
+++ b/Common/UnitDefinitions/RadiationEquivalentDoseRate.json
@@ -0,0 +1,42 @@
+{
+ "Name": "RadiationEquivalentDoseRate",
+ "BaseUnit": "SievertPerHour",
+ "XmlDocSummary": "A dose rate is quantity of radiation absorbed or delivered per unit time.",
+ "XmlDocsRemarks": "https://en.wikipedia.org/wiki/Dose_rate",
+ "BaseDimensions": {
+ "L": 2,
+ "T": -3
+ },
+ "Units": [
+ {
+ "SingularName": "SievertPerHour",
+ "PluralName": "SievertsPerHour",
+ "FromUnitToBaseFunc": "{x}",
+ "FromBaseToUnitFunc": "{x}",
+ "Prefixes": [ "Nano", "Micro", "Milli" ],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "Sv/h" ]
+ },
+ {
+ "Culture": "ru-RU",
+ "Abbreviations": [ "Зв/ч" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "RoentgenEquivalentManPerHour",
+ "PluralName": "RoentgensEquivalentManPerHour",
+ "FromUnitToBaseFunc": "{x} / 100",
+ "FromBaseToUnitFunc": "{x} * 100",
+ "Prefixes": [ "Milli" ],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "rem/h" ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/Common/UnitEnumValues.g.json b/Common/UnitEnumValues.g.json
index 6435e1ca25..a0f57154f5 100644
--- a/Common/UnitEnumValues.g.json
+++ b/Common/UnitEnumValues.g.json
@@ -1869,5 +1869,13 @@
"Sievert": 9,
"Kilosievert": 3,
"Megasievert": 6
+ },
+ "RadiationEquivalentDoseRate": {
+ "MicrosievertPerHour": 1,
+ "MilliroentgenEquivalentManPerHour": 4,
+ "MillisievertPerHour": 3,
+ "NanosievertPerHour": 2,
+ "RoentgenEquivalentManPerHour": 5,
+ "SievertPerHour": 6
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs
new file mode 100644
index 0000000000..a63670b7be
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs
@@ -0,0 +1,224 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+using System;
+using UnitsNet.Units;
+
+namespace UnitsNet
+{
+ ///
+ ///
+ /// A dose rate is quantity of radiation absorbed or delivered per unit time.
+ ///
+ public struct RadiationEquivalentDoseRate
+ {
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ private readonly double _value;
+
+ ///
+ /// The unit this quantity was constructed with.
+ ///
+ private readonly RadiationEquivalentDoseRateUnit _unit;
+
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ public double Value => _value;
+
+ ///
+ public RadiationEquivalentDoseRateUnit Unit => _unit;
+
+ ///
+ /// Creates the quantity with the given numeric value and unit.
+ ///
+ /// The numeric value to construct this quantity with.
+ /// The unit representation to construct this quantity with.
+ /// If value is NaN or Infinity.
+ public RadiationEquivalentDoseRate(double value, RadiationEquivalentDoseRateUnit unit)
+ {
+ _value = value;
+ _unit = unit;
+ }
+
+ ///
+ /// The base unit of RadiationEquivalentDoseRate, which is Second. All conversions go via this value.
+ ///
+ public static RadiationEquivalentDoseRateUnit BaseUnit { get; } = RadiationEquivalentDoseRateUnit.SievertPerHour;
+
+ ///
+ /// Represents the largest possible value of RadiationEquivalentDoseRate.
+ ///
+ public static RadiationEquivalentDoseRate MaxValue { get; } = new RadiationEquivalentDoseRate(double.MaxValue, BaseUnit);
+
+ ///
+ /// Represents the smallest possible value of RadiationEquivalentDoseRate.
+ ///
+ public static RadiationEquivalentDoseRate MinValue { get; } = new RadiationEquivalentDoseRate(double.MinValue, BaseUnit);
+
+ ///
+ /// Gets an instance of this quantity with a value of 0 in the base unit Second.
+ ///
+ public static RadiationEquivalentDoseRate Zero { get; } = new RadiationEquivalentDoseRate(0, BaseUnit);
+ #region Conversion Properties
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MicrosievertsPerHour => As(RadiationEquivalentDoseRateUnit.MicrosievertPerHour);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MilliroentgensEquivalentManPerHour => As(RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MillisievertsPerHour => As(RadiationEquivalentDoseRateUnit.MillisievertPerHour);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double NanosievertsPerHour => As(RadiationEquivalentDoseRateUnit.NanosievertPerHour);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double RoentgensEquivalentManPerHour => As(RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double SievertsPerHour => As(RadiationEquivalentDoseRateUnit.SievertPerHour);
+
+ #endregion
+
+ #region Static Factory Methods
+
+ ///
+ /// Creates a from .
+ ///
+ /// If value is NaN or Infinity.
+ public static RadiationEquivalentDoseRate FromMicrosievertsPerHour(double microsievertsperhour) => new RadiationEquivalentDoseRate(microsievertsperhour, RadiationEquivalentDoseRateUnit.MicrosievertPerHour);
+
+ ///
+ /// Creates a from .
+ ///
+ /// If value is NaN or Infinity.
+ public static RadiationEquivalentDoseRate FromMilliroentgensEquivalentManPerHour(double milliroentgensequivalentmanperhour) => new RadiationEquivalentDoseRate(milliroentgensequivalentmanperhour, RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour);
+
+ ///
+ /// Creates a from .
+ ///
+ /// If value is NaN or Infinity.
+ public static RadiationEquivalentDoseRate FromMillisievertsPerHour(double millisievertsperhour) => new RadiationEquivalentDoseRate(millisievertsperhour, RadiationEquivalentDoseRateUnit.MillisievertPerHour);
+
+ ///
+ /// Creates a from .
+ ///
+ /// If value is NaN or Infinity.
+ public static RadiationEquivalentDoseRate FromNanosievertsPerHour(double nanosievertsperhour) => new RadiationEquivalentDoseRate(nanosievertsperhour, RadiationEquivalentDoseRateUnit.NanosievertPerHour);
+
+ ///
+ /// Creates a from .
+ ///
+ /// If value is NaN or Infinity.
+ public static RadiationEquivalentDoseRate FromRoentgensEquivalentManPerHour(double roentgensequivalentmanperhour) => new RadiationEquivalentDoseRate(roentgensequivalentmanperhour, RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour);
+
+ ///
+ /// Creates a from .
+ ///
+ /// If value is NaN or Infinity.
+ public static RadiationEquivalentDoseRate FromSievertsPerHour(double sievertsperhour) => new RadiationEquivalentDoseRate(sievertsperhour, RadiationEquivalentDoseRateUnit.SievertPerHour);
+
+ ///
+ /// Dynamically convert from value and unit enum to .
+ ///
+ /// Value to convert from.
+ /// Unit to convert from.
+ /// RadiationEquivalentDoseRate unit value.
+ public static RadiationEquivalentDoseRate From(double value, RadiationEquivalentDoseRateUnit fromUnit)
+ {
+ return new RadiationEquivalentDoseRate(value, fromUnit);
+ }
+
+ #endregion
+
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RadiationEquivalentDoseRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RadiationEquivalentDoseRate to another RadiationEquivalentDoseRate with the unit representation .
+ ///
+ /// A RadiationEquivalentDoseRate with the specified unit.
+ public RadiationEquivalentDoseRate ToUnit(RadiationEquivalentDoseRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RadiationEquivalentDoseRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (_value) * 1e-6d,
+ RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (_value / 100) * 1e-3d,
+ RadiationEquivalentDoseRateUnit.MillisievertPerHour => (_value) * 1e-3d,
+ RadiationEquivalentDoseRateUnit.NanosievertPerHour => (_value) * 1e-9d,
+ RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => _value / 100,
+ RadiationEquivalentDoseRateUnit.SievertPerHour => _value,
+ _ => throw new NotImplementedException($"Can not convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RadiationEquivalentDoseRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (baseUnitValue) / 1e-6d,
+ RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (baseUnitValue * 100) / 1e-3d,
+ RadiationEquivalentDoseRateUnit.MillisievertPerHour => (baseUnitValue) / 1e-3d,
+ RadiationEquivalentDoseRateUnit.NanosievertPerHour => (baseUnitValue) / 1e-9d,
+ RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => baseUnitValue * 100,
+ RadiationEquivalentDoseRateUnit.SievertPerHour => baseUnitValue,
+ _ => throw new NotImplementedException($"Can not convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
+ }
+}
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/RadiationEquivalentDoseRate.nfproj b/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/RadiationEquivalentDoseRate.nfproj
new file mode 100644
index 0000000000..a764c389bd
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/RadiationEquivalentDoseRate.nfproj
@@ -0,0 +1,42 @@
+
+
+
+ $(MSBuildExtensionsPath)\nanoFramework\v1.0\
+
+
+
+ Debug
+ AnyCPU
+ {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ {8eec9904-f4bb-c601-86ac-80fb153599f9}
+ Library
+ Properties
+ 512
+ UnitsNet
+ UnitsNet.RadiationEquivalentDoseRate
+ v1.0
+ bin\$(Configuration)\$(AssemblyName).xml
+
+
+
+
+
+
+
+
+
+ ..\packages\nanoFramework.CoreLibrary.1.15.5\lib\mscorlib.dll
+ True
+ True
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/UnitsNet.NanoFramework.RadiationEquivalentDoseRate.nuspec b/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/UnitsNet.NanoFramework.RadiationEquivalentDoseRate.nuspec
new file mode 100644
index 0000000000..2f8c8cc211
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/UnitsNet.NanoFramework.RadiationEquivalentDoseRate.nuspec
@@ -0,0 +1,26 @@
+
+
+
+ UnitsNet.nanoFramework.RadiationEquivalentDoseRate
+ 5.61.0
+ Units.NET RadiationEquivalentDoseRate - nanoFramework
+ Andreas Gullberg Larsen,nanoframework
+ UnitsNet
+ MIT-0
+ https://github.com/angularsen/UnitsNet
+ false
+ Adds RadiationEquivalentDoseRate units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.
+ https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png
+
+
+ Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+ en-US
+ nanoframework radiationequivalentdoserate unit units quantity quantities measurement si metric imperial abbreviation abbreviations convert conversion parse immutable
+
+
+
+
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/packages.config b/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/packages.config
new file mode 100644
index 0000000000..313a8dccdf
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/RadiationEquivalentDoseRate/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Units/RadiationEquivalentDoseRateUnit.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Units/RadiationEquivalentDoseRateUnit.g.cs
new file mode 100644
index 0000000000..62efff1af1
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Units/RadiationEquivalentDoseRateUnit.g.cs
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+// ReSharper disable once CheckNamespace
+namespace UnitsNet.Units
+{
+ // Disable missing XML comment warnings for the generated unit enums.
+ #pragma warning disable 1591
+
+ public enum RadiationEquivalentDoseRateUnit
+ {
+ MicrosievertPerHour = 1,
+ MilliroentgenEquivalentManPerHour = 4,
+ MillisievertPerHour = 3,
+ NanosievertPerHour = 2,
+ RoentgenEquivalentManPerHour = 5,
+ SievertPerHour = 6,
+ }
+
+ #pragma warning restore 1591
+}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln b/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
index d64098f57d..8d39423a0d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
+++ b/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
@@ -172,6 +172,8 @@ Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "PressureChangeRate", "Press
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "RadiationEquivalentDose", "RadiationEquivalentDose\RadiationEquivalentDose.nfproj", "{dcdccf04-c930-b455-77a4-d9d4a7df8723}"
EndProject
+Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "RadiationEquivalentDoseRate", "RadiationEquivalentDoseRate\RadiationEquivalentDoseRate.nfproj", "{8eec9904-f4bb-c601-86ac-80fb153599f9}"
+EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "RadiationExposure", "RadiationExposure\RadiationExposure.nfproj", "{69b383c7-828a-1857-cbe2-f11b9ba77320}"
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Radioactivity", "Radioactivity\Radioactivity.nfproj", "{abf4b42f-e999-2a78-403f-fb09524f186a}"
@@ -766,6 +768,12 @@ Global
{dcdccf04-c930-b455-77a4-d9d4a7df8723}.Release|Any CPU.ActiveCfg = Release|Any CPU
{dcdccf04-c930-b455-77a4-d9d4a7df8723}.Release|Any CPU.Build.0 = Release|Any CPU
{dcdccf04-c930-b455-77a4-d9d4a7df8723}.Release|Any CPU.Deploy.0 = Release|Any CPU
+{8eec9904-f4bb-c601-86ac-80fb153599f9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+{8eec9904-f4bb-c601-86ac-80fb153599f9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+{8eec9904-f4bb-c601-86ac-80fb153599f9}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+{8eec9904-f4bb-c601-86ac-80fb153599f9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+{8eec9904-f4bb-c601-86ac-80fb153599f9}.Release|Any CPU.Build.0 = Release|Any CPU
+{8eec9904-f4bb-c601-86ac-80fb153599f9}.Release|Any CPU.Deploy.0 = Release|Any CPU
{69b383c7-828a-1857-cbe2-f11b9ba77320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69b383c7-828a-1857-cbe2-f11b9ba77320}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69b383c7-828a-1857-cbe2-f11b9ba77320}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToRadiationEquivalentDoseRateExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToRadiationEquivalentDoseRateExtensionsTest.g.cs
new file mode 100644
index 0000000000..de765026cd
--- /dev/null
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToRadiationEquivalentDoseRateExtensionsTest.g.cs
@@ -0,0 +1,52 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+using UnitsNet.NumberExtensions.NumberToRadiationEquivalentDoseRate;
+using Xunit;
+
+namespace UnitsNet.Tests
+{
+ public class NumberToRadiationEquivalentDoseRateExtensionsTests
+ {
+ [Fact]
+ public void NumberToMicrosievertsPerHourTest() =>
+ Assert.Equal(RadiationEquivalentDoseRate.FromMicrosievertsPerHour(2), 2.MicrosievertsPerHour());
+
+ [Fact]
+ public void NumberToMilliroentgensEquivalentManPerHourTest() =>
+ Assert.Equal(RadiationEquivalentDoseRate.FromMilliroentgensEquivalentManPerHour(2), 2.MilliroentgensEquivalentManPerHour());
+
+ [Fact]
+ public void NumberToMillisievertsPerHourTest() =>
+ Assert.Equal(RadiationEquivalentDoseRate.FromMillisievertsPerHour(2), 2.MillisievertsPerHour());
+
+ [Fact]
+ public void NumberToNanosievertsPerHourTest() =>
+ Assert.Equal(RadiationEquivalentDoseRate.FromNanosievertsPerHour(2), 2.NanosievertsPerHour());
+
+ [Fact]
+ public void NumberToRoentgensEquivalentManPerHourTest() =>
+ Assert.Equal(RadiationEquivalentDoseRate.FromRoentgensEquivalentManPerHour(2), 2.RoentgensEquivalentManPerHour());
+
+ [Fact]
+ public void NumberToSievertsPerHourTest() =>
+ Assert.Equal(RadiationEquivalentDoseRate.FromSievertsPerHour(2), 2.SievertsPerHour());
+
+ }
+}
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationEquivalentDoseRateExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationEquivalentDoseRateExtensions.g.cs
new file mode 100644
index 0000000000..9bec7786d8
--- /dev/null
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToRadiationEquivalentDoseRateExtensions.g.cs
@@ -0,0 +1,84 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+using System;
+
+#if NET7_0_OR_GREATER
+using System.Numerics;
+#endif
+
+#nullable enable
+
+namespace UnitsNet.NumberExtensions.NumberToRadiationEquivalentDoseRate
+{
+ ///
+ /// A number to RadiationEquivalentDoseRate Extensions
+ ///
+ public static class NumberToRadiationEquivalentDoseRateExtensions
+ {
+ ///
+ public static RadiationEquivalentDoseRate MicrosievertsPerHour(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#endif
+ => RadiationEquivalentDoseRate.FromMicrosievertsPerHour(Convert.ToDouble(value));
+
+ ///
+ public static RadiationEquivalentDoseRate MilliroentgensEquivalentManPerHour(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#endif
+ => RadiationEquivalentDoseRate.FromMilliroentgensEquivalentManPerHour(Convert.ToDouble(value));
+
+ ///
+ public static RadiationEquivalentDoseRate MillisievertsPerHour(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#endif
+ => RadiationEquivalentDoseRate.FromMillisievertsPerHour(Convert.ToDouble(value));
+
+ ///
+ public static RadiationEquivalentDoseRate NanosievertsPerHour(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#endif
+ => RadiationEquivalentDoseRate.FromNanosievertsPerHour(Convert.ToDouble(value));
+
+ ///
+ public static RadiationEquivalentDoseRate RoentgensEquivalentManPerHour(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#endif
+ => RadiationEquivalentDoseRate.FromRoentgensEquivalentManPerHour(Convert.ToDouble(value));
+
+ ///
+ public static RadiationEquivalentDoseRate SievertsPerHour(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#endif
+ => RadiationEquivalentDoseRate.FromSievertsPerHour(Convert.ToDouble(value));
+
+ }
+}
diff --git a/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseRateTests.cs b/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseRateTests.cs
new file mode 100644
index 0000000000..a0142e1f47
--- /dev/null
+++ b/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseRateTests.cs
@@ -0,0 +1,34 @@
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+using System;
+using Xunit;
+
+namespace UnitsNet.Tests.CustomCode
+{
+ public class RadiationEquivalentDoseRateTests : RadiationEquivalentDoseRateTestsBase
+ {
+ // Override properties in base class here
+ protected override bool SupportsSIUnitSystem => false;
+ protected override double SievertsPerHourInOneSievertPerHour => 1;
+ protected override double MillisievertsPerHourInOneSievertPerHour => 1e+3;
+ protected override double MicrosievertsPerHourInOneSievertPerHour => 1e+6;
+ protected override double NanosievertsPerHourInOneSievertPerHour => 1e+9;
+ protected override double RoentgensEquivalentManPerHourInOneSievertPerHour => 100;
+ protected override double MilliroentgensEquivalentManPerHourInOneSievertPerHour => 1e+5;
+
+ [Fact]
+ public void RadiationEquivalentDoseRateTimesTimeSpanEqualsRadiationEquivalentDose()
+ {
+ RadiationEquivalentDose dose = RadiationEquivalentDoseRate.FromSievertsPerHour(20)*TimeSpan.FromHours(2);
+ Assert.Equal(dose, RadiationEquivalentDose.FromSieverts(40));
+ }
+
+ [Fact]
+ public void RadiationEquivalentDoseRateTimesDurationEqualsRadiationEquivalentDose()
+ {
+ RadiationEquivalentDose dose = RadiationEquivalentDoseRate.FromSievertsPerHour(20)*Duration.FromHours(2);
+ Assert.Equal(dose, RadiationEquivalentDose.FromSieverts(40));
+ }
+ }
+}
diff --git a/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseTests.cs b/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseTests.cs
index 717fc0410a..36efb70f39 100644
--- a/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseTests.cs
+++ b/UnitsNet.Tests/CustomCode/RadiationEquivalentDoseTests.cs
@@ -2,6 +2,7 @@
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
using System;
+using Xunit;
namespace UnitsNet.Tests.CustomCode
{
@@ -15,5 +16,19 @@ public class RadiationEquivalentDoseTests : RadiationEquivalentDoseTestsBase
protected override double NanosievertsInOneSievert => 1e+9;
protected override double MilliroentgensEquivalentManInOneSievert => 1e+5;
protected override double RoentgensEquivalentManInOneSievert => 100;
+
+ [Fact]
+ public void RadiationEquivalentDoseDividedByDurationEqualsRadiationEquivalentDoseRate()
+ {
+ RadiationEquivalentDoseRate dose = RadiationEquivalentDose.FromSieverts(20)/Duration.FromHours(2);
+ Assert.Equal(dose, RadiationEquivalentDoseRate.FromSievertsPerHour(10));
+ }
+
+ [Fact]
+ public void RadiationEquivalentDoseDividedByTimeSpanEqualsRadiationEquivalentDoseRate()
+ {
+ RadiationEquivalentDoseRate dose = RadiationEquivalentDose.FromSieverts(20)/TimeSpan.FromHours(2);
+ Assert.Equal(dose, RadiationEquivalentDoseRate.FromSievertsPerHour(10));
+ }
}
}
diff --git a/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs b/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
index 7dc41682e2..6b689d2377 100644
--- a/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
@@ -119,6 +119,7 @@ void Assertion(int expectedValue, Enum expectedUnit, IQuantity quantity)
Assertion(3, PressureUnit.Torr, Quantity.From(3, PressureUnit.Torr));
Assertion(3, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond, Quantity.From(3, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond));
Assertion(3, RadiationEquivalentDoseUnit.Sievert, Quantity.From(3, RadiationEquivalentDoseUnit.Sievert));
+ Assertion(3, RadiationEquivalentDoseRateUnit.SievertPerHour, Quantity.From(3, RadiationEquivalentDoseRateUnit.SievertPerHour));
Assertion(3, RadiationExposureUnit.Roentgen, Quantity.From(3, RadiationExposureUnit.Roentgen));
Assertion(3, RadioactivityUnit.Terarutherford, Quantity.From(3, RadioactivityUnit.Terarutherford));
Assertion(3, RatioUnit.Percent, Quantity.From(3, RatioUnit.Percent));
@@ -250,6 +251,7 @@ public void QuantityInfo_IsSameAsStaticInfoProperty()
Assertion(Pressure.Info, Pressure.Zero);
Assertion(PressureChangeRate.Info, PressureChangeRate.Zero);
Assertion(RadiationEquivalentDose.Info, RadiationEquivalentDose.Zero);
+ Assertion(RadiationEquivalentDoseRate.Info, RadiationEquivalentDoseRate.Zero);
Assertion(RadiationExposure.Info, RadiationExposure.Zero);
Assertion(Radioactivity.Info, Radioactivity.Zero);
Assertion(Ratio.Info, Ratio.Zero);
@@ -381,6 +383,7 @@ public void Dimensions_IsSameAsStaticBaseDimensions()
Assertion(Pressure.BaseDimensions, Pressure.Zero);
Assertion(PressureChangeRate.BaseDimensions, PressureChangeRate.Zero);
Assertion(RadiationEquivalentDose.BaseDimensions, RadiationEquivalentDose.Zero);
+ Assertion(RadiationEquivalentDoseRate.BaseDimensions, RadiationEquivalentDoseRate.Zero);
Assertion(RadiationExposure.BaseDimensions, RadiationExposure.Zero);
Assertion(Radioactivity.BaseDimensions, Radioactivity.Zero);
Assertion(Ratio.BaseDimensions, Ratio.Zero);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs
new file mode 100644
index 0000000000..0bb5b6b144
--- /dev/null
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs
@@ -0,0 +1,914 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading;
+using UnitsNet.Tests.TestsBase;
+using UnitsNet.Units;
+using Xunit;
+
+// Disable build warning CS1718: Comparison made to same variable; did you mean to compare something else?
+#pragma warning disable 1718
+
+// ReSharper disable once CheckNamespace
+namespace UnitsNet.Tests
+{
+ ///
+ /// Test of RadiationEquivalentDoseRate.
+ ///
+// ReSharper disable once PartialTypeWithSinglePart
+ public abstract partial class RadiationEquivalentDoseRateTestsBase : QuantityTestsBase
+ {
+ protected abstract double MicrosievertsPerHourInOneSievertPerHour { get; }
+ protected abstract double MilliroentgensEquivalentManPerHourInOneSievertPerHour { get; }
+ protected abstract double MillisievertsPerHourInOneSievertPerHour { get; }
+ protected abstract double NanosievertsPerHourInOneSievertPerHour { get; }
+ protected abstract double RoentgensEquivalentManPerHourInOneSievertPerHour { get; }
+ protected abstract double SievertsPerHourInOneSievertPerHour { get; }
+
+// ReSharper disable VirtualMemberNeverOverriden.Global
+ protected virtual double MicrosievertsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double MilliroentgensEquivalentManPerHourTolerance { get { return 1e-5; } }
+ protected virtual double MillisievertsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double NanosievertsPerHourTolerance { get { return 1e-5; } }
+ protected virtual double RoentgensEquivalentManPerHourTolerance { get { return 1e-5; } }
+ protected virtual double SievertsPerHourTolerance { get { return 1e-5; } }
+// ReSharper restore VirtualMemberNeverOverriden.Global
+
+ protected (double UnitsInBaseUnit, double Tolerence) GetConversionFactor(RadiationEquivalentDoseRateUnit unit)
+ {
+ return unit switch
+ {
+ RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (MicrosievertsPerHourInOneSievertPerHour, MicrosievertsPerHourTolerance),
+ RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (MilliroentgensEquivalentManPerHourInOneSievertPerHour, MilliroentgensEquivalentManPerHourTolerance),
+ RadiationEquivalentDoseRateUnit.MillisievertPerHour => (MillisievertsPerHourInOneSievertPerHour, MillisievertsPerHourTolerance),
+ RadiationEquivalentDoseRateUnit.NanosievertPerHour => (NanosievertsPerHourInOneSievertPerHour, NanosievertsPerHourTolerance),
+ RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => (RoentgensEquivalentManPerHourInOneSievertPerHour, RoentgensEquivalentManPerHourTolerance),
+ RadiationEquivalentDoseRateUnit.SievertPerHour => (SievertsPerHourInOneSievertPerHour, SievertsPerHourTolerance),
+ _ => throw new NotSupportedException()
+ };
+ }
+
+ public static IEnumerable