diff --git a/Common/UnitDefinitions/Flatness.json b/Common/UnitDefinitions/Flatness.json
new file mode 100644
index 0000000000..133ad4590c
--- /dev/null
+++ b/Common/UnitDefinitions/Flatness.json
@@ -0,0 +1,31 @@
+{
+ "Name": "Flatness",
+ "BaseUnit": "IUnit",
+ "XmlDocSummary": "Flatness is a measurement for the deviation of a surface from a perfectly flat surface.",
+ "Units": [
+ {
+ "SingularName": "IUnit",
+ "PluralName": "IUnits",
+ "FromUnitToBaseFunc": "{x}",
+ "FromBaseToUnitFunc": "{x}",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "I-Units" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "MicrometerPerMeter",
+ "PluralName": "MicrometersPerMeter",
+ "FromUnitToBaseFunc": "{x} / 1e1",
+ "FromBaseToUnitFunc": "{x} * 1e1",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "µm/m" ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/Common/UnitEnumValues.g.json b/Common/UnitEnumValues.g.json
index 3ebdc3d87d..65f8a53196 100644
--- a/Common/UnitEnumValues.g.json
+++ b/Common/UnitEnumValues.g.json
@@ -2018,5 +2018,9 @@
"SquareMeterKelvinPerKilowatt": 5,
"SquareMeterKelvinPerWatt": 4,
"SquareMillimeterKelvinPerWatt": 13
+ },
+ "Flatness": {
+ "IUnit": 2,
+ "MicrometerPerMeter": 4
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Flatness/Flatness.nfproj b/UnitsNet.NanoFramework/GeneratedCode/Flatness/Flatness.nfproj
new file mode 100644
index 0000000000..7a5d51fe41
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Flatness/Flatness.nfproj
@@ -0,0 +1,42 @@
+
+
+
+ $(MSBuildExtensionsPath)\nanoFramework\v1.0\
+
+
+
+ Debug
+ AnyCPU
+ {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ {7953bc3b-7afc-6983-c7f3-b8d65f6e1647}
+ Library
+ Properties
+ 512
+ UnitsNet
+ UnitsNet.Flatness
+ v1.0
+ bin\$(Configuration)\$(AssemblyName).xml
+
+
+
+
+
+
+
+
+
+ ..\packages\nanoFramework.CoreLibrary.1.15.5\lib\mscorlib.dll
+ True
+ True
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Flatness/UnitsNet.NanoFramework.Flatness.nuspec b/UnitsNet.NanoFramework/GeneratedCode/Flatness/UnitsNet.NanoFramework.Flatness.nuspec
new file mode 100644
index 0000000000..4b517b6fc7
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Flatness/UnitsNet.NanoFramework.Flatness.nuspec
@@ -0,0 +1,26 @@
+
+
+
+ UnitsNet.nanoFramework.Flatness
+ 6.0.0-pre019
+ Units.NET Flatness - nanoFramework
+ Andreas Gullberg Larsen,nanoframework
+ UnitsNet
+ MIT-0
+ https://github.com/angularsen/UnitsNet
+ false
+ Adds Flatness 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 flatness unit units quantity quantities measurement si metric imperial abbreviation abbreviations convert conversion parse immutable
+
+
+
+
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Flatness/packages.config b/UnitsNet.NanoFramework/GeneratedCode/Flatness/packages.config
new file mode 100644
index 0000000000..313a8dccdf
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Flatness/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Flatness.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Flatness.g.cs
new file mode 100644
index 0000000000..4261914c67
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Flatness.g.cs
@@ -0,0 +1,169 @@
+//------------------------------------------------------------------------------
+//
+// 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
+{
+ ///
+ ///
+ /// Flatness is a measurement for the deviation of a surface from a perfectly flat surface.
+ ///
+ public struct Flatness
+ {
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ private readonly double _value;
+
+ ///
+ /// The unit this quantity was constructed with.
+ ///
+ private readonly FlatnessUnit _unit;
+
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ public double Value => _value;
+
+ ///
+ public FlatnessUnit 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.
+ public Flatness(double value, FlatnessUnit unit)
+ {
+ _value = value;
+ _unit = unit;
+ }
+
+ ///
+ /// The base unit of Flatness, which is Second. All conversions go via this value.
+ ///
+ public static FlatnessUnit BaseUnit { get; } = FlatnessUnit.IUnit;
+
+ ///
+ /// Represents the largest possible value of Flatness.
+ ///
+ public static Flatness MaxValue { get; } = new Flatness(double.MaxValue, BaseUnit);
+
+ ///
+ /// Represents the smallest possible value of Flatness.
+ ///
+ public static Flatness MinValue { get; } = new Flatness(double.MinValue, BaseUnit);
+
+ ///
+ /// Gets an instance of this quantity with a value of 0 in the base unit Second.
+ ///
+ public static Flatness Zero { get; } = new Flatness(0, BaseUnit);
+ #region Conversion Properties
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double IUnits => As(FlatnessUnit.IUnit);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MicrometersPerMeter => As(FlatnessUnit.MicrometerPerMeter);
+
+ #endregion
+
+ #region Static Factory Methods
+
+ ///
+ /// Creates a from .
+ ///
+ public static Flatness FromIUnits(double iunits) => new Flatness(iunits, FlatnessUnit.IUnit);
+
+ ///
+ /// Creates a from .
+ ///
+ public static Flatness FromMicrometersPerMeter(double micrometerspermeter) => new Flatness(micrometerspermeter, FlatnessUnit.MicrometerPerMeter);
+
+ ///
+ /// Dynamically convert from value and unit enum to .
+ ///
+ /// Value to convert from.
+ /// Unit to convert from.
+ /// Flatness unit value.
+ public static Flatness From(double value, FlatnessUnit fromUnit)
+ {
+ return new Flatness(value, fromUnit);
+ }
+
+ #endregion
+
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(FlatnessUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Flatness to another Flatness with the unit representation .
+ ///
+ /// A Flatness with the specified unit.
+ public Flatness ToUnit(FlatnessUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Flatness(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
+ {
+ FlatnessUnit.IUnit => _value,
+ FlatnessUnit.MicrometerPerMeter => _value / 1e1,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(FlatnessUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ FlatnessUnit.IUnit => baseUnitValue,
+ FlatnessUnit.MicrometerPerMeter => baseUnitValue * 1e1,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
+ }
+}
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Units/FlatnessUnit.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Units/FlatnessUnit.g.cs
new file mode 100644
index 0000000000..21a93e226a
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Units/FlatnessUnit.g.cs
@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+//
+// 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 FlatnessUnit
+ {
+ IUnit = 2,
+ MicrometerPerMeter = 4,
+ }
+
+ #pragma warning restore 1591
+}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln b/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
index f2d98d63c4..4a2265f805 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
+++ b/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
@@ -86,6 +86,8 @@ Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "EnergyDensity", "EnergyDens
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Entropy", "Entropy\Entropy.nfproj", "{816884bb-a5f6-5c07-967b-bb8f21d724b7}"
EndProject
+Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Flatness", "Flatness\Flatness.nfproj", "{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}"
+EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "FluidResistance", "FluidResistance\FluidResistance.nfproj", "{d19281dc-72f6-62a9-18d5-b845d6fd8d99}"
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Force", "Force\Force.nfproj", "{5517dacf-b1ff-6515-e5b6-b5081f92f407}"
@@ -516,6 +518,12 @@ Global
{816884bb-a5f6-5c07-967b-bb8f21d724b7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{816884bb-a5f6-5c07-967b-bb8f21d724b7}.Release|Any CPU.Build.0 = Release|Any CPU
{816884bb-a5f6-5c07-967b-bb8f21d724b7}.Release|Any CPU.Deploy.0 = Release|Any CPU
+{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}.Debug|Any CPU.Build.0 = Debug|Any CPU
+{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}.Release|Any CPU.ActiveCfg = Release|Any CPU
+{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}.Release|Any CPU.Build.0 = Release|Any CPU
+{7953bc3b-7afc-6983-c7f3-b8d65f6e1647}.Release|Any CPU.Deploy.0 = Release|Any CPU
{d19281dc-72f6-62a9-18d5-b845d6fd8d99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{d19281dc-72f6-62a9-18d5-b845d6fd8d99}.Debug|Any CPU.Build.0 = Debug|Any CPU
{d19281dc-72f6-62a9-18d5-b845d6fd8d99}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
diff --git a/UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToFlatnessExtensionsTest.g.cs b/UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToFlatnessExtensionsTest.g.cs
new file mode 100644
index 0000000000..b9a55ee8ed
--- /dev/null
+++ b/UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToFlatnessExtensionsTest.g.cs
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+//
+// 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.NumberToFlatness;
+using Xunit;
+
+namespace UnitsNet.Tests
+{
+ public class NumberToFlatnessExtensionsTests
+ {
+ [Fact]
+ public void NumberToIUnitsTest() =>
+ Assert.Equal(Flatness.FromIUnits(2), 2.IUnits);
+
+ [Fact]
+ public void NumberToMicrometersPerMeterTest() =>
+ Assert.Equal(Flatness.FromMicrometersPerMeter(2), 2.MicrometersPerMeter);
+
+ }
+}
diff --git a/UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToFlatnessExtensions.g.cs b/UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToFlatnessExtensions.g.cs
new file mode 100644
index 0000000000..45750aa574
--- /dev/null
+++ b/UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToFlatnessExtensions.g.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// 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.NumberToFlatness
+{
+ ///
+ /// A number to Flatness Extensions
+ ///
+ public static class NumberToFlatnessExtensions
+ {
+#pragma warning disable CS1591
+ extension(T value)
+#pragma warning restore CS1591
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#else
+ , IConvertible
+#endif
+ {
+ ///
+ public Flatness IUnits
+#if NET7_0_OR_GREATER
+ => Flatness.FromIUnits(double.CreateChecked(value));
+#else
+ => Flatness.FromIUnits(value.ToDouble(null));
+#endif
+
+ ///
+ public Flatness MicrometersPerMeter
+#if NET7_0_OR_GREATER
+ => Flatness.FromMicrometersPerMeter(double.CreateChecked(value));
+#else
+ => Flatness.FromMicrometersPerMeter(value.ToDouble(null));
+#endif
+
+ }
+ }
+}
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFlatnessExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFlatnessExtensionsTest.g.cs
new file mode 100644
index 0000000000..e938ccae71
--- /dev/null
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToFlatnessExtensionsTest.g.cs
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+//
+// 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.NumberToFlatness;
+using Xunit;
+
+namespace UnitsNet.Tests
+{
+ public class NumberToFlatnessExtensionsTests
+ {
+ [Fact]
+ public void NumberToIUnitsTest() =>
+ Assert.Equal(Flatness.FromIUnits(2), 2.IUnits());
+
+ [Fact]
+ public void NumberToMicrometersPerMeterTest() =>
+ Assert.Equal(Flatness.FromMicrometersPerMeter(2), 2.MicrometersPerMeter());
+
+ }
+}
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToFlatnessExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFlatnessExtensions.g.cs
new file mode 100644
index 0000000000..6b1557a7ac
--- /dev/null
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToFlatnessExtensions.g.cs
@@ -0,0 +1,58 @@
+//------------------------------------------------------------------------------
+//
+// 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.NumberToFlatness
+{
+ ///
+ /// A number to Flatness Extensions
+ ///
+ public static class NumberToFlatnessExtensions
+ {
+ ///
+ public static Flatness IUnits(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => Flatness.FromIUnits(double.CreateChecked(value));
+#else
+ , IConvertible
+ => Flatness.FromIUnits(value.ToDouble(null));
+#endif
+
+ ///
+ public static Flatness MicrometersPerMeter(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => Flatness.FromMicrometersPerMeter(double.CreateChecked(value));
+#else
+ , IConvertible
+ => Flatness.FromMicrometersPerMeter(value.ToDouble(null));
+#endif
+
+ }
+}
diff --git a/UnitsNet.Tests/CustomCode/FlatnessTests.cs b/UnitsNet.Tests/CustomCode/FlatnessTests.cs
new file mode 100644
index 0000000000..bee5896a87
--- /dev/null
+++ b/UnitsNet.Tests/CustomCode/FlatnessTests.cs
@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+//
+// 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;
+
+namespace UnitsNet.Tests.CustomCode
+{
+ public class FlatnessTests : FlatnessTestsBase
+ {
+ protected override double IUnitsInOneIUnit => 1;
+ protected override double MicrometersPerMeterInOneIUnit => 10;
+ }
+}
diff --git a/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs b/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
index 9dfabd182a..49bfe48dcb 100644
--- a/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
@@ -76,6 +76,7 @@ void Assertion(int expectedValue, Enum expectedUnit, IQuantity quantity)
Assertion(3, EnergyUnit.WattHour, Quantity.From(3, EnergyUnit.WattHour));
Assertion(3, EnergyDensityUnit.WattHourPerCubicMeter, Quantity.From(3, EnergyDensityUnit.WattHourPerCubicMeter));
Assertion(3, EntropyUnit.MegajoulePerKelvin, Quantity.From(3, EntropyUnit.MegajoulePerKelvin));
+ Assertion(3, FlatnessUnit.MicrometerPerMeter, Quantity.From(3, FlatnessUnit.MicrometerPerMeter));
Assertion(3, FluidResistanceUnit.WoodUnit, Quantity.From(3, FluidResistanceUnit.WoodUnit));
Assertion(3, ForceUnit.TonneForce, Quantity.From(3, ForceUnit.TonneForce));
Assertion(3, ForceChangeRateUnit.PoundForcePerSecond, Quantity.From(3, ForceChangeRateUnit.PoundForcePerSecond));
@@ -211,6 +212,7 @@ public void QuantityInfo_IsSameAsStaticInfoProperty()
Assertion(Energy.Info, Energy.Zero);
Assertion(EnergyDensity.Info, EnergyDensity.Zero);
Assertion(Entropy.Info, Entropy.Zero);
+ Assertion(Flatness.Info, Flatness.Zero);
Assertion(FluidResistance.Info, FluidResistance.Zero);
Assertion(Force.Info, Force.Zero);
Assertion(ForceChangeRate.Info, ForceChangeRate.Zero);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FlatnessTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FlatnessTestsBase.g.cs
new file mode 100644
index 0000000000..f339f4ecc6
--- /dev/null
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FlatnessTestsBase.g.cs
@@ -0,0 +1,625 @@
+//------------------------------------------------------------------------------
+//
+// 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.InternalHelpers;
+using UnitsNet.Tests.Helpers;
+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 Flatness.
+ ///
+// ReSharper disable once PartialTypeWithSinglePart
+ public abstract partial class FlatnessTestsBase : QuantityTestsBase
+ {
+ protected abstract double IUnitsInOneIUnit { get; }
+ protected abstract double MicrometersPerMeterInOneIUnit { get; }
+
+// ReSharper disable VirtualMemberNeverOverriden.Global
+ protected virtual double IUnitsTolerance { get { return 1e-5; } }
+ protected virtual double MicrometersPerMeterTolerance { get { return 1e-5; } }
+// ReSharper restore VirtualMemberNeverOverriden.Global
+
+ protected (double UnitsInBaseUnit, double Tolerence) GetConversionFactor(FlatnessUnit unit)
+ {
+ return unit switch
+ {
+ FlatnessUnit.IUnit => (IUnitsInOneIUnit, IUnitsTolerance),
+ FlatnessUnit.MicrometerPerMeter => (MicrometersPerMeterInOneIUnit, MicrometersPerMeterTolerance),
+ _ => throw new NotSupportedException()
+ };
+ }
+
+ public static IEnumerable