diff --git a/UnitsNet.Tests/CustomCode/InformationTests.cs b/UnitsNet.Tests/CustomCode/InformationTests.cs index 06af202290..b96ed1d57a 100644 --- a/UnitsNet.Tests/CustomCode/InformationTests.cs +++ b/UnitsNet.Tests/CustomCode/InformationTests.cs @@ -84,5 +84,17 @@ public void OneKBHas1000Bytes() { Assert.AreEqual(1000, Information.FromKilobytes(1).Bytes); } + + [Test] + public void MaxValueIsCorrectForUnitWithBaseTypeDecimal() + { + Assert.AreEqual(decimal.MaxValue, Information.MaxValue.Bits); + } + + [Test] + public void MinValueIsCorrectForUnitWithBaseTypeDecimal() + { + Assert.AreEqual(decimal.MinValue, Information.MinValue.Bits); + } } } \ No newline at end of file diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index 6bc9ee6cce..ebf08f7b6a 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -123,5 +123,17 @@ public void ToStringReturnsCorrectNumberAndUnitWithCentimeterAsDefualtUnit() Length.ToStringDefaultUnit = oldUnit; Assert.AreEqual("2 cm", valueString); } + + [Test] + public void MaxValueIsCorrectForUnitWithBaseTypeDouble() + { + Assert.AreEqual(double.MaxValue, Length.MaxValue.Meters); + } + + [Test] + public void MinValueIsCorrectForUnitWithBaseTypeDouble() + { + Assert.AreEqual(double.MinValue, Length.MinValue.Meters); + } } } \ No newline at end of file diff --git a/UnitsNet/GeneratedCode/UnitClasses/Acceleration.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Acceleration.g.cs index 5bfb9fc0e2..9c022c4e6e 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Acceleration.g.cs @@ -828,5 +828,27 @@ public string ToString(AccelerationUnit unit, [CanBeNull] Culture culture, [NotN object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Acceleration + /// + public static Acceleration MaxValue + { + get + { + return new Acceleration(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Acceleration + /// + public static Acceleration MinValue + { + get + { + return new Acceleration(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/UnitClasses/AmplitudeRatio.g.cs index 6c2fd53bbf..61b01e1fe7 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/AmplitudeRatio.g.cs @@ -688,5 +688,27 @@ public string ToString(AmplitudeRatioUnit unit, [CanBeNull] Culture culture, [No object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of AmplitudeRatio + /// + public static AmplitudeRatio MaxValue + { + get + { + return new AmplitudeRatio(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of AmplitudeRatio + /// + public static AmplitudeRatio MinValue + { + get + { + return new AmplitudeRatio(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Angle.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Angle.g.cs index fc40c65f91..4d4fa8fa32 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Angle.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Angle.g.cs @@ -1050,5 +1050,27 @@ public string ToString(AngleUnit unit, [CanBeNull] Culture culture, [NotNull] st object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Angle + /// + public static Angle MaxValue + { + get + { + return new Angle(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Angle + /// + public static Angle MinValue + { + get + { + return new Angle(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Area.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Area.g.cs index f60a5d5ed8..e9c9510843 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Area.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Area.g.cs @@ -939,5 +939,27 @@ public string ToString(AreaUnit unit, [CanBeNull] Culture culture, [NotNull] str object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Area + /// + public static Area MaxValue + { + get + { + return new Area(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Area + /// + public static Area MinValue + { + get + { + return new Area(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/UnitClasses/BrakeSpecificFuelConsumption.g.cs index 8216315575..60fcc94126 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/BrakeSpecificFuelConsumption.g.cs @@ -680,5 +680,27 @@ public string ToString(BrakeSpecificFuelConsumptionUnit unit, [CanBeNull] Cultur object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of BrakeSpecificFuelConsumption + /// + public static BrakeSpecificFuelConsumption MaxValue + { + get + { + return new BrakeSpecificFuelConsumption(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of BrakeSpecificFuelConsumption + /// + public static BrakeSpecificFuelConsumption MinValue + { + get + { + return new BrakeSpecificFuelConsumption(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs index 902f5e43d5..c61d33c095 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Density.g.cs @@ -939,5 +939,27 @@ public string ToString(DensityUnit unit, [CanBeNull] Culture culture, [NotNull] object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Density + /// + public static Density MaxValue + { + get + { + return new Density(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Density + /// + public static Density MinValue + { + get + { + return new Density(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Duration.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Duration.g.cs index ec1b4bdcb3..394bda1b5c 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Duration.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Duration.g.cs @@ -939,5 +939,27 @@ public string ToString(DurationUnit unit, [CanBeNull] Culture culture, [NotNull] object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Duration + /// + public static Duration MaxValue + { + get + { + return new Duration(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Duration + /// + public static Duration MinValue + { + get + { + return new Duration(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/UnitClasses/DynamicViscosity.g.cs index 2bf17cba1c..498758bcb3 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/DynamicViscosity.g.cs @@ -754,5 +754,27 @@ public string ToString(DynamicViscosityUnit unit, [CanBeNull] Culture culture, [ object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of DynamicViscosity + /// + public static DynamicViscosity MaxValue + { + get + { + return new DynamicViscosity(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of DynamicViscosity + /// + public static DynamicViscosity MinValue + { + get + { + return new DynamicViscosity(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/UnitClasses/ElectricCurrent.g.cs index a96ce6af6c..8a0ac8a3ea 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/ElectricCurrent.g.cs @@ -791,5 +791,27 @@ public string ToString(ElectricCurrentUnit unit, [CanBeNull] Culture culture, [N object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of ElectricCurrent + /// + public static ElectricCurrent MaxValue + { + get + { + return new ElectricCurrent(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of ElectricCurrent + /// + public static ElectricCurrent MinValue + { + get + { + return new ElectricCurrent(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/UnitClasses/ElectricPotential.g.cs index 4a9bf7fbf1..b5637817df 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/ElectricPotential.g.cs @@ -754,5 +754,27 @@ public string ToString(ElectricPotentialUnit unit, [CanBeNull] Culture culture, object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of ElectricPotential + /// + public static ElectricPotential MaxValue + { + get + { + return new ElectricPotential(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of ElectricPotential + /// + public static ElectricPotential MinValue + { + get + { + return new ElectricPotential(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/UnitClasses/ElectricResistance.g.cs index a9a8a3ac28..3ad3a60862 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/ElectricResistance.g.cs @@ -680,5 +680,27 @@ public string ToString(ElectricResistanceUnit unit, [CanBeNull] Culture culture, object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of ElectricResistance + /// + public static ElectricResistance MaxValue + { + get + { + return new ElectricResistance(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of ElectricResistance + /// + public static ElectricResistance MinValue + { + get + { + return new ElectricResistance(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs index 79ec46159c..db89cdb0b3 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs @@ -1050,5 +1050,27 @@ public string ToString(EnergyUnit unit, [CanBeNull] Culture culture, [NotNull] s object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Energy + /// + public static Energy MaxValue + { + get + { + return new Energy(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Energy + /// + public static Energy MinValue + { + get + { + return new Energy(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Flow.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Flow.g.cs index 2770814587..1971620ec1 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Flow.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Flow.g.cs @@ -1013,5 +1013,27 @@ public string ToString(FlowUnit unit, [CanBeNull] Culture culture, [NotNull] str object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Flow + /// + public static Flow MaxValue + { + get + { + return new Flow(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Flow + /// + public static Flow MinValue + { + get + { + return new Flow(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs index 7c95bf0766..8913c442af 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs @@ -865,5 +865,27 @@ public string ToString(ForceUnit unit, [CanBeNull] Culture culture, [NotNull] st object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Force + /// + public static Force MaxValue + { + get + { + return new Force(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Force + /// + public static Force MinValue + { + get + { + return new Force(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/UnitClasses/ForceChangeRate.g.cs index 91878c066a..fa547d0a4a 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/ForceChangeRate.g.cs @@ -828,5 +828,27 @@ public string ToString(ForceChangeRateUnit unit, [CanBeNull] Culture culture, [N object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of ForceChangeRate + /// + public static ForceChangeRate MaxValue + { + get + { + return new ForceChangeRate(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of ForceChangeRate + /// + public static ForceChangeRate MinValue + { + get + { + return new ForceChangeRate(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Frequency.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Frequency.g.cs index baf2dfd550..4456ed2f87 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Frequency.g.cs @@ -865,5 +865,27 @@ public string ToString(FrequencyUnit unit, [CanBeNull] Culture culture, [NotNull object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Frequency + /// + public static Frequency MaxValue + { + get + { + return new Frequency(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Frequency + /// + public static Frequency MinValue + { + get + { + return new Frequency(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Information.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Information.g.cs index 404c16af1c..01658662d6 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Information.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Information.g.cs @@ -1531,5 +1531,27 @@ public string ToString(InformationUnit unit, [CanBeNull] Culture culture, [NotNu object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Information + /// + public static Information MaxValue + { + get + { + return new Information(decimal.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Information + /// + public static Information MinValue + { + get + { + return new Information(decimal.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/UnitClasses/KinematicViscosity.g.cs index 92597ce394..9b297d0d67 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/KinematicViscosity.g.cs @@ -865,5 +865,27 @@ public string ToString(KinematicViscosityUnit unit, [CanBeNull] Culture culture, object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of KinematicViscosity + /// + public static KinematicViscosity MaxValue + { + get + { + return new KinematicViscosity(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of KinematicViscosity + /// + public static KinematicViscosity MinValue + { + get + { + return new KinematicViscosity(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Length.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Length.g.cs index 9d9f04e890..542b6d44e7 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Length.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Length.g.cs @@ -1087,5 +1087,27 @@ public string ToString(LengthUnit unit, [CanBeNull] Culture culture, [NotNull] s object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Length + /// + public static Length MaxValue + { + get + { + return new Length(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Length + /// + public static Length MinValue + { + get + { + return new Length(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Level.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Level.g.cs index 83b169e336..5c9b6bd633 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Level.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Level.g.cs @@ -651,5 +651,27 @@ public string ToString(LevelUnit unit, [CanBeNull] Culture culture, [NotNull] st object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Level + /// + public static Level MaxValue + { + get + { + return new Level(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Level + /// + public static Level MinValue + { + get + { + return new Level(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Mass.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Mass.g.cs index 667d984b65..be65760006 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Mass.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Mass.g.cs @@ -1198,5 +1198,27 @@ public string ToString(MassUnit unit, [CanBeNull] Culture culture, [NotNull] str object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Mass + /// + public static Mass MaxValue + { + get + { + return new Mass(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Mass + /// + public static Mass MinValue + { + get + { + return new Mass(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/MassFlow.g.cs b/UnitsNet/GeneratedCode/UnitClasses/MassFlow.g.cs index 85a7d836e3..692b9f8d6c 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/MassFlow.g.cs @@ -939,5 +939,27 @@ public string ToString(MassFlowUnit unit, [CanBeNull] Culture culture, [NotNull] object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of MassFlow + /// + public static MassFlow MaxValue + { + get + { + return new MassFlow(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of MassFlow + /// + public static MassFlow MinValue + { + get + { + return new MassFlow(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Power.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Power.g.cs index 624657476a..fcf9e478b4 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Power.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Power.g.cs @@ -1161,5 +1161,27 @@ public string ToString(PowerUnit unit, [CanBeNull] Culture culture, [NotNull] st object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Power + /// + public static Power MaxValue + { + get + { + return new Power(decimal.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Power + /// + public static Power MinValue + { + get + { + return new Power(decimal.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/PowerRatio.g.cs b/UnitsNet/GeneratedCode/UnitClasses/PowerRatio.g.cs index c54d984bc6..b6255b89ee 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/PowerRatio.g.cs @@ -651,5 +651,27 @@ public string ToString(PowerRatioUnit unit, [CanBeNull] Culture culture, [NotNul object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of PowerRatio + /// + public static PowerRatio MaxValue + { + get + { + return new PowerRatio(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of PowerRatio + /// + public static PowerRatio MinValue + { + get + { + return new PowerRatio(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Pressure.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Pressure.g.cs index e3c61c0ac7..c500f701c1 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Pressure.g.cs @@ -1790,5 +1790,27 @@ public string ToString(PressureUnit unit, [CanBeNull] Culture culture, [NotNull] object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Pressure + /// + public static Pressure MaxValue + { + get + { + return new Pressure(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Pressure + /// + public static Pressure MinValue + { + get + { + return new Pressure(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/UnitClasses/PressureChangeRate.g.cs index 94a1ebf1e1..b217896226 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/PressureChangeRate.g.cs @@ -717,5 +717,27 @@ public string ToString(PressureChangeRateUnit unit, [CanBeNull] Culture culture, object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of PressureChangeRate + /// + public static PressureChangeRate MaxValue + { + get + { + return new PressureChangeRate(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of PressureChangeRate + /// + public static PressureChangeRate MinValue + { + get + { + return new PressureChangeRate(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Ratio.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Ratio.g.cs index 12daea905c..946be21278 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Ratio.g.cs @@ -791,5 +791,27 @@ public string ToString(RatioUnit unit, [CanBeNull] Culture culture, [NotNull] st object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Ratio + /// + public static Ratio MaxValue + { + get + { + return new Ratio(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Ratio + /// + public static Ratio MinValue + { + get + { + return new Ratio(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/UnitClasses/RotationalSpeed.g.cs index 72d4dea1fb..6b39b477d0 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/RotationalSpeed.g.cs @@ -1050,5 +1050,27 @@ public string ToString(RotationalSpeedUnit unit, [CanBeNull] Culture culture, [N object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of RotationalSpeed + /// + public static RotationalSpeed MaxValue + { + get + { + return new RotationalSpeed(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of RotationalSpeed + /// + public static RotationalSpeed MinValue + { + get + { + return new RotationalSpeed(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/UnitClasses/SpecificEnergy.g.cs index cb525e883d..f0d7fea4c2 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/SpecificEnergy.g.cs @@ -865,5 +865,27 @@ public string ToString(SpecificEnergyUnit unit, [CanBeNull] Culture culture, [No object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of SpecificEnergy + /// + public static SpecificEnergy MaxValue + { + get + { + return new SpecificEnergy(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of SpecificEnergy + /// + public static SpecificEnergy MinValue + { + get + { + return new SpecificEnergy(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/UnitClasses/SpecificWeight.g.cs index ef580ef065..5b73078424 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/SpecificWeight.g.cs @@ -1161,5 +1161,27 @@ public string ToString(SpecificWeightUnit unit, [CanBeNull] Culture culture, [No object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of SpecificWeight + /// + public static SpecificWeight MaxValue + { + get + { + return new SpecificWeight(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of SpecificWeight + /// + public static SpecificWeight MinValue + { + get + { + return new SpecificWeight(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Speed.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Speed.g.cs index fe6643ee78..bc0600642d 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Speed.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Speed.g.cs @@ -1272,5 +1272,27 @@ public string ToString(SpeedUnit unit, [CanBeNull] Culture culture, [NotNull] st object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Speed + /// + public static Speed MaxValue + { + get + { + return new Speed(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Speed + /// + public static Speed MinValue + { + get + { + return new Speed(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Temperature.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Temperature.g.cs index 608c3a37cf..0b743f3a06 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Temperature.g.cs @@ -865,5 +865,27 @@ public string ToString(TemperatureUnit unit, [CanBeNull] Culture culture, [NotNu object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Temperature + /// + public static Temperature MaxValue + { + get + { + return new Temperature(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Temperature + /// + public static Temperature MinValue + { + get + { + return new Temperature(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/UnitClasses/TemperatureChangeRate.g.cs index c3b50dcb00..5b0697acd2 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/TemperatureChangeRate.g.cs @@ -902,5 +902,27 @@ public string ToString(TemperatureChangeRateUnit unit, [CanBeNull] Culture cultu object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of TemperatureChangeRate + /// + public static TemperatureChangeRate MaxValue + { + get + { + return new TemperatureChangeRate(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of TemperatureChangeRate + /// + public static TemperatureChangeRate MinValue + { + get + { + return new TemperatureChangeRate(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Torque.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Torque.g.cs index da3f608d9a..e319ee16a1 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Torque.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Torque.g.cs @@ -1161,5 +1161,27 @@ public string ToString(TorqueUnit unit, [CanBeNull] Culture culture, [NotNull] s object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Torque + /// + public static Torque MaxValue + { + get + { + return new Torque(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Torque + /// + public static Torque MinValue + { + get + { + return new Torque(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/VitaminA.g.cs b/UnitsNet/GeneratedCode/UnitClasses/VitaminA.g.cs index cee429d30b..2fa8f62689 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/VitaminA.g.cs @@ -606,5 +606,27 @@ public string ToString(VitaminAUnit unit, [CanBeNull] Culture culture, [NotNull] object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of VitaminA + /// + public static VitaminA MaxValue + { + get + { + return new VitaminA(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of VitaminA + /// + public static VitaminA MinValue + { + get + { + return new VitaminA(double.MinValue); + } + } } } diff --git a/UnitsNet/GeneratedCode/UnitClasses/Volume.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Volume.g.cs index 28d5e4d23c..91ef209fef 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Volume.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Volume.g.cs @@ -1681,5 +1681,27 @@ public string ToString(VolumeUnit unit, [CanBeNull] Culture culture, [NotNull] s object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of Volume + /// + public static Volume MaxValue + { + get + { + return new Volume(double.MaxValue); + } + } + + /// + /// Represents the smallest possible value of Volume + /// + public static Volume MinValue + { + get + { + return new Volume(double.MinValue); + } + } } } diff --git a/UnitsNet/Scripts/Include-GenerateUnitClassSourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateUnitClassSourceCode.ps1 index 9597b8a9fa..1d6a69a5a4 100644 --- a/UnitsNet/Scripts/Include-GenerateUnitClassSourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateUnitClassSourceCode.ps1 @@ -666,6 +666,28 @@ namespace UnitsNet object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, formatProvider, args); return string.Format(formatProvider, format, formatArgs); } + + /// + /// Represents the largest possible value of $className + /// + public static $className MaxValue + { + get + { + return new $className($baseType.MaxValue); + } + } + + /// + /// Represents the smallest possible value of $className + /// + public static $className MinValue + { + get + { + return new $className($baseType.MinValue); + } + } } } "@;