diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index 4d3942f9d5..bf785c8010 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -668,25 +668,25 @@ private void GenerateEqualityAndComparison() /// Returns true if less or equal to. public static bool operator <=({_quantity.Name} left, {_quantity.Name} right) {{ - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; }} /// Returns true if greater than or equal to. public static bool operator >=({_quantity.Name} left, {_quantity.Name} right) {{ - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; }} /// Returns true if less than. public static bool operator <({_quantity.Name} left, {_quantity.Name} right) {{ - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; }} /// Returns true if greater than. public static bool operator >({_quantity.Name} left, {_quantity.Name} right) {{ - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; }} /// Returns true if exactly equal. @@ -715,7 +715,9 @@ public int CompareTo(object obj) /// public int CompareTo({_quantity.Name} other) {{ - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; }} /// @@ -792,7 +794,7 @@ public bool Equals({_quantity.Name} other, double tolerance, ComparisonType comp /// A hash code for the current {_quantity.Name}. public override int GetHashCode() {{ - return new {{ QuantityType, Value, Unit }}.GetHashCode(); + return QuantityType.GetHashCode(); }} #endregion diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs index 2561a73651..be35ea5bde 100644 --- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs @@ -643,7 +643,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() {{ var quantity = {_quantity.Name}.From{_baseUnit.PluralName}(1.0); - Assert.Equal(new {{{_quantity.Name}.QuantityType, quantity.Value, quantity.Unit}}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal({_quantity.Name}.QuantityType.GetHashCode(), quantity.GetHashCode()); }} "); diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs index a7bfeb7b11..c7c1d70549 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Acceleration.FromMetersPerSecondSquared(1.0); - Assert.Equal(new {Acceleration.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Acceleration.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs index a98c19d80d..f19877c224 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs @@ -728,7 +728,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = AmountOfSubstance.FromMoles(1.0); - Assert.Equal(new {AmountOfSubstance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(AmountOfSubstance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs index 708b250965..c0e176f269 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs @@ -567,7 +567,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = AmplitudeRatio.FromDecibelVolts(1.0); - Assert.Equal(new {AmplitudeRatio.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(AmplitudeRatio.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs index 0febe024a9..407f81a2a9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Angle.FromDegrees(1.0); - Assert.Equal(new {Angle.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Angle.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs index 4fa051c4f5..9b7e280415 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentEnergyTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ApparentEnergy.FromVoltampereHours(1.0); - Assert.Equal(new {ApparentEnergy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ApparentEnergy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs index a26aece968..e892729e45 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ApparentPowerTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ApparentPower.FromVoltamperes(1.0); - Assert.Equal(new {ApparentPower.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ApparentPower.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs index dddc3a8f76..9ca0df9467 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = AreaDensity.FromKilogramsPerSquareMeter(1.0); - Assert.Equal(new {AreaDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(AreaDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs index 2249a49b0a..4b3a5dbc56 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs @@ -593,7 +593,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); - Assert.Equal(new {AreaMomentOfInertia.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(AreaMomentOfInertia.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs index 8c75c47491..0f9478d1da 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Area.FromSquareMeters(1.0); - Assert.Equal(new {Area.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Area.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs index 412db29a2d..0b671c2a16 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs @@ -861,7 +861,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = BitRate.FromBitsPerSecond(1.0); - Assert.Equal(new {BitRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(BitRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs index c23cdb9618..6541b398e9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1.0); - Assert.Equal(new {BrakeSpecificFuelConsumption.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(BrakeSpecificFuelConsumption.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs index 9d80acb031..cec680eca1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CapacitanceTestsBase.g.cs @@ -608,7 +608,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Capacitance.FromFarads(1.0); - Assert.Equal(new {Capacitance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Capacitance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs index ca39d1c031..761ba1d4ef 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = CoefficientOfThermalExpansion.FromInverseKelvin(1.0); - Assert.Equal(new {CoefficientOfThermalExpansion.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(CoefficientOfThermalExpansion.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs index 0e541d999b..f6b44dde28 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs @@ -1103,7 +1103,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Density.FromKilogramsPerCubicMeter(1.0); - Assert.Equal(new {Density.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Density.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs index ec6cd5b9df..3483286a47 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs @@ -653,7 +653,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Duration.FromSeconds(1.0); - Assert.Equal(new {Duration.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Duration.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs index 1165333af8..e38b5aa26f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs @@ -653,7 +653,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1.0); - Assert.Equal(new {DynamicViscosity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(DynamicViscosity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs index 2b0a035135..1489048aa5 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricAdmittance.FromSiemens(1.0); - Assert.Equal(new {ElectricAdmittance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricAdmittance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs index 0b0a1a8b91..b827594845 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricChargeDensity.FromCoulombsPerCubicMeter(1.0); - Assert.Equal(new {ElectricChargeDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricChargeDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs index 6758d3fcea..560209e2b1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs @@ -578,7 +578,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricCharge.FromCoulombs(1.0); - Assert.Equal(new {ElectricCharge.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricCharge.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs index 910069f4c3..9f22e1e05d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricConductance.FromSiemens(1.0); - Assert.Equal(new {ElectricConductance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricConductance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs index ecfc40aa40..7f748b5017 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricConductivity.FromSiemensPerMeter(1.0); - Assert.Equal(new {ElectricConductivity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricConductivity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs index fe9de9d9ea..afdfc00d99 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricCurrentDensity.FromAmperesPerSquareMeter(1.0); - Assert.Equal(new {ElectricCurrentDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricCurrentDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs index 95314e1e5e..8044061a52 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricCurrentGradient.FromAmperesPerSecond(1.0); - Assert.Equal(new {ElectricCurrentGradient.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricCurrentGradient.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs index 317bf286b1..c1f02ee53b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs @@ -623,7 +623,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricCurrent.FromAmperes(1.0); - Assert.Equal(new {ElectricCurrent.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricCurrent.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs index 6c1a712012..c9b7e1a591 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricField.FromVoltsPerMeter(1.0); - Assert.Equal(new {ElectricField.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricField.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs index 12c90919fc..52d47a0b55 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricInductance.FromHenries(1.0); - Assert.Equal(new {ElectricInductance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricInductance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs index ca27c93970..d879e4cc00 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialAcTestsBase.g.cs @@ -578,7 +578,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricPotentialAc.FromVoltsAc(1.0); - Assert.Equal(new {ElectricPotentialAc.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricPotentialAc.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs index 9bea7822d6..ac21bdca33 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs @@ -803,7 +803,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricPotentialChangeRate.FromVoltsPerSeconds(1.0); - Assert.Equal(new {ElectricPotentialChangeRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricPotentialChangeRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs index ef1b6a2d63..72151482ba 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialDcTestsBase.g.cs @@ -578,7 +578,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricPotentialDc.FromVoltsDc(1.0); - Assert.Equal(new {ElectricPotentialDc.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricPotentialDc.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs index c984d21229..74f892aa69 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs @@ -578,7 +578,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricPotential.FromVolts(1.0); - Assert.Equal(new {ElectricPotential.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricPotential.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs index 2176bc6587..b331c74ea2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs @@ -593,7 +593,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricResistance.FromOhms(1.0); - Assert.Equal(new {ElectricResistance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricResistance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs index 88ff7e8500..7919d8a9d0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricResistivity.FromOhmMeters(1.0); - Assert.Equal(new {ElectricResistivity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricResistivity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs index c7a52e7880..5f97b56c27 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ElectricSurfaceChargeDensity.FromCoulombsPerSquareMeter(1.0); - Assert.Equal(new {ElectricSurfaceChargeDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ElectricSurfaceChargeDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs index 50bc4b5c24..c924265d6b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs @@ -1043,7 +1043,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Energy.FromJoules(1.0); - Assert.Equal(new {Energy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Energy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs index dd87f6ab7a..adba23f747 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs @@ -608,7 +608,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Entropy.FromJoulesPerKelvin(1.0); - Assert.Equal(new {Entropy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Entropy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs index 548df4c745..5b4de2de15 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs @@ -668,7 +668,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ForceChangeRate.FromNewtonsPerSecond(1.0); - Assert.Equal(new {ForceChangeRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ForceChangeRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs index 51626b8468..f842642c01 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs @@ -1073,7 +1073,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ForcePerLength.FromNewtonsPerMeter(1.0); - Assert.Equal(new {ForcePerLength.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ForcePerLength.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs index 9689367bb5..5e6567e098 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs @@ -728,7 +728,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Force.FromNewtons(1.0); - Assert.Equal(new {Force.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Force.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs index a73055bce6..af36ca357c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs @@ -653,7 +653,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Frequency.FromHertz(1.0); - Assert.Equal(new {Frequency.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Frequency.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs index 1e7d191669..e790a633b9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = FuelEfficiency.FromLitersPer100Kilometers(1.0); - Assert.Equal(new {FuelEfficiency.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(FuelEfficiency.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs index 3fbffc36a7..52b28625c8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs @@ -773,7 +773,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = HeatFlux.FromWattsPerSquareMeter(1.0); - Assert.Equal(new {HeatFlux.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(HeatFlux.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs index da082abe14..c14a5b227b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1.0); - Assert.Equal(new {HeatTransferCoefficient.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(HeatTransferCoefficient.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs index 9476f78b1e..2e7fb1647c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Illuminance.FromLux(1.0); - Assert.Equal(new {Illuminance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Illuminance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs index 1e63906500..b02cd52cb8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs @@ -861,7 +861,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Information.FromBits(1.0); - Assert.Equal(new {Information.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Information.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs index 2761d2f34b..be4e396589 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Irradiance.FromWattsPerSquareMeter(1.0); - Assert.Equal(new {Irradiance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Irradiance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs index 212a5f8ec2..f861058491 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs @@ -608,7 +608,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Irradiation.FromJoulesPerSquareMeter(1.0); - Assert.Equal(new {Irradiation.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Irradiation.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs index b3ec7fef99..570dd45389 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs @@ -623,7 +623,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = KinematicViscosity.FromSquareMetersPerSecond(1.0); - Assert.Equal(new {KinematicViscosity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(KinematicViscosity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LapseRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LapseRateTestsBase.g.cs index fd006236d2..5b2ea4aa80 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LapseRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LapseRateTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = LapseRate.FromDegreesCelciusPerKilometer(1.0); - Assert.Equal(new {LapseRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(LapseRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs index 695b44d3f9..01eeca8257 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs @@ -998,7 +998,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Length.FromMeters(1.0); - Assert.Equal(new {Length.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Length.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs index 8bd8f79de0..85f62f1e71 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs @@ -537,7 +537,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Level.FromDecibels(1.0); - Assert.Equal(new {Level.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Level.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs index 01a64a5151..8ac4f484f0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = LinearDensity.FromKilogramsPerMeter(1.0); - Assert.Equal(new {LinearDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(LinearDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs index d13e557ff5..a301255fe0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs @@ -878,7 +878,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = LinearPowerDensity.FromWattsPerMeter(1.0); - Assert.Equal(new {LinearPowerDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(LinearPowerDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs index 4c6bbef389..7a7408b890 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs @@ -713,7 +713,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Luminosity.FromWatts(1.0); - Assert.Equal(new {Luminosity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Luminosity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs index 8e5c85740d..cac961e4aa 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = LuminousFlux.FromLumens(1.0); - Assert.Equal(new {LuminousFlux.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(LuminousFlux.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs index d1d9a354b5..a85370801b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = LuminousIntensity.FromCandela(1.0); - Assert.Equal(new {LuminousIntensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(LuminousIntensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs index 334fb7b3ad..3cd3563a0e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MagneticField.FromTeslas(1.0); - Assert.Equal(new {MagneticField.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MagneticField.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs index 461fedc57d..f9d222ea86 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MagneticFlux.FromWebers(1.0); - Assert.Equal(new {MagneticFlux.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MagneticFlux.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs index 95f91dccf6..818f70faf7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Magnetization.FromAmperesPerMeter(1.0); - Assert.Equal(new {Magnetization.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Magnetization.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs index 582820f9a7..10cecbc478 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs @@ -1208,7 +1208,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MassConcentration.FromKilogramsPerCubicMeter(1.0); - Assert.Equal(new {MassConcentration.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MassConcentration.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs index 5e4f903ecc..e12e2766b5 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs @@ -998,7 +998,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MassFlow.FromGramsPerSecond(1.0); - Assert.Equal(new {MassFlow.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MassFlow.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs index 98c2f6c2c8..a38c80050d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs @@ -683,7 +683,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MassFlux.FromKilogramsPerSecondPerSquareMeter(1.0); - Assert.Equal(new {MassFlux.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MassFlux.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs index 3d38e4fec8..f20668a6a7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs @@ -863,7 +863,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MassFraction.FromDecimalFractions(1.0); - Assert.Equal(new {MassFraction.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MassFraction.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs index 2b8a75b0c7..81eacc082f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs @@ -923,7 +923,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MassMomentOfInertia.FromKilogramSquareMeters(1.0); - Assert.Equal(new {MassMomentOfInertia.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MassMomentOfInertia.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs index d3e6c78afc..d86427d26b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs @@ -878,7 +878,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Mass.FromKilograms(1.0); - Assert.Equal(new {Mass.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Mass.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs index 3950ef38e4..f3fa928cdd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MolarEnergy.FromJoulesPerMole(1.0); - Assert.Equal(new {MolarEnergy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MolarEnergy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs index 61f6d59220..c9cfa55d2f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MolarEntropy.FromJoulesPerMoleKelvin(1.0); - Assert.Equal(new {MolarEntropy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MolarEntropy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs index 64eaf2504e..05dc2b67cf 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs @@ -683,7 +683,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = MolarMass.FromKilogramsPerMole(1.0); - Assert.Equal(new {MolarMass.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(MolarMass.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs index 5379595111..55afa9097d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs @@ -623,7 +623,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Molarity.FromMolesPerCubicMeter(1.0); - Assert.Equal(new {Molarity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Molarity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs index fe2da572fb..385bdbd6c2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Permeability.FromHenriesPerMeter(1.0); - Assert.Equal(new {Permeability.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Permeability.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs index ca601bf52a..e4253fb0da 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Permittivity.FromFaradsPerMeter(1.0); - Assert.Equal(new {Permittivity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Permittivity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs index e3ec3d1386..981c59e6d4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs @@ -1163,7 +1163,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = PowerDensity.FromWattsPerCubicMeter(1.0); - Assert.Equal(new {PowerDensity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(PowerDensity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs index 6e396fa839..2995bef291 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs @@ -537,7 +537,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = PowerRatio.FromDecibelWatts(1.0); - Assert.Equal(new {PowerRatio.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(PowerRatio.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs index 50cd2cb275..cae66a22e0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs @@ -846,7 +846,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Power.FromWatts(1.0); - Assert.Equal(new {Power.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Power.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs index f0a131094a..fad33dedca 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs @@ -608,7 +608,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); - Assert.Equal(new {PressureChangeRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(PressureChangeRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs index 8651214baa..964144a717 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs @@ -1133,7 +1133,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Pressure.FromPascals(1.0); - Assert.Equal(new {Pressure.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Pressure.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs index 634226dd3b..77df714365 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs @@ -533,7 +533,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = RatioChangeRate.FromDecimalFractionsPerSecond(1.0); - Assert.Equal(new {RatioChangeRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(RatioChangeRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs index 3eae28326a..576a8276e8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs @@ -593,7 +593,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Ratio.FromDecimalFractions(1.0); - Assert.Equal(new {Ratio.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Ratio.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ReactiveEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ReactiveEnergyTestsBase.g.cs index 9eb8376660..62e319a3ad 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ReactiveEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ReactiveEnergyTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ReactiveEnergy.FromVoltampereReactiveHours(1.0); - Assert.Equal(new {ReactiveEnergy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ReactiveEnergy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ReactivePowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ReactivePowerTestsBase.g.cs index 43ad08f7e5..cc25da994d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ReactivePowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ReactivePowerTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); - Assert.Equal(new {ReactivePower.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ReactivePower.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs index d253c9abcf..96aec34dcd 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs @@ -563,7 +563,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = RotationalAcceleration.FromRadiansPerSecondSquared(1.0); - Assert.Equal(new {RotationalAcceleration.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(RotationalAcceleration.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs index 3c299b7771..a78d9dff63 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs @@ -698,7 +698,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = RotationalSpeed.FromRadiansPerSecond(1.0); - Assert.Equal(new {RotationalSpeed.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(RotationalSpeed.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs index 051f000328..5e7dc77aa8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs @@ -578,7 +578,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1.0); - Assert.Equal(new {RotationalStiffnessPerLength.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(RotationalStiffnessPerLength.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs index 99df23a76b..8843cfcbe7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs @@ -998,7 +998,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = RotationalStiffness.FromNewtonMetersPerRadian(1.0); - Assert.Equal(new {RotationalStiffness.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(RotationalStiffness.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs index c74314396d..36b873c50e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = SolidAngle.FromSteradians(1.0); - Assert.Equal(new {SolidAngle.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(SolidAngle.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs index 26758681b1..e2ad1a883c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs @@ -878,7 +878,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = SpecificEnergy.FromJoulesPerKilogram(1.0); - Assert.Equal(new {SpecificEnergy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(SpecificEnergy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs index 42e3875924..d166e13663 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs @@ -638,7 +638,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = SpecificEntropy.FromJoulesPerKilogramKelvin(1.0); - Assert.Equal(new {SpecificEntropy.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(SpecificEntropy.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs index 78bbf330e8..7fc434ceb8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs @@ -548,7 +548,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = SpecificVolume.FromCubicMetersPerKilogram(1.0); - Assert.Equal(new {SpecificVolume.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(SpecificVolume.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs index b4ffa0649f..219157f006 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs @@ -758,7 +758,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = SpecificWeight.FromNewtonsPerCubicMeter(1.0); - Assert.Equal(new {SpecificWeight.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(SpecificWeight.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs index ca618db312..d9ef037f0e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs @@ -983,7 +983,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Speed.FromMetersPerSecond(1.0); - Assert.Equal(new {Speed.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Speed.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs index bcf8f66f5e..48d41b585a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs @@ -653,7 +653,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = TemperatureChangeRate.FromDegreesCelsiusPerSecond(1.0); - Assert.Equal(new {TemperatureChangeRate.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(TemperatureChangeRate.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs index 701405483b..1e82e20222 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs @@ -638,7 +638,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = TemperatureDelta.FromKelvins(1.0); - Assert.Equal(new {TemperatureDelta.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(TemperatureDelta.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs index 15bebb3f2d..ad8693359f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs @@ -641,7 +641,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Temperature.FromKelvins(1.0); - Assert.Equal(new {Temperature.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Temperature.QuantityType.GetHashCode(), quantity.GetHashCode()); } } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs index e333aa2023..7a7ca5a598 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs @@ -533,7 +533,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ThermalConductivity.FromWattsPerMeterKelvin(1.0); - Assert.Equal(new {ThermalConductivity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ThermalConductivity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs index fb86d52699..2cfb3d227e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalResistanceTestsBase.g.cs @@ -578,7 +578,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1.0); - Assert.Equal(new {ThermalResistance.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(ThermalResistance.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TorquePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TorquePerLengthTestsBase.g.cs index f5bfc4c2de..836cbe1a9a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TorquePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TorquePerLengthTestsBase.g.cs @@ -818,7 +818,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = TorquePerLength.FromNewtonMetersPerMeter(1.0); - Assert.Equal(new {TorquePerLength.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(TorquePerLength.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs index 9c641c3f06..a2168d012d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs @@ -818,7 +818,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Torque.FromNewtonMeters(1.0); - Assert.Equal(new {Torque.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Torque.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs index c0a719c379..2c9305273d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Turbidity.FromNTU(1.0); - Assert.Equal(new {Turbidity.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Turbidity.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs index b54ba26f2d..408fa9660c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs @@ -518,7 +518,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = VitaminA.FromInternationalUnits(1.0); - Assert.Equal(new {VitaminA.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(VitaminA.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs index 60cfa492d2..b435628767 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs @@ -803,7 +803,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = VolumeConcentration.FromDecimalFractions(1.0); - Assert.Equal(new {VolumeConcentration.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(VolumeConcentration.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs index 7b02e1cc04..31883ddace 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs @@ -1238,7 +1238,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = VolumeFlow.FromCubicMetersPerSecond(1.0); - Assert.Equal(new {VolumeFlow.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(VolumeFlow.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs index 4db337c2be..39437b27f9 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs @@ -608,7 +608,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = VolumePerLength.FromCubicMetersPerMeter(1.0); - Assert.Equal(new {VolumePerLength.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(VolumePerLength.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs index c62321d6a3..9cc072ee9c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs @@ -1268,7 +1268,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = Volume.FromCubicMeters(1.0); - Assert.Equal(new {Volume.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(Volume.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs index e31cb57a48..ef01a371fe 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs @@ -593,7 +593,7 @@ public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() public void GetHashCode_Equals() { var quantity = WarpingMomentOfInertia.FromMetersToTheSixth(1.0); - Assert.Equal(new {WarpingMomentOfInertia.QuantityType, quantity.Value, quantity.Unit}.GetHashCode(), quantity.GetHashCode()); + Assert.Equal(WarpingMomentOfInertia.QuantityType.GetHashCode(), quantity.GetHashCode()); } [Theory] diff --git a/UnitsNet.Tests/QuantityComparisonTests.cs b/UnitsNet.Tests/QuantityComparisonTests.cs new file mode 100644 index 0000000000..7b77acd201 --- /dev/null +++ b/UnitsNet.Tests/QuantityComparisonTests.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using UnitsNet.Units; +using Xunit; + +namespace UnitsNet.Tests +{ + public class QuantityComparisonTests + { + [Fact] + public void CompareTo_WithSameQuantityInAnotherUnit_ReturnsZero() + { + var firstMass = Mass.FromGrams(0.001); + var secondMass = firstMass.ToUnit(MassUnit.Microgram); + + Assert.Equal(0, firstMass.CompareTo(secondMass)); + Assert.Equal(0, secondMass.CompareTo(firstMass)); + } + + [Fact] + public void CompareTo_WithVeryCloseQuantity_ReturnsNonZero() + { + var firstMass = Mass.FromGrams(0); + var secondMass = Mass.FromGrams(double.Epsilon); + + Assert.Equal(-1, firstMass.CompareTo(secondMass)); + Assert.Equal(1, secondMass.CompareTo(firstMass)); + } + + [Fact] + public void Equals_WithSameQuantityInAnotherUnit_IsNotReflexive() + { + var firstMass = Mass.FromGrams(0.001); + var secondMass = firstMass.ToUnit(MassUnit.Microgram); + + Assert.NotEqual(firstMass, secondMass); + Assert.Equal(secondMass, firstMass); + } + + [Fact] + public void Equals_WithVeryCloseQuantityInSameUnit_ReturnsFalse() + { + var firstMass = Mass.FromGrams(0); + var secondMass = Mass.FromGrams(double.Epsilon); + + Assert.NotEqual(firstMass, secondMass); + Assert.NotEqual(secondMass, firstMass); + } + + [Fact] + public void GetHashCode_WithSameQuantityInAnotherUnit_ReturnsSameValue() + { + var firstMass = Mass.FromGrams(0.001); + var secondMass = firstMass.ToUnit(MassUnit.Microgram); + + Assert.Equal(firstMass.GetHashCode(), secondMass.GetHashCode()); + } + + [Fact] + public void GetHashCode_WithVeryCloseQuantities_ReturnsSameValue() + { + var firstMass = Mass.FromGrams(0); + var secondMass = Mass.FromGrams(double.Epsilon); + + Assert.Equal(firstMass.GetHashCode(), secondMass.GetHashCode()); + } + + [Fact] + public void Contains_CollectionWithMixedUnits_DependsOnTheOrderOfInsertion() + { + var firstMass = Mass.FromGrams(0.001); + var secondMass = firstMass.ToUnit(MassUnit.Microgram); + + var collectionWithFirst = new HashSet {firstMass}; + var collectionWithSecond = new HashSet {secondMass}; + + Assert.Contains(firstMass, collectionWithFirst); + Assert.DoesNotContain(secondMass, collectionWithFirst); + + Assert.Contains(firstMass, collectionWithSecond); + Assert.Contains(secondMass, collectionWithSecond); + } + + [Fact] + public void Contains_CollectionWithVeryCloseQuantities_ReturnsTrueIfValuesAreStrictlyEqual() + { + var firstMass = Mass.FromGrams(0); + var secondMass = Mass.FromGrams(double.Epsilon); + + var collection = new HashSet {firstMass}; + + // equal hash codes do not imply object equality + Assert.Equal(firstMass.GetHashCode(), secondMass.GetHashCode()); + Assert.NotEqual(firstMass, secondMass); + + // Contains first checks HashCode, followed by Equals check + Assert.Contains(firstMass, collection); + Assert.DoesNotContain(secondMass, collection); + } + + [Fact] + public void Sort_CollectionWithMixedUnits_SortedByNaturalOrder() + { + var firstMass = Mass.FromGrams(0); + var secondMass = Mass.FromGrams(double.Epsilon); + var thirdMass = Mass.FromGrams(0.001); + var fourthMass = thirdMass.ToUnit(MassUnit.Microgram); + + var collection = new[] {thirdMass, firstMass, fourthMass, secondMass}; + Array.Sort(collection); + + Assert.Equal(firstMass, collection[0]); + Assert.Equal(secondMass, collection[1]); + Assert.Equal(thirdMass, collection[2]); + Assert.Equal(fourthMass, collection[3]); + } + } +} diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index c06cff33b4..d8c91063f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -612,25 +612,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Accel /// Returns true if less or equal to. public static bool operator <=(Acceleration left, Acceleration right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Acceleration left, Acceleration right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Acceleration left, Acceleration right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Acceleration left, Acceleration right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -659,7 +659,9 @@ public int CompareTo(object obj) /// public int CompareTo(Acceleration other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -736,7 +738,7 @@ public bool Equals(Acceleration other, double tolerance, ComparisonType comparis /// A hash code for the current Acceleration. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 94b3ca9fd8..9f0ece7893 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -627,25 +627,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Amoun /// Returns true if less or equal to. public static bool operator <=(AmountOfSubstance left, AmountOfSubstance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(AmountOfSubstance left, AmountOfSubstance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(AmountOfSubstance left, AmountOfSubstance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(AmountOfSubstance left, AmountOfSubstance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -674,7 +674,9 @@ public int CompareTo(object obj) /// public int CompareTo(AmountOfSubstance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -751,7 +753,7 @@ public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType com /// A hash code for the current AmountOfSubstance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index 899d516ff6..1fe4afc170 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -470,25 +470,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Ampli /// Returns true if less or equal to. public static bool operator <=(AmplitudeRatio left, AmplitudeRatio right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(AmplitudeRatio left, AmplitudeRatio right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(AmplitudeRatio left, AmplitudeRatio right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(AmplitudeRatio left, AmplitudeRatio right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -517,7 +517,9 @@ public int CompareTo(object obj) /// public int CompareTo(AmplitudeRatio other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -594,7 +596,7 @@ public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType compar /// A hash code for the current AmplitudeRatio. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 7299ad8473..5cd12cc882 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -612,25 +612,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Angle /// Returns true if less or equal to. public static bool operator <=(Angle left, Angle right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Angle left, Angle right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Angle left, Angle right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Angle left, Angle right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -659,7 +659,9 @@ public int CompareTo(object obj) /// public int CompareTo(Angle other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -736,7 +738,7 @@ public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Angle. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 895523d500..a51e942342 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Appar /// Returns true if less or equal to. public static bool operator <=(ApparentEnergy left, ApparentEnergy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ApparentEnergy left, ApparentEnergy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ApparentEnergy left, ApparentEnergy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ApparentEnergy left, ApparentEnergy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(ApparentEnergy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(ApparentEnergy other, double tolerance, ComparisonType compar /// A hash code for the current ApparentEnergy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index 269c94cd4d..ea7e2a3db5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -462,25 +462,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Appar /// Returns true if less or equal to. public static bool operator <=(ApparentPower left, ApparentPower right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ApparentPower left, ApparentPower right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ApparentPower left, ApparentPower right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ApparentPower left, ApparentPower right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -509,7 +509,9 @@ public int CompareTo(object obj) /// public int CompareTo(ApparentPower other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -586,7 +588,7 @@ public bool Equals(ApparentPower other, double tolerance, ComparisonType compari /// A hash code for the current ApparentPower. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index d5f3d94ed7..086dd459e6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -612,25 +612,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU /// Returns true if less or equal to. public static bool operator <=(Area left, Area right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Area left, Area right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Area left, Area right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Area left, Area right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -659,7 +659,9 @@ public int CompareTo(object obj) /// public int CompareTo(Area other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -736,7 +738,7 @@ public bool Equals(Area other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Area. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index e5b4215ceb..2be435155d 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -417,25 +417,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaD /// Returns true if less or equal to. public static bool operator <=(AreaDensity left, AreaDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(AreaDensity left, AreaDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(AreaDensity left, AreaDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(AreaDensity left, AreaDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -464,7 +464,9 @@ public int CompareTo(object obj) /// public int CompareTo(AreaDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -541,7 +543,7 @@ public bool Equals(AreaDensity other, double tolerance, ComparisonType compariso /// A hash code for the current AreaDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 8d9872efab..939a0e23b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -492,25 +492,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaM /// Returns true if less or equal to. public static bool operator <=(AreaMomentOfInertia left, AreaMomentOfInertia right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(AreaMomentOfInertia left, AreaMomentOfInertia right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(AreaMomentOfInertia left, AreaMomentOfInertia right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(AreaMomentOfInertia left, AreaMomentOfInertia right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -539,7 +539,9 @@ public int CompareTo(object obj) /// public int CompareTo(AreaMomentOfInertia other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -616,7 +618,7 @@ public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType c /// A hash code for the current AreaMomentOfInertia. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index c7e6ad0c0e..e0a8a1bb78 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -797,25 +797,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out BitRa /// Returns true if less or equal to. public static bool operator <=(BitRate left, BitRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(BitRate left, BitRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(BitRate left, BitRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(BitRate left, BitRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -844,7 +844,9 @@ public int CompareTo(object obj) /// public int CompareTo(BitRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -921,7 +923,7 @@ public bool Equals(BitRate other, double tolerance, ComparisonType comparisonTyp /// A hash code for the current BitRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index ec856aa869..371569bbaa 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Brake /// Returns true if less or equal to. public static bool operator <=(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(BrakeSpecificFuelConsumption other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, Compari /// A hash code for the current BrakeSpecificFuelConsumption. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index cfdce7831f..63aa733c07 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -510,25 +510,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Capac /// Returns true if less or equal to. public static bool operator <=(Capacitance left, Capacitance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Capacitance left, Capacitance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Capacitance left, Capacitance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Capacitance left, Capacitance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -557,7 +557,9 @@ public int CompareTo(object obj) /// public int CompareTo(Capacitance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -634,7 +636,7 @@ public bool Equals(Capacitance other, double tolerance, ComparisonType compariso /// A hash code for the current Capacitance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index f0af9170e3..98950e47ce 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Coeff /// Returns true if less or equal to. public static bool operator <=(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(CoefficientOfThermalExpansion left, CoefficientOfThermalExpansion right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(CoefficientOfThermalExpansion other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(CoefficientOfThermalExpansion other, double tolerance, Compar /// A hash code for the current CoefficientOfThermalExpansion. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index da5c1bbd5b..19af0e7016 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1005,25 +1005,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Densi /// Returns true if less or equal to. public static bool operator <=(Density left, Density right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Density left, Density right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Density left, Density right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Density left, Density right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1052,7 +1052,9 @@ public int CompareTo(object obj) /// public int CompareTo(Density other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1129,7 +1131,7 @@ public bool Equals(Density other, double tolerance, ComparisonType comparisonTyp /// A hash code for the current Density. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 8dfbec5b24..0ea052a050 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -552,25 +552,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Durat /// Returns true if less or equal to. public static bool operator <=(Duration left, Duration right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Duration left, Duration right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Duration left, Duration right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Duration left, Duration right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -599,7 +599,9 @@ public int CompareTo(object obj) /// public int CompareTo(Duration other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -676,7 +678,7 @@ public bool Equals(Duration other, double tolerance, ComparisonType comparisonTy /// A hash code for the current Duration. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 04de8c4043..092d6bf105 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -555,25 +555,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Dynam /// Returns true if less or equal to. public static bool operator <=(DynamicViscosity left, DynamicViscosity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(DynamicViscosity left, DynamicViscosity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(DynamicViscosity left, DynamicViscosity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(DynamicViscosity left, DynamicViscosity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -602,7 +602,9 @@ public int CompareTo(object obj) /// public int CompareTo(DynamicViscosity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -679,7 +681,7 @@ public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comp /// A hash code for the current DynamicViscosity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 4d32562157..661513c070 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -462,25 +462,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricAdmittance left, ElectricAdmittance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricAdmittance left, ElectricAdmittance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricAdmittance left, ElectricAdmittance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricAdmittance left, ElectricAdmittance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -509,7 +509,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricAdmittance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -586,7 +588,7 @@ public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType co /// A hash code for the current ElectricAdmittance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index d441ab525e..dd36096f5a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -480,25 +480,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricCharge left, ElectricCharge right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricCharge left, ElectricCharge right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricCharge left, ElectricCharge right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricCharge left, ElectricCharge right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -527,7 +527,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricCharge other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -604,7 +606,7 @@ public bool Equals(ElectricCharge other, double tolerance, ComparisonType compar /// A hash code for the current ElectricCharge. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 7eee888c9e..e1402f1d81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricChargeDensity left, ElectricChargeDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricChargeDensity left, ElectricChargeDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricChargeDensity left, ElectricChargeDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricChargeDensity left, ElectricChargeDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricChargeDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType /// A hash code for the current ElectricChargeDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 9057adb96e..02a299c9ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -450,25 +450,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricConductance left, ElectricConductance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricConductance left, ElectricConductance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricConductance left, ElectricConductance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricConductance left, ElectricConductance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -497,7 +497,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricConductance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -574,7 +576,7 @@ public bool Equals(ElectricConductance other, double tolerance, ComparisonType c /// A hash code for the current ElectricConductance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index d55f01f9c8..9ccd4dcef2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -450,25 +450,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricConductivity left, ElectricConductivity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricConductivity left, ElectricConductivity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricConductivity left, ElectricConductivity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricConductivity left, ElectricConductivity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -497,7 +497,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricConductivity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -574,7 +576,7 @@ public bool Equals(ElectricConductivity other, double tolerance, ComparisonType /// A hash code for the current ElectricConductivity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 23877d8b2b..dade0e89f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -522,25 +522,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricCurrent left, ElectricCurrent right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricCurrent left, ElectricCurrent right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricCurrent left, ElectricCurrent right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricCurrent left, ElectricCurrent right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -569,7 +569,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricCurrent other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -646,7 +648,7 @@ public bool Equals(ElectricCurrent other, double tolerance, ComparisonType compa /// A hash code for the current ElectricCurrent. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 25fbd5bc4c..59d42c2f82 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -450,25 +450,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricCurrentDensity left, ElectricCurrentDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricCurrentDensity left, ElectricCurrentDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricCurrentDensity left, ElectricCurrentDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricCurrentDensity left, ElectricCurrentDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -497,7 +497,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricCurrentDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -574,7 +576,7 @@ public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonTyp /// A hash code for the current ElectricCurrentDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index e76eaeaa5c..e2d7ae82ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -417,25 +417,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricCurrentGradient left, ElectricCurrentGradient right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricCurrentGradient left, ElectricCurrentGradient right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricCurrentGradient left, ElectricCurrentGradient right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricCurrentGradient left, ElectricCurrentGradient right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -464,7 +464,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricCurrentGradient other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -541,7 +543,7 @@ public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonTy /// A hash code for the current ElectricCurrentGradient. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 9a611d2ece..b18964ad7d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricField left, ElectricField right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricField left, ElectricField right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricField left, ElectricField right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricField left, ElectricField right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricField other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(ElectricField other, double tolerance, ComparisonType compari /// A hash code for the current ElectricField. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index a35692e319..ec77b4d4ec 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -465,25 +465,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricInductance left, ElectricInductance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricInductance left, ElectricInductance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricInductance left, ElectricInductance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricInductance left, ElectricInductance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -512,7 +512,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricInductance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -589,7 +591,7 @@ public bool Equals(ElectricInductance other, double tolerance, ComparisonType co /// A hash code for the current ElectricInductance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 7bbac7191b..d80c8a5091 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -477,25 +477,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricPotential left, ElectricPotential right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricPotential left, ElectricPotential right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricPotential left, ElectricPotential right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricPotential left, ElectricPotential right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -524,7 +524,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricPotential other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -601,7 +603,7 @@ public bool Equals(ElectricPotential other, double tolerance, ComparisonType com /// A hash code for the current ElectricPotential. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 652d9c8d04..e30478c921 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -477,25 +477,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricPotentialAc left, ElectricPotentialAc right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricPotentialAc left, ElectricPotentialAc right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricPotentialAc left, ElectricPotentialAc right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricPotentialAc left, ElectricPotentialAc right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -524,7 +524,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricPotentialAc other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -601,7 +603,7 @@ public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType c /// A hash code for the current ElectricPotentialAc. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs index dc66e7a1aa..39fd2ec898 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs @@ -702,25 +702,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricPotentialChangeRate left, ElectricPotentialChangeRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricPotentialChangeRate left, ElectricPotentialChangeRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricPotentialChangeRate left, ElectricPotentialChangeRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricPotentialChangeRate left, ElectricPotentialChangeRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -749,7 +749,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricPotentialChangeRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -826,7 +828,7 @@ public bool Equals(ElectricPotentialChangeRate other, double tolerance, Comparis /// A hash code for the current ElectricPotentialChangeRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index e22e2c3ad7..ae3ce4bcb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -477,25 +477,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricPotentialDc left, ElectricPotentialDc right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricPotentialDc left, ElectricPotentialDc right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricPotentialDc left, ElectricPotentialDc right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricPotentialDc left, ElectricPotentialDc right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -524,7 +524,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricPotentialDc other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -601,7 +603,7 @@ public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType c /// A hash code for the current ElectricPotentialDc. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index c55d1b88ef..5b2ba801e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -492,25 +492,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricResistance left, ElectricResistance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricResistance left, ElectricResistance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricResistance left, ElectricResistance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricResistance left, ElectricResistance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -539,7 +539,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricResistance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -616,7 +618,7 @@ public bool Equals(ElectricResistance other, double tolerance, ComparisonType co /// A hash code for the current ElectricResistance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 41d0b2791d..bbf999ae94 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -615,25 +615,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricResistivity left, ElectricResistivity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricResistivity left, ElectricResistivity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricResistivity left, ElectricResistivity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricResistivity left, ElectricResistivity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -662,7 +662,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricResistivity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -739,7 +741,7 @@ public bool Equals(ElectricResistivity other, double tolerance, ComparisonType c /// A hash code for the current ElectricResistivity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs index 98ce454741..20031c514b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs @@ -450,25 +450,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect /// Returns true if less or equal to. public static bool operator <=(ElectricSurfaceChargeDensity left, ElectricSurfaceChargeDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ElectricSurfaceChargeDensity left, ElectricSurfaceChargeDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ElectricSurfaceChargeDensity left, ElectricSurfaceChargeDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ElectricSurfaceChargeDensity left, ElectricSurfaceChargeDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -497,7 +497,9 @@ public int CompareTo(object obj) /// public int CompareTo(ElectricSurfaceChargeDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -574,7 +576,7 @@ public bool Equals(ElectricSurfaceChargeDensity other, double tolerance, Compari /// A hash code for the current ElectricSurfaceChargeDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index ed0c2175c6..9e9ccac1d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -942,25 +942,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ /// Returns true if less or equal to. public static bool operator <=(Energy left, Energy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Energy left, Energy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Energy left, Energy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Energy left, Energy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -989,7 +989,9 @@ public int CompareTo(object obj) /// public int CompareTo(Energy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1066,7 +1068,7 @@ public bool Equals(Energy other, double tolerance, ComparisonType comparisonType /// A hash code for the current Energy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 4d22327766..e1d0e80167 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -507,25 +507,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Entro /// Returns true if less or equal to. public static bool operator <=(Entropy left, Entropy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Entropy left, Entropy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Entropy left, Entropy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Entropy left, Entropy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -554,7 +554,9 @@ public int CompareTo(object obj) /// public int CompareTo(Entropy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -631,7 +633,7 @@ public bool Equals(Entropy other, double tolerance, ComparisonType comparisonTyp /// A hash code for the current Entropy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 7fe348fb78..6bb965ce99 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -627,25 +627,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force /// Returns true if less or equal to. public static bool operator <=(Force left, Force right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Force left, Force right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Force left, Force right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Force left, Force right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -674,7 +674,9 @@ public int CompareTo(object obj) /// public int CompareTo(Force other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -751,7 +753,7 @@ public bool Equals(Force other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Force. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 6b0737e640..c05fabebdb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -567,25 +567,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force /// Returns true if less or equal to. public static bool operator <=(ForceChangeRate left, ForceChangeRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ForceChangeRate left, ForceChangeRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ForceChangeRate left, ForceChangeRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ForceChangeRate left, ForceChangeRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -614,7 +614,9 @@ public int CompareTo(object obj) /// public int CompareTo(ForceChangeRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -691,7 +693,7 @@ public bool Equals(ForceChangeRate other, double tolerance, ComparisonType compa /// A hash code for the current ForceChangeRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index fd12e2a781..ec112bf932 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -972,25 +972,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force /// Returns true if less or equal to. public static bool operator <=(ForcePerLength left, ForcePerLength right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ForcePerLength left, ForcePerLength right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ForcePerLength left, ForcePerLength right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ForcePerLength left, ForcePerLength right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1019,7 +1019,9 @@ public int CompareTo(object obj) /// public int CompareTo(ForcePerLength other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1096,7 +1098,7 @@ public bool Equals(ForcePerLength other, double tolerance, ComparisonType compar /// A hash code for the current ForcePerLength. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 665f183951..3950245c34 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -552,25 +552,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Frequ /// Returns true if less or equal to. public static bool operator <=(Frequency left, Frequency right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Frequency left, Frequency right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Frequency left, Frequency right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Frequency left, Frequency right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -599,7 +599,9 @@ public int CompareTo(object obj) /// public int CompareTo(Frequency other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -676,7 +678,7 @@ public bool Equals(Frequency other, double tolerance, ComparisonType comparisonT /// A hash code for the current Frequency. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs index 6fd8492a34..a4a58846db 100644 --- a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs @@ -465,25 +465,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out FuelE /// Returns true if less or equal to. public static bool operator <=(FuelEfficiency left, FuelEfficiency right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(FuelEfficiency left, FuelEfficiency right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(FuelEfficiency left, FuelEfficiency right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(FuelEfficiency left, FuelEfficiency right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -512,7 +512,9 @@ public int CompareTo(object obj) /// public int CompareTo(FuelEfficiency other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -589,7 +591,7 @@ public bool Equals(FuelEfficiency other, double tolerance, ComparisonType compar /// A hash code for the current FuelEfficiency. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 06ec38a224..c3c101411a 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -672,25 +672,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out HeatF /// Returns true if less or equal to. public static bool operator <=(HeatFlux left, HeatFlux right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(HeatFlux left, HeatFlux right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(HeatFlux left, HeatFlux right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(HeatFlux left, HeatFlux right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -719,7 +719,9 @@ public int CompareTo(object obj) /// public int CompareTo(HeatFlux other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -796,7 +798,7 @@ public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonTy /// A hash code for the current HeatFlux. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 346bd88420..a746d06f1c 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out HeatT /// Returns true if less or equal to. public static bool operator <=(HeatTransferCoefficient left, HeatTransferCoefficient right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(HeatTransferCoefficient left, HeatTransferCoefficient right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(HeatTransferCoefficient left, HeatTransferCoefficient right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(HeatTransferCoefficient left, HeatTransferCoefficient right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(HeatTransferCoefficient other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonTy /// A hash code for the current HeatTransferCoefficient. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index d18c6d8b5a..7b4d458695 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -465,25 +465,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Illum /// Returns true if less or equal to. public static bool operator <=(Illuminance left, Illuminance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Illuminance left, Illuminance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Illuminance left, Illuminance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Illuminance left, Illuminance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -512,7 +512,9 @@ public int CompareTo(object obj) /// public int CompareTo(Illuminance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -589,7 +591,7 @@ public bool Equals(Illuminance other, double tolerance, ComparisonType compariso /// A hash code for the current Illuminance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 978d41bbbc..ece4b51e3b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -794,25 +794,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Infor /// Returns true if less or equal to. public static bool operator <=(Information left, Information right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Information left, Information right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Information left, Information right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Information left, Information right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -841,7 +841,9 @@ public int CompareTo(object obj) /// public int CompareTo(Information other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -918,7 +920,7 @@ public bool Equals(Information other, double tolerance, ComparisonType compariso /// A hash code for the current Information. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index d6c42f7d9d..bd9315b623 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -612,25 +612,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Irrad /// Returns true if less or equal to. public static bool operator <=(Irradiance left, Irradiance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Irradiance left, Irradiance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Irradiance left, Irradiance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Irradiance left, Irradiance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -659,7 +659,9 @@ public int CompareTo(object obj) /// public int CompareTo(Irradiance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -736,7 +738,7 @@ public bool Equals(Irradiance other, double tolerance, ComparisonType comparison /// A hash code for the current Irradiance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index aaa98eb2d5..a3b09ac642 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -510,25 +510,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Irrad /// Returns true if less or equal to. public static bool operator <=(Irradiation left, Irradiation right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Irradiation left, Irradiation right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Irradiation left, Irradiation right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Irradiation left, Irradiation right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -557,7 +557,9 @@ public int CompareTo(object obj) /// public int CompareTo(Irradiation other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -634,7 +636,7 @@ public bool Equals(Irradiation other, double tolerance, ComparisonType compariso /// A hash code for the current Irradiation. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 03d75963b2..6facf9abe5 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -525,25 +525,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Kinem /// Returns true if less or equal to. public static bool operator <=(KinematicViscosity left, KinematicViscosity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(KinematicViscosity left, KinematicViscosity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(KinematicViscosity left, KinematicViscosity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(KinematicViscosity left, KinematicViscosity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -572,7 +572,9 @@ public int CompareTo(object obj) /// public int CompareTo(KinematicViscosity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -649,7 +651,7 @@ public bool Equals(KinematicViscosity other, double tolerance, ComparisonType co /// A hash code for the current KinematicViscosity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index 7d2099b3f5..bc366820ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -417,25 +417,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lapse /// Returns true if less or equal to. public static bool operator <=(LapseRate left, LapseRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(LapseRate left, LapseRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(LapseRate left, LapseRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(LapseRate left, LapseRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -464,7 +464,9 @@ public int CompareTo(object obj) /// public int CompareTo(LapseRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -541,7 +543,7 @@ public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonT /// A hash code for the current LapseRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index c22db172d0..bd9a897fdd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -897,25 +897,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lengt /// Returns true if less or equal to. public static bool operator <=(Length left, Length right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Length left, Length right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Length left, Length right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Length left, Length right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -944,7 +944,9 @@ public int CompareTo(object obj) /// public int CompareTo(Length other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1021,7 +1023,7 @@ public bool Equals(Length other, double tolerance, ComparisonType comparisonType /// A hash code for the current Length. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 18af1e4ca9..d6cb47ce62 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -440,25 +440,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Level /// Returns true if less or equal to. public static bool operator <=(Level left, Level right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Level left, Level right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Level left, Level right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Level left, Level right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -487,7 +487,9 @@ public int CompareTo(object obj) /// public int CompareTo(Level other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -564,7 +566,7 @@ public bool Equals(Level other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Level. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 9b16f87531..f27fd698fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -615,25 +615,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Linea /// Returns true if less or equal to. public static bool operator <=(LinearDensity left, LinearDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(LinearDensity left, LinearDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(LinearDensity left, LinearDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(LinearDensity left, LinearDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -662,7 +662,9 @@ public int CompareTo(object obj) /// public int CompareTo(LinearDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -739,7 +741,7 @@ public bool Equals(LinearDensity other, double tolerance, ComparisonType compari /// A hash code for the current LinearDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs index 82a4b2473d..c72386b4b4 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs @@ -780,25 +780,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Linea /// Returns true if less or equal to. public static bool operator <=(LinearPowerDensity left, LinearPowerDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(LinearPowerDensity left, LinearPowerDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(LinearPowerDensity left, LinearPowerDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(LinearPowerDensity left, LinearPowerDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -827,7 +827,9 @@ public int CompareTo(object obj) /// public int CompareTo(LinearPowerDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -904,7 +906,7 @@ public bool Equals(LinearPowerDensity other, double tolerance, ComparisonType co /// A hash code for the current LinearPowerDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs index 893315f5ad..91299090d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs @@ -615,25 +615,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lumin /// Returns true if less or equal to. public static bool operator <=(Luminosity left, Luminosity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Luminosity left, Luminosity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Luminosity left, Luminosity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Luminosity left, Luminosity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -662,7 +662,9 @@ public int CompareTo(object obj) /// public int CompareTo(Luminosity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -739,7 +741,7 @@ public bool Equals(Luminosity other, double tolerance, ComparisonType comparison /// A hash code for the current Luminosity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index c0de33ed2c..75a0f4327f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lumin /// Returns true if less or equal to. public static bool operator <=(LuminousFlux left, LuminousFlux right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(LuminousFlux left, LuminousFlux right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(LuminousFlux left, LuminousFlux right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(LuminousFlux left, LuminousFlux right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(LuminousFlux other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparis /// A hash code for the current LuminousFlux. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index bd25c55a5a..6bb4345545 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lumin /// Returns true if less or equal to. public static bool operator <=(LuminousIntensity left, LuminousIntensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(LuminousIntensity left, LuminousIntensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(LuminousIntensity left, LuminousIntensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(LuminousIntensity left, LuminousIntensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(LuminousIntensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(LuminousIntensity other, double tolerance, ComparisonType com /// A hash code for the current LuminousIntensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 7a54cac4c8..4862ef60d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -465,25 +465,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Magne /// Returns true if less or equal to. public static bool operator <=(MagneticField left, MagneticField right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MagneticField left, MagneticField right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MagneticField left, MagneticField right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MagneticField left, MagneticField right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -512,7 +512,9 @@ public int CompareTo(object obj) /// public int CompareTo(MagneticField other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -589,7 +591,7 @@ public bool Equals(MagneticField other, double tolerance, ComparisonType compari /// A hash code for the current MagneticField. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 6a56f32260..a58f2c0a56 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Magne /// Returns true if less or equal to. public static bool operator <=(MagneticFlux left, MagneticFlux right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MagneticFlux left, MagneticFlux right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MagneticFlux left, MagneticFlux right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MagneticFlux left, MagneticFlux right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(MagneticFlux other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparis /// A hash code for the current MagneticFlux. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index c0aab8d7e2..81a3809e26 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Magne /// Returns true if less or equal to. public static bool operator <=(Magnetization left, Magnetization right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Magnetization left, Magnetization right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Magnetization left, Magnetization right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Magnetization left, Magnetization right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(Magnetization other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(Magnetization other, double tolerance, ComparisonType compari /// A hash code for the current Magnetization. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 96ce9ba4e1..27e90f3efb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -777,25 +777,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU /// Returns true if less or equal to. public static bool operator <=(Mass left, Mass right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Mass left, Mass right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Mass left, Mass right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Mass left, Mass right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -824,7 +824,9 @@ public int CompareTo(object obj) /// public int CompareTo(Mass other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -901,7 +903,7 @@ public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Mass. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index 3485d38555..0bf3643dd8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -1110,25 +1110,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassC /// Returns true if less or equal to. public static bool operator <=(MassConcentration left, MassConcentration right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MassConcentration left, MassConcentration right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MassConcentration left, MassConcentration right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MassConcentration left, MassConcentration right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1157,7 +1157,9 @@ public int CompareTo(object obj) /// public int CompareTo(MassConcentration other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1234,7 +1236,7 @@ public bool Equals(MassConcentration other, double tolerance, ComparisonType com /// A hash code for the current MassConcentration. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index cc95d72957..e41860a208 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -897,25 +897,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF /// Returns true if less or equal to. public static bool operator <=(MassFlow left, MassFlow right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MassFlow left, MassFlow right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MassFlow left, MassFlow right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MassFlow left, MassFlow right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -944,7 +944,9 @@ public int CompareTo(object obj) /// public int CompareTo(MassFlow other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1021,7 +1023,7 @@ public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonTy /// A hash code for the current MassFlow. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index cddac285fe..8a6b3fffbb 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -582,25 +582,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF /// Returns true if less or equal to. public static bool operator <=(MassFlux left, MassFlux right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MassFlux left, MassFlux right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MassFlux left, MassFlux right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MassFlux left, MassFlux right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -629,7 +629,9 @@ public int CompareTo(object obj) /// public int CompareTo(MassFlux other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -706,7 +708,7 @@ public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonTy /// A hash code for the current MassFlux. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index d600750a73..2d51750b15 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs @@ -765,25 +765,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF /// Returns true if less or equal to. public static bool operator <=(MassFraction left, MassFraction right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MassFraction left, MassFraction right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MassFraction left, MassFraction right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MassFraction left, MassFraction right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -812,7 +812,9 @@ public int CompareTo(object obj) /// public int CompareTo(MassFraction other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -889,7 +891,7 @@ public bool Equals(MassFraction other, double tolerance, ComparisonType comparis /// A hash code for the current MassFraction. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 7c835aded4..3f9ff92035 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -822,25 +822,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassM /// Returns true if less or equal to. public static bool operator <=(MassMomentOfInertia left, MassMomentOfInertia right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MassMomentOfInertia left, MassMomentOfInertia right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MassMomentOfInertia left, MassMomentOfInertia right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MassMomentOfInertia left, MassMomentOfInertia right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -869,7 +869,9 @@ public int CompareTo(object obj) /// public int CompareTo(MassMomentOfInertia other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -946,7 +948,7 @@ public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType c /// A hash code for the current MassMomentOfInertia. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index e77db094c4..181b4f2545 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar /// Returns true if less or equal to. public static bool operator <=(MolarEnergy left, MolarEnergy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MolarEnergy left, MolarEnergy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MolarEnergy left, MolarEnergy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MolarEnergy left, MolarEnergy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(MolarEnergy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(MolarEnergy other, double tolerance, ComparisonType compariso /// A hash code for the current MolarEnergy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 0a174a328c..1b16bc261c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar /// Returns true if less or equal to. public static bool operator <=(MolarEntropy left, MolarEntropy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MolarEntropy left, MolarEntropy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MolarEntropy left, MolarEntropy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MolarEntropy left, MolarEntropy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(MolarEntropy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparis /// A hash code for the current MolarEntropy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index afc0741065..2c27c3b2c8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -582,25 +582,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar /// Returns true if less or equal to. public static bool operator <=(MolarMass left, MolarMass right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(MolarMass left, MolarMass right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(MolarMass left, MolarMass right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(MolarMass left, MolarMass right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -629,7 +629,9 @@ public int CompareTo(object obj) /// public int CompareTo(MolarMass other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -706,7 +708,7 @@ public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonT /// A hash code for the current MolarMass. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 441038cbae..56a2c4682b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -525,25 +525,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar /// Returns true if less or equal to. public static bool operator <=(Molarity left, Molarity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Molarity left, Molarity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Molarity left, Molarity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Molarity left, Molarity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -572,7 +572,9 @@ public int CompareTo(object obj) /// public int CompareTo(Molarity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -649,7 +651,7 @@ public bool Equals(Molarity other, double tolerance, ComparisonType comparisonTy /// A hash code for the current Molarity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 0c483a2e0b..4b1846b706 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Perme /// Returns true if less or equal to. public static bool operator <=(Permeability left, Permeability right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Permeability left, Permeability right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Permeability left, Permeability right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Permeability left, Permeability right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(Permeability other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(Permeability other, double tolerance, ComparisonType comparis /// A hash code for the current Permeability. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 22611dc34f..d184539ac8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Permi /// Returns true if less or equal to. public static bool operator <=(Permittivity left, Permittivity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Permittivity left, Permittivity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Permittivity left, Permittivity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Permittivity left, Permittivity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(Permittivity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(Permittivity other, double tolerance, ComparisonType comparis /// A hash code for the current Permittivity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 40e4f2b80d..bc7e33b8cd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -779,25 +779,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power /// Returns true if less or equal to. public static bool operator <=(Power left, Power right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Power left, Power right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Power left, Power right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Power left, Power right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -826,7 +826,9 @@ public int CompareTo(object obj) /// public int CompareTo(Power other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -903,7 +905,7 @@ public bool Equals(Power other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Power. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index dc133e4b44..6e096ae05d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1062,25 +1062,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power /// Returns true if less or equal to. public static bool operator <=(PowerDensity left, PowerDensity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(PowerDensity left, PowerDensity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(PowerDensity left, PowerDensity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(PowerDensity left, PowerDensity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1109,7 +1109,9 @@ public int CompareTo(object obj) /// public int CompareTo(PowerDensity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1186,7 +1188,7 @@ public bool Equals(PowerDensity other, double tolerance, ComparisonType comparis /// A hash code for the current PowerDensity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 9406f5e527..cfbd91d6ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -440,25 +440,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power /// Returns true if less or equal to. public static bool operator <=(PowerRatio left, PowerRatio right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(PowerRatio left, PowerRatio right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(PowerRatio left, PowerRatio right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(PowerRatio left, PowerRatio right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -487,7 +487,9 @@ public int CompareTo(object obj) /// public int CompareTo(PowerRatio other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -564,7 +566,7 @@ public bool Equals(PowerRatio other, double tolerance, ComparisonType comparison /// A hash code for the current PowerRatio. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 02efb5dda6..b5b5ca956e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1032,25 +1032,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press /// Returns true if less or equal to. public static bool operator <=(Pressure left, Pressure right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Pressure left, Pressure right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Pressure left, Pressure right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Pressure left, Pressure right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1079,7 +1079,9 @@ public int CompareTo(object obj) /// public int CompareTo(Pressure other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1156,7 +1158,7 @@ public bool Equals(Pressure other, double tolerance, ComparisonType comparisonTy /// A hash code for the current Pressure. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 47a2a95a60..76640da27a 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -507,25 +507,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press /// Returns true if less or equal to. public static bool operator <=(PressureChangeRate left, PressureChangeRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(PressureChangeRate left, PressureChangeRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(PressureChangeRate left, PressureChangeRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(PressureChangeRate left, PressureChangeRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -554,7 +554,9 @@ public int CompareTo(object obj) /// public int CompareTo(PressureChangeRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -631,7 +633,7 @@ public bool Equals(PressureChangeRate other, double tolerance, ComparisonType co /// A hash code for the current PressureChangeRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 4a78e8b313..3f12701d83 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -492,25 +492,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Ratio /// Returns true if less or equal to. public static bool operator <=(Ratio left, Ratio right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Ratio left, Ratio right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Ratio left, Ratio right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Ratio left, Ratio right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -539,7 +539,9 @@ public int CompareTo(object obj) /// public int CompareTo(Ratio other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -616,7 +618,7 @@ public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Ratio. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs index 71f8f7652c..4b1de5c3ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs @@ -432,25 +432,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Ratio /// Returns true if less or equal to. public static bool operator <=(RatioChangeRate left, RatioChangeRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(RatioChangeRate left, RatioChangeRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(RatioChangeRate left, RatioChangeRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(RatioChangeRate left, RatioChangeRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -479,7 +479,9 @@ public int CompareTo(object obj) /// public int CompareTo(RatioChangeRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -556,7 +558,7 @@ public bool Equals(RatioChangeRate other, double tolerance, ComparisonType compa /// A hash code for the current RatioChangeRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index f1a4e78f17..5c815d4bd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out React /// Returns true if less or equal to. public static bool operator <=(ReactiveEnergy left, ReactiveEnergy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ReactiveEnergy left, ReactiveEnergy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ReactiveEnergy left, ReactiveEnergy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ReactiveEnergy left, ReactiveEnergy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(ReactiveEnergy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType compar /// A hash code for the current ReactiveEnergy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 54cb0b2510..ce8fb45e81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -462,25 +462,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out React /// Returns true if less or equal to. public static bool operator <=(ReactivePower left, ReactivePower right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ReactivePower left, ReactivePower right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ReactivePower left, ReactivePower right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ReactivePower left, ReactivePower right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -509,7 +509,9 @@ public int CompareTo(object obj) /// public int CompareTo(ReactivePower other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -586,7 +588,7 @@ public bool Equals(ReactivePower other, double tolerance, ComparisonType compari /// A hash code for the current ReactivePower. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index a509b07238..c625496152 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -462,25 +462,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat /// Returns true if less or equal to. public static bool operator <=(RotationalAcceleration left, RotationalAcceleration right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(RotationalAcceleration left, RotationalAcceleration right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(RotationalAcceleration left, RotationalAcceleration right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(RotationalAcceleration left, RotationalAcceleration right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -509,7 +509,9 @@ public int CompareTo(object obj) /// public int CompareTo(RotationalAcceleration other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -586,7 +588,7 @@ public bool Equals(RotationalAcceleration other, double tolerance, ComparisonTyp /// A hash code for the current RotationalAcceleration. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 5b9a8a95c1..da2c7d64b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -597,25 +597,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat /// Returns true if less or equal to. public static bool operator <=(RotationalSpeed left, RotationalSpeed right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(RotationalSpeed left, RotationalSpeed right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(RotationalSpeed left, RotationalSpeed right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(RotationalSpeed left, RotationalSpeed right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -644,7 +644,9 @@ public int CompareTo(object obj) /// public int CompareTo(RotationalSpeed other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -721,7 +723,7 @@ public bool Equals(RotationalSpeed other, double tolerance, ComparisonType compa /// A hash code for the current RotationalSpeed. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 390a8b8cab..089c20d071 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -897,25 +897,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat /// Returns true if less or equal to. public static bool operator <=(RotationalStiffness left, RotationalStiffness right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(RotationalStiffness left, RotationalStiffness right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(RotationalStiffness left, RotationalStiffness right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(RotationalStiffness left, RotationalStiffness right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -944,7 +944,9 @@ public int CompareTo(object obj) /// public int CompareTo(RotationalStiffness other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1021,7 +1023,7 @@ public bool Equals(RotationalStiffness other, double tolerance, ComparisonType c /// A hash code for the current RotationalStiffness. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 01d17a8096..2f4e9c832e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -477,25 +477,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat /// Returns true if less or equal to. public static bool operator <=(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -524,7 +524,9 @@ public int CompareTo(object obj) /// public int CompareTo(RotationalStiffnessPerLength other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -601,7 +603,7 @@ public bool Equals(RotationalStiffnessPerLength other, double tolerance, Compari /// A hash code for the current RotationalStiffnessPerLength. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 8ab2aad5ba..3804204849 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Solid /// Returns true if less or equal to. public static bool operator <=(SolidAngle left, SolidAngle right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(SolidAngle left, SolidAngle right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(SolidAngle left, SolidAngle right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(SolidAngle left, SolidAngle right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(SolidAngle other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(SolidAngle other, double tolerance, ComparisonType comparison /// A hash code for the current SolidAngle. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 621840c989..22d41a51e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -780,25 +780,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci /// Returns true if less or equal to. public static bool operator <=(SpecificEnergy left, SpecificEnergy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(SpecificEnergy left, SpecificEnergy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(SpecificEnergy left, SpecificEnergy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(SpecificEnergy left, SpecificEnergy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -827,7 +827,9 @@ public int CompareTo(object obj) /// public int CompareTo(SpecificEnergy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -904,7 +906,7 @@ public bool Equals(SpecificEnergy other, double tolerance, ComparisonType compar /// A hash code for the current SpecificEnergy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index dfd71b9c55..731a30b6f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -537,25 +537,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci /// Returns true if less or equal to. public static bool operator <=(SpecificEntropy left, SpecificEntropy right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(SpecificEntropy left, SpecificEntropy right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(SpecificEntropy left, SpecificEntropy right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(SpecificEntropy left, SpecificEntropy right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -584,7 +584,9 @@ public int CompareTo(object obj) /// public int CompareTo(SpecificEntropy other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -661,7 +663,7 @@ public bool Equals(SpecificEntropy other, double tolerance, ComparisonType compa /// A hash code for the current SpecificEntropy. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index ea543e12f3..fee6632b9c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -447,25 +447,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci /// Returns true if less or equal to. public static bool operator <=(SpecificVolume left, SpecificVolume right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(SpecificVolume left, SpecificVolume right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(SpecificVolume left, SpecificVolume right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(SpecificVolume left, SpecificVolume right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -494,7 +494,9 @@ public int CompareTo(object obj) /// public int CompareTo(SpecificVolume other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -571,7 +573,7 @@ public bool Equals(SpecificVolume other, double tolerance, ComparisonType compar /// A hash code for the current SpecificVolume. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index b54221b038..ad1de65dc9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -660,25 +660,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci /// Returns true if less or equal to. public static bool operator <=(SpecificWeight left, SpecificWeight right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(SpecificWeight left, SpecificWeight right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(SpecificWeight left, SpecificWeight right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(SpecificWeight left, SpecificWeight right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -707,7 +707,9 @@ public int CompareTo(object obj) /// public int CompareTo(SpecificWeight other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -784,7 +786,7 @@ public bool Equals(SpecificWeight other, double tolerance, ComparisonType compar /// A hash code for the current SpecificWeight. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 12460402a7..b9383acd4d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -882,25 +882,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speed /// Returns true if less or equal to. public static bool operator <=(Speed left, Speed right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Speed left, Speed right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Speed left, Speed right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Speed left, Speed right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -929,7 +929,9 @@ public int CompareTo(object obj) /// public int CompareTo(Speed other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1006,7 +1008,7 @@ public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) /// A hash code for the current Speed. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 457489ea95..5e8f68db75 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -506,25 +506,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe /// Returns true if less or equal to. public static bool operator <=(Temperature left, Temperature right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Temperature left, Temperature right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Temperature left, Temperature right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Temperature left, Temperature right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -553,7 +553,9 @@ public int CompareTo(object obj) /// public int CompareTo(Temperature other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -630,7 +632,7 @@ public bool Equals(Temperature other, double tolerance, ComparisonType compariso /// A hash code for the current Temperature. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index d39c7fe412..051498e615 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -552,25 +552,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe /// Returns true if less or equal to. public static bool operator <=(TemperatureChangeRate left, TemperatureChangeRate right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(TemperatureChangeRate left, TemperatureChangeRate right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(TemperatureChangeRate left, TemperatureChangeRate right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(TemperatureChangeRate left, TemperatureChangeRate right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -599,7 +599,9 @@ public int CompareTo(object obj) /// public int CompareTo(TemperatureChangeRate other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -676,7 +678,7 @@ public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType /// A hash code for the current TemperatureChangeRate. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index fe358ebe1a..0d8476fdf4 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -537,25 +537,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe /// Returns true if less or equal to. public static bool operator <=(TemperatureDelta left, TemperatureDelta right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(TemperatureDelta left, TemperatureDelta right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(TemperatureDelta left, TemperatureDelta right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(TemperatureDelta left, TemperatureDelta right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -584,7 +584,9 @@ public int CompareTo(object obj) /// public int CompareTo(TemperatureDelta other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -661,7 +663,7 @@ public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comp /// A hash code for the current TemperatureDelta. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 048426f900..5f6041ca6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -435,25 +435,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Therm /// Returns true if less or equal to. public static bool operator <=(ThermalConductivity left, ThermalConductivity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ThermalConductivity left, ThermalConductivity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ThermalConductivity left, ThermalConductivity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ThermalConductivity left, ThermalConductivity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -482,7 +482,9 @@ public int CompareTo(object obj) /// public int CompareTo(ThermalConductivity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -559,7 +561,7 @@ public bool Equals(ThermalConductivity other, double tolerance, ComparisonType c /// A hash code for the current ThermalConductivity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 4f415cffc9..36acc61b22 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -477,25 +477,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Therm /// Returns true if less or equal to. public static bool operator <=(ThermalResistance left, ThermalResistance right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(ThermalResistance left, ThermalResistance right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(ThermalResistance left, ThermalResistance right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(ThermalResistance left, ThermalResistance right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -524,7 +524,9 @@ public int CompareTo(object obj) /// public int CompareTo(ThermalResistance other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -601,7 +603,7 @@ public bool Equals(ThermalResistance other, double tolerance, ComparisonType com /// A hash code for the current ThermalResistance. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index c34bd7af3b..2fcc1792b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -717,25 +717,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Torqu /// Returns true if less or equal to. public static bool operator <=(Torque left, Torque right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Torque left, Torque right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Torque left, Torque right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Torque left, Torque right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -764,7 +764,9 @@ public int CompareTo(object obj) /// public int CompareTo(Torque other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -841,7 +843,7 @@ public bool Equals(Torque other, double tolerance, ComparisonType comparisonType /// A hash code for the current Torque. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs index a3cc53ac38..9cb4e1e897 100644 --- a/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TorquePerLength.g.cs @@ -717,25 +717,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Torqu /// Returns true if less or equal to. public static bool operator <=(TorquePerLength left, TorquePerLength right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(TorquePerLength left, TorquePerLength right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(TorquePerLength left, TorquePerLength right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(TorquePerLength left, TorquePerLength right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -764,7 +764,9 @@ public int CompareTo(object obj) /// public int CompareTo(TorquePerLength other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -841,7 +843,7 @@ public bool Equals(TorquePerLength other, double tolerance, ComparisonType compa /// A hash code for the current TorquePerLength. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs index a6cb383af6..fa004ec765 100644 --- a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs @@ -420,25 +420,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Turbi /// Returns true if less or equal to. public static bool operator <=(Turbidity left, Turbidity right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Turbidity left, Turbidity right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Turbidity left, Turbidity right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Turbidity left, Turbidity right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -467,7 +467,9 @@ public int CompareTo(object obj) /// public int CompareTo(Turbidity other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -544,7 +546,7 @@ public bool Equals(Turbidity other, double tolerance, ComparisonType comparisonT /// A hash code for the current Turbidity. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 1389e35218..9efaa31f44 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -417,25 +417,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Vitam /// Returns true if less or equal to. public static bool operator <=(VitaminA left, VitaminA right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(VitaminA left, VitaminA right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(VitaminA left, VitaminA right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(VitaminA left, VitaminA right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -464,7 +464,9 @@ public int CompareTo(object obj) /// public int CompareTo(VitaminA other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -541,7 +543,7 @@ public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonTy /// A hash code for the current VitaminA. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 4f6fa268e8..e29787c07e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1167,25 +1167,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum /// Returns true if less or equal to. public static bool operator <=(Volume left, Volume right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(Volume left, Volume right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(Volume left, Volume right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(Volume left, Volume right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1214,7 +1214,9 @@ public int CompareTo(object obj) /// public int CompareTo(Volume other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1291,7 +1293,7 @@ public bool Equals(Volume other, double tolerance, ComparisonType comparisonType /// A hash code for the current Volume. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index 0a8e0c65ae..a5fc510e21 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs @@ -705,25 +705,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum /// Returns true if less or equal to. public static bool operator <=(VolumeConcentration left, VolumeConcentration right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(VolumeConcentration left, VolumeConcentration right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(VolumeConcentration left, VolumeConcentration right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(VolumeConcentration left, VolumeConcentration right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -752,7 +752,9 @@ public int CompareTo(object obj) /// public int CompareTo(VolumeConcentration other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -829,7 +831,7 @@ public bool Equals(VolumeConcentration other, double tolerance, ComparisonType c /// A hash code for the current VolumeConcentration. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 6e9d42012a..1ea4c2ef66 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1137,25 +1137,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum /// Returns true if less or equal to. public static bool operator <=(VolumeFlow left, VolumeFlow right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(VolumeFlow left, VolumeFlow right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(VolumeFlow left, VolumeFlow right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(VolumeFlow left, VolumeFlow right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -1184,7 +1184,9 @@ public int CompareTo(object obj) /// public int CompareTo(VolumeFlow other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -1261,7 +1263,7 @@ public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparison /// A hash code for the current VolumeFlow. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs index 6efb549f0a..7bed23655e 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs @@ -507,25 +507,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum /// Returns true if less or equal to. public static bool operator <=(VolumePerLength left, VolumePerLength right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(VolumePerLength left, VolumePerLength right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(VolumePerLength left, VolumePerLength right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(VolumePerLength left, VolumePerLength right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -554,7 +554,9 @@ public int CompareTo(object obj) /// public int CompareTo(VolumePerLength other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -631,7 +633,7 @@ public bool Equals(VolumePerLength other, double tolerance, ComparisonType compa /// A hash code for the current VolumePerLength. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs index 645441b8de..caa9b14220 100644 --- a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs @@ -492,25 +492,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Warpi /// Returns true if less or equal to. public static bool operator <=(WarpingMomentOfInertia left, WarpingMomentOfInertia right) { - return left.Value <= right.GetValueAs(left.Unit); + return left.CompareTo(right) <= 0; } /// Returns true if greater than or equal to. public static bool operator >=(WarpingMomentOfInertia left, WarpingMomentOfInertia right) { - return left.Value >= right.GetValueAs(left.Unit); + return left.CompareTo(right) >= 0; } /// Returns true if less than. public static bool operator <(WarpingMomentOfInertia left, WarpingMomentOfInertia right) { - return left.Value < right.GetValueAs(left.Unit); + return left.CompareTo(right) == -1; } /// Returns true if greater than. public static bool operator >(WarpingMomentOfInertia left, WarpingMomentOfInertia right) { - return left.Value > right.GetValueAs(left.Unit); + return left.CompareTo(right) == 1; } /// Returns true if exactly equal. @@ -539,7 +539,9 @@ public int CompareTo(object obj) /// public int CompareTo(WarpingMomentOfInertia other) { - return _value.CompareTo(other.GetValueAs(this.Unit)); + var asFirstUnit = other.GetValueAs(this.Unit); + var asSecondUnit = GetValueAs(other.Unit); + return (_value.CompareTo(asFirstUnit) - other.Value.CompareTo(asSecondUnit)) / 2; } /// @@ -616,7 +618,7 @@ public bool Equals(WarpingMomentOfInertia other, double tolerance, ComparisonTyp /// A hash code for the current WarpingMomentOfInertia. public override int GetHashCode() { - return new { QuantityType, Value, Unit }.GetHashCode(); + return QuantityType.GetHashCode(); } #endregion