diff --git a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs index 32ed95e2f8..7618439a36 100644 --- a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs @@ -469,16 +469,6 @@ int CompareTo(Acceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Acceleration)) - return false; - - var objQuantity = (Acceleration)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Acceleration within the given absolute or relative tolerance. @@ -530,20 +520,6 @@ public bool Equals(Acceleration other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Acceleration by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Acceleration, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Acceleration other, Acceleration maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs index e09c313bdc..87801e0450 100644 --- a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs @@ -488,16 +488,6 @@ int CompareTo(AmountOfSubstance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AmountOfSubstance)) - return false; - - var objQuantity = (AmountOfSubstance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. @@ -549,20 +539,6 @@ public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AmountOfSubstance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AmountOfSubstance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AmountOfSubstance other, AmountOfSubstance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs index 8bb678bbd7..b4f5bea15a 100644 --- a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs @@ -297,16 +297,6 @@ int CompareTo(AmplitudeRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AmplitudeRatio)) - return false; - - var objQuantity = (AmplitudeRatio)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. @@ -358,20 +348,6 @@ public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AmplitudeRatio by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AmplitudeRatio, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AmplitudeRatio other, AmplitudeRatio maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Angle.Common.g.cs b/Common/GeneratedCode/Quantities/Angle.Common.g.cs index 224eb7ae1d..87ac38f45f 100644 --- a/Common/GeneratedCode/Quantities/Angle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Angle.Common.g.cs @@ -487,16 +487,6 @@ int CompareTo(Angle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Angle)) - return false; - - var objQuantity = (Angle)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Angle within the given absolute or relative tolerance. @@ -548,20 +538,6 @@ public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Angle by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Angle, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Angle other, Angle maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs index b360e90d45..1f010471ec 100644 --- a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(ApparentEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ApparentEnergy)) - return false; - - var objQuantity = (ApparentEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(ApparentEnergy other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ApparentEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ApparentEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ApparentEnergy other, ApparentEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs index 20c782523c..0c1bf0f2b6 100644 --- a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ApparentPower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ApparentPower)) - return false; - - var objQuantity = (ApparentPower)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ApparentPower within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ApparentPower other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ApparentPower by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ApparentPower, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ApparentPower other, ApparentPower maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Area.Common.g.cs b/Common/GeneratedCode/Quantities/Area.Common.g.cs index cabdafbce9..083de4e91a 100644 --- a/Common/GeneratedCode/Quantities/Area.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Area.Common.g.cs @@ -469,16 +469,6 @@ int CompareTo(Area other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Area)) - return false; - - var objQuantity = (Area)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Area within the given absolute or relative tolerance. @@ -530,20 +520,6 @@ public bool Equals(Area other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Area by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Area, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Area other, Area maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs index d016ade809..d5948045e0 100644 --- a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(AreaDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AreaDensity)) - return false; - - var objQuantity = (AreaDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AreaDensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(AreaDensity other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AreaDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AreaDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AreaDensity other, AreaDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs index 1cee90c5dc..73aa0731ee 100644 --- a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs @@ -336,16 +336,6 @@ int CompareTo(AreaMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AreaMomentOfInertia)) - return false; - - var objQuantity = (AreaMomentOfInertia)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. @@ -397,20 +387,6 @@ public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AreaMomentOfInertia by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AreaMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AreaMomentOfInertia other, AreaMomentOfInertia maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs index 7f7fb55004..ade3ac0f39 100644 --- a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs @@ -715,15 +715,6 @@ int CompareTo(BitRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - public override bool Equals(object obj) - { - if(obj is null || !(obj is BitRate)) - return false; - - var objQuantity = (BitRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another BitRate within the given absolute or relative tolerance. @@ -775,20 +766,6 @@ public bool Equals(BitRate other, double tolerance, ComparisonType comparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another BitRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(BitRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(BitRate other, BitRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs index c762e6824c..bb650a987e 100644 --- a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(BrakeSpecificFuelConsumption other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is BrakeSpecificFuelConsumption)) - return false; - - var objQuantity = (BrakeSpecificFuelConsumption)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, Compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another BrakeSpecificFuelConsumption by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(BrakeSpecificFuelConsumption, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(BrakeSpecificFuelConsumption other, BrakeSpecificFuelConsumption maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs index 97b3266b6b..830559f670 100644 --- a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Capacitance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Capacitance)) - return false; - - var objQuantity = (Capacitance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Capacitance within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Capacitance other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Capacitance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Capacitance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Capacitance other, Capacitance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Density.Common.g.cs b/Common/GeneratedCode/Quantities/Density.Common.g.cs index 23a093e167..dfe078ef1c 100644 --- a/Common/GeneratedCode/Quantities/Density.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Density.Common.g.cs @@ -944,16 +944,6 @@ int CompareTo(Density other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Density)) - return false; - - var objQuantity = (Density)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Density within the given absolute or relative tolerance. @@ -1005,20 +995,6 @@ public bool Equals(Density other, double tolerance, ComparisonType comparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Density by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Density, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Density other, Density maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Duration.Common.g.cs b/Common/GeneratedCode/Quantities/Duration.Common.g.cs index 58ea15708b..c881936bbe 100644 --- a/Common/GeneratedCode/Quantities/Duration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Duration.Common.g.cs @@ -454,16 +454,6 @@ int CompareTo(Duration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Duration)) - return false; - - var objQuantity = (Duration)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Duration within the given absolute or relative tolerance. @@ -515,20 +505,6 @@ public bool Equals(Duration other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Duration by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Duration, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Duration other, Duration maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs index 5f1007380f..fa2645cabb 100644 --- a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs @@ -336,16 +336,6 @@ int CompareTo(DynamicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is DynamicViscosity)) - return false; - - var objQuantity = (DynamicViscosity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. @@ -397,20 +387,6 @@ public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another DynamicViscosity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(DynamicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(DynamicViscosity other, DynamicViscosity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs index 4627181f9c..e2a8036f57 100644 --- a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ElectricAdmittance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricAdmittance)) - return false; - - var objQuantity = (ElectricAdmittance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricAdmittance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricAdmittance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricAdmittance other, ElectricAdmittance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs index f011e1a311..9464bc59e4 100644 --- a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricCharge other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCharge)) - return false; - - var objQuantity = (ElectricCharge)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricCharge other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCharge by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCharge, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCharge other, ElectricCharge maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs index 7e73beedd0..faa814abe8 100644 --- a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricChargeDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricChargeDensity)) - return false; - - var objQuantity = (ElectricChargeDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricChargeDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricChargeDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricChargeDensity other, ElectricChargeDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs index f3099fd9d3..58a0c1ea8f 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(ElectricConductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricConductance)) - return false; - - var objQuantity = (ElectricConductance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(ElectricConductance other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricConductance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricConductance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricConductance other, ElectricConductance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs index 9487fe3df1..7240a0514e 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricConductivity)) - return false; - - var objQuantity = (ElectricConductivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricConductivity other, double tolerance, ComparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricConductivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricConductivity other, ElectricConductivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs index 28fc1e4f78..3633dedb8b 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(ElectricCurrent other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCurrent)) - return false; - - var objQuantity = (ElectricCurrent)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(ElectricCurrent other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCurrent by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCurrent, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCurrent other, ElectricCurrent maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs index 71a8cdcc34..06abed8ae5 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricCurrentDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCurrentDensity)) - return false; - - var objQuantity = (ElectricCurrentDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCurrentDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCurrentDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCurrentDensity other, ElectricCurrentDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs index 3a777bb953..397a6d710e 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricCurrentGradient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCurrentGradient)) - return false; - - var objQuantity = (ElectricCurrentGradient)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCurrentGradient by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCurrentGradient, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCurrentGradient other, ElectricCurrentGradient maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs index 5f48bcba7a..a54ef6d65b 100644 --- a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricField)) - return false; - - var objQuantity = (ElectricField)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricField within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricField other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricField by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricField, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricField other, ElectricField maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs index dce93b68a0..9d39ac1ace 100644 --- a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricInductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricInductance)) - return false; - - var objQuantity = (ElectricInductance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricInductance other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricInductance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricInductance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricInductance other, ElectricInductance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs index 8a90e4bc1f..9773cc9a38 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs @@ -317,16 +317,6 @@ int CompareTo(ElectricPotential other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricPotential)) - return false; - - var objQuantity = (ElectricPotential)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. @@ -378,20 +368,6 @@ public bool Equals(ElectricPotential other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricPotential by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricPotential, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricPotential other, ElectricPotential maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs index 452a3b6bab..1de05c17a4 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs @@ -316,16 +316,6 @@ int CompareTo(ElectricPotentialAc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricPotentialAc)) - return false; - - var objQuantity = (ElectricPotentialAc)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. @@ -377,20 +367,6 @@ public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricPotentialAc by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricPotentialAc, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricPotentialAc other, ElectricPotentialAc maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs index 7ad0595e08..bc0a23a4ee 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs @@ -316,16 +316,6 @@ int CompareTo(ElectricPotentialDc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricPotentialDc)) - return false; - - var objQuantity = (ElectricPotentialDc)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. @@ -377,20 +367,6 @@ public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricPotentialDc by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricPotentialDc, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricPotentialDc other, ElectricPotentialDc maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs index 6985c1d234..65f6bbe0a9 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ElectricResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricResistance)) - return false; - - var objQuantity = (ElectricResistance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ElectricResistance other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricResistance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricResistance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricResistance other, ElectricResistance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs index 6860758317..7bf7236425 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ElectricResistivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricResistivity)) - return false; - - var objQuantity = (ElectricResistivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ElectricResistivity other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricResistivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricResistivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricResistivity other, ElectricResistivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Energy.Common.g.cs b/Common/GeneratedCode/Quantities/Energy.Common.g.cs index 1d79af5c50..a06bafa83a 100644 --- a/Common/GeneratedCode/Quantities/Energy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Energy.Common.g.cs @@ -640,16 +640,6 @@ int CompareTo(Energy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Energy)) - return false; - - var objQuantity = (Energy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Energy within the given absolute or relative tolerance. @@ -701,20 +691,6 @@ public bool Equals(Energy other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Energy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Energy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Energy other, Energy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs index c5b077145d..2ef62b67d5 100644 --- a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs @@ -355,16 +355,6 @@ int CompareTo(Entropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Entropy)) - return false; - - var objQuantity = (Entropy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Entropy within the given absolute or relative tolerance. @@ -416,20 +406,6 @@ public bool Equals(Entropy other, double tolerance, ComparisonType comparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Entropy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Entropy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Entropy other, Entropy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Flow.Common.g.cs b/Common/GeneratedCode/Quantities/Flow.Common.g.cs index 92500edca9..c962748b8d 100644 --- a/Common/GeneratedCode/Quantities/Flow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Flow.Common.g.cs @@ -715,16 +715,6 @@ int CompareTo(Flow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Flow)) - return false; - - var objQuantity = (Flow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Flow within the given absolute or relative tolerance. @@ -776,20 +766,6 @@ public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Flow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Flow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Flow other, Flow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Force.Common.g.cs b/Common/GeneratedCode/Quantities/Force.Common.g.cs index 827cc1a107..d630d992e2 100644 --- a/Common/GeneratedCode/Quantities/Force.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Force.Common.g.cs @@ -412,16 +412,6 @@ int CompareTo(Force other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Force)) - return false; - - var objQuantity = (Force)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Force within the given absolute or relative tolerance. @@ -473,20 +463,6 @@ public bool Equals(Force other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Force by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Force, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Force other, Force maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs index f3b7e04db9..a0abf55f95 100644 --- a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs @@ -431,16 +431,6 @@ int CompareTo(ForceChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ForceChangeRate)) - return false; - - var objQuantity = (ForceChangeRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. @@ -492,20 +482,6 @@ public bool Equals(ForceChangeRate other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ForceChangeRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ForceChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ForceChangeRate other, ForceChangeRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs index c60955e3c1..fb37493acd 100644 --- a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs @@ -393,16 +393,6 @@ int CompareTo(ForcePerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ForcePerLength)) - return false; - - var objQuantity = (ForcePerLength)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. @@ -454,20 +444,6 @@ public bool Equals(ForcePerLength other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ForcePerLength by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ForcePerLength, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ForcePerLength other, ForcePerLength maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs index 3814aaabb5..2de1c40d60 100644 --- a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(Frequency other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Frequency)) - return false; - - var objQuantity = (Frequency)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Frequency within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(Frequency other, double tolerance, ComparisonType comparisonT return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Frequency by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Frequency, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Frequency other, Frequency maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs index af17a5b614..1e98dd0710 100644 --- a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs @@ -526,16 +526,6 @@ int CompareTo(HeatFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is HeatFlux)) - return false; - - var objQuantity = (HeatFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another HeatFlux within the given absolute or relative tolerance. @@ -587,20 +577,6 @@ public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another HeatFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(HeatFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(HeatFlux other, HeatFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs index 6c1e6e297b..f3e67e84d8 100644 --- a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(HeatTransferCoefficient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is HeatTransferCoefficient)) - return false; - - var objQuantity = (HeatTransferCoefficient)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another HeatTransferCoefficient by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(HeatTransferCoefficient, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(HeatTransferCoefficient other, HeatTransferCoefficient maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs index abd8790909..eb57f3542e 100644 --- a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(Illuminance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Illuminance)) - return false; - - var objQuantity = (Illuminance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Illuminance within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(Illuminance other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Illuminance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Illuminance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Illuminance other, Illuminance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Information.Common.g.cs b/Common/GeneratedCode/Quantities/Information.Common.g.cs index 9183d31d8f..2a368a9696 100644 --- a/Common/GeneratedCode/Quantities/Information.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Information.Common.g.cs @@ -715,15 +715,6 @@ int CompareTo(Information other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - public override bool Equals(object obj) - { - if(obj is null || !(obj is Information)) - return false; - - var objQuantity = (Information)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Information within the given absolute or relative tolerance. @@ -775,20 +766,6 @@ public bool Equals(Information other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Information by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Information, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Information other, Information maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs index 7f1b4252ad..1e02e27a79 100644 --- a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(Irradiance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Irradiance)) - return false; - - var objQuantity = (Irradiance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Irradiance within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(Irradiance other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Irradiance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Irradiance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Irradiance other, Irradiance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs index 58db172b3f..c34d37be91 100644 --- a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(Irradiation other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Irradiation)) - return false; - - var objQuantity = (Irradiation)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Irradiation within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(Irradiation other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Irradiation by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Irradiation, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Irradiation other, Irradiation maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs index fe75567216..3b050b5dfb 100644 --- a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(KinematicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is KinematicViscosity)) - return false; - - var objQuantity = (KinematicViscosity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(KinematicViscosity other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another KinematicViscosity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(KinematicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(KinematicViscosity other, KinematicViscosity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs index 2c37adad8f..8b0a68cfa8 100644 --- a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(LapseRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LapseRate)) - return false; - - var objQuantity = (LapseRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LapseRate within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonT return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LapseRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LapseRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LapseRate other, LapseRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Length.Common.g.cs b/Common/GeneratedCode/Quantities/Length.Common.g.cs index 2e3d2a38d3..421b319095 100644 --- a/Common/GeneratedCode/Quantities/Length.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Length.Common.g.cs @@ -640,16 +640,6 @@ int CompareTo(Length other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Length)) - return false; - - var objQuantity = (Length)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Length within the given absolute or relative tolerance. @@ -701,20 +691,6 @@ public bool Equals(Length other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Length by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Length, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Length other, Length maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Level.Common.g.cs b/Common/GeneratedCode/Quantities/Level.Common.g.cs index ad48a43d85..f8aa2f67f1 100644 --- a/Common/GeneratedCode/Quantities/Level.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Level.Common.g.cs @@ -259,16 +259,6 @@ int CompareTo(Level other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Level)) - return false; - - var objQuantity = (Level)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Level within the given absolute or relative tolerance. @@ -320,20 +310,6 @@ public bool Equals(Level other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Level by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Level, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Level other, Level maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs index 4193003fb0..b88033a953 100644 --- a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(LinearDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LinearDensity)) - return false; - - var objQuantity = (LinearDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LinearDensity within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(LinearDensity other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LinearDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LinearDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LinearDensity other, LinearDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs index a5b0e63900..69bec040a7 100644 --- a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(LuminousFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LuminousFlux)) - return false; - - var objQuantity = (LuminousFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LuminousFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LuminousFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LuminousFlux other, LuminousFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs index b5fd94601d..36314d318a 100644 --- a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(LuminousIntensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LuminousIntensity)) - return false; - - var objQuantity = (LuminousIntensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(LuminousIntensity other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LuminousIntensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LuminousIntensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LuminousIntensity other, LuminousIntensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs index b5f5d2dde5..7be8363c6c 100644 --- a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(MagneticField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MagneticField)) - return false; - - var objQuantity = (MagneticField)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MagneticField within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(MagneticField other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MagneticField by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MagneticField, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MagneticField other, MagneticField maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs index b09af34da0..60da01ca35 100644 --- a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(MagneticFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MagneticFlux)) - return false; - - var objQuantity = (MagneticFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MagneticFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MagneticFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MagneticFlux other, MagneticFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs index 0a04d5753e..f2b6b24a76 100644 --- a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Magnetization other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Magnetization)) - return false; - - var objQuantity = (Magnetization)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Magnetization within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Magnetization other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Magnetization by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Magnetization, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Magnetization other, Magnetization maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Mass.Common.g.cs b/Common/GeneratedCode/Quantities/Mass.Common.g.cs index 0e9f53d699..7f57cf1f55 100644 --- a/Common/GeneratedCode/Quantities/Mass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Mass.Common.g.cs @@ -621,16 +621,6 @@ int CompareTo(Mass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Mass)) - return false; - - var objQuantity = (Mass)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Mass within the given absolute or relative tolerance. @@ -682,20 +672,6 @@ public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Mass by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Mass, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Mass other, Mass maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs index c1f884aea2..cf8f9f038a 100644 --- a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs @@ -507,16 +507,6 @@ int CompareTo(MassFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MassFlow)) - return false; - - var objQuantity = (MassFlow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MassFlow within the given absolute or relative tolerance. @@ -568,20 +558,6 @@ public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MassFlow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MassFlow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MassFlow other, MassFlow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs index 12b507c25c..66b14d1c22 100644 --- a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(MassFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MassFlux)) - return false; - - var objQuantity = (MassFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MassFlux within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MassFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MassFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MassFlux other, MassFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs index 90e30652cb..ad89f69463 100644 --- a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs @@ -716,16 +716,6 @@ int CompareTo(MassMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MassMomentOfInertia)) - return false; - - var objQuantity = (MassMomentOfInertia)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. @@ -777,20 +767,6 @@ public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MassMomentOfInertia by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MassMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MassMomentOfInertia other, MassMomentOfInertia maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs index f4164e95c9..04824f0c43 100644 --- a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(MolarEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MolarEnergy)) - return false; - - var objQuantity = (MolarEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(MolarEnergy other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MolarEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MolarEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MolarEnergy other, MolarEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs index abb87a58f9..df7f68bbef 100644 --- a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(MolarEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MolarEntropy)) - return false; - - var objQuantity = (MolarEntropy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MolarEntropy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MolarEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MolarEntropy other, MolarEntropy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs index 6cbe02d28d..6a75f0bb95 100644 --- a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs @@ -450,16 +450,6 @@ int CompareTo(MolarMass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MolarMass)) - return false; - - var objQuantity = (MolarMass)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MolarMass within the given absolute or relative tolerance. @@ -511,20 +501,6 @@ public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonT return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MolarMass by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MolarMass, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MolarMass other, MolarMass maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs index 19a4f20720..fd856010ee 100644 --- a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(Molarity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Molarity)) - return false; - - var objQuantity = (Molarity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Molarity within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(Molarity other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Molarity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Molarity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Molarity other, Molarity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs index 032dec27e5..2efe17735e 100644 --- a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Permeability other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Permeability)) - return false; - - var objQuantity = (Permeability)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Permeability within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Permeability other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Permeability by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Permeability, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Permeability other, Permeability maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs index a8a40f1c0a..30db6dcca2 100644 --- a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Permittivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Permittivity)) - return false; - - var objQuantity = (Permittivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Permittivity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Permittivity other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Permittivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Permittivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Permittivity other, Permittivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Power.Common.g.cs b/Common/GeneratedCode/Quantities/Power.Common.g.cs index ed9cbba62d..48b81568f3 100644 --- a/Common/GeneratedCode/Quantities/Power.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Power.Common.g.cs @@ -602,15 +602,6 @@ int CompareTo(Power other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - public override bool Equals(object obj) - { - if(obj is null || !(obj is Power)) - return false; - - var objQuantity = (Power)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Power within the given absolute or relative tolerance. @@ -662,20 +653,6 @@ public bool Equals(Power other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Power by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Power, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Power other, Power maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs index 1acfabad4e..dd901c6004 100644 --- a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs @@ -1058,16 +1058,6 @@ int CompareTo(PowerDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is PowerDensity)) - return false; - - var objQuantity = (PowerDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another PowerDensity within the given absolute or relative tolerance. @@ -1119,20 +1109,6 @@ public bool Equals(PowerDensity other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another PowerDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(PowerDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(PowerDensity other, PowerDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs index ab16e2fdc9..2937aa4cc9 100644 --- a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs @@ -259,16 +259,6 @@ int CompareTo(PowerRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is PowerRatio)) - return false; - - var objQuantity = (PowerRatio)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another PowerRatio within the given absolute or relative tolerance. @@ -320,20 +310,6 @@ public bool Equals(PowerRatio other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another PowerRatio by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(PowerRatio, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(PowerRatio other, PowerRatio maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs index 26a39fe932..264db9c86c 100644 --- a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs @@ -946,16 +946,6 @@ int CompareTo(Pressure other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Pressure)) - return false; - - var objQuantity = (Pressure)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Pressure within the given absolute or relative tolerance. @@ -1007,20 +997,6 @@ public bool Equals(Pressure other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Pressure by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Pressure, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Pressure other, Pressure maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs index 11c7fdc4a8..b95433a44e 100644 --- a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(PressureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is PressureChangeRate)) - return false; - - var objQuantity = (PressureChangeRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(PressureChangeRate other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another PressureChangeRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(PressureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(PressureChangeRate other, PressureChangeRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs index b3629babf9..255b7c181d 100644 --- a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs @@ -335,16 +335,6 @@ int CompareTo(Ratio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Ratio)) - return false; - - var objQuantity = (Ratio)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Ratio within the given absolute or relative tolerance. @@ -396,20 +386,6 @@ public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Ratio by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Ratio, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Ratio other, Ratio maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs index fc1272c6f8..aa0db40964 100644 --- a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(ReactiveEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ReactiveEnergy)) - return false; - - var objQuantity = (ReactiveEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ReactiveEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ReactiveEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ReactiveEnergy other, ReactiveEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs index ba8679fd10..87de0e0958 100644 --- a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ReactivePower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ReactivePower)) - return false; - - var objQuantity = (ReactivePower)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ReactivePower within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ReactivePower other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ReactivePower by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ReactivePower, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ReactivePower other, ReactivePower maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs index 992d9acab6..93924c8645 100644 --- a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(RotationalAcceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalAcceleration)) - return false; - - var objQuantity = (RotationalAcceleration)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(RotationalAcceleration other, double tolerance, ComparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalAcceleration by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalAcceleration, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalAcceleration other, RotationalAcceleration maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs index 430347c970..5643723cf3 100644 --- a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs @@ -469,16 +469,6 @@ int CompareTo(RotationalSpeed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalSpeed)) - return false; - - var objQuantity = (RotationalSpeed)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. @@ -530,20 +520,6 @@ public bool Equals(RotationalSpeed other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalSpeed by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalSpeed, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalSpeed other, RotationalSpeed maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs index 5ec21ca384..69eab9468a 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(RotationalStiffness other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalStiffness)) - return false; - - var objQuantity = (RotationalStiffness)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(RotationalStiffness other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalStiffness by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalStiffness, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalStiffness other, RotationalStiffness maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs index e994b6ed9b..737080f068 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(RotationalStiffnessPerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalStiffnessPerLength)) - return false; - - var objQuantity = (RotationalStiffnessPerLength)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(RotationalStiffnessPerLength other, double tolerance, Compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalStiffnessPerLength by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalStiffnessPerLength, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalStiffnessPerLength other, RotationalStiffnessPerLength maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs index 2f258256e0..c99667ae4b 100644 --- a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs @@ -240,16 +240,6 @@ int CompareTo(SolidAngle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SolidAngle)) - return false; - - var objQuantity = (SolidAngle)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SolidAngle within the given absolute or relative tolerance. @@ -301,20 +291,6 @@ public bool Equals(SolidAngle other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SolidAngle by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SolidAngle, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SolidAngle other, SolidAngle maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs index 944ba7474b..4000d3e74f 100644 --- a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(SpecificEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificEnergy)) - return false; - - var objQuantity = (SpecificEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(SpecificEnergy other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificEnergy other, SpecificEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs index c31a618029..ab92be92c6 100644 --- a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(SpecificEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificEntropy)) - return false; - - var objQuantity = (SpecificEntropy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(SpecificEntropy other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificEntropy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificEntropy other, SpecificEntropy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs index 081afdbe8e..08d2504672 100644 --- a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(SpecificVolume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificVolume)) - return false; - - var objQuantity = (SpecificVolume)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(SpecificVolume other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificVolume by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificVolume, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificVolume other, SpecificVolume maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs index f3752b3ec5..ae08ee474a 100644 --- a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs @@ -545,16 +545,6 @@ int CompareTo(SpecificWeight other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificWeight)) - return false; - - var objQuantity = (SpecificWeight)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. @@ -606,20 +596,6 @@ public bool Equals(SpecificWeight other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificWeight by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificWeight, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificWeight other, SpecificWeight maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Speed.Common.g.cs b/Common/GeneratedCode/Quantities/Speed.Common.g.cs index 3bd6a717fd..d3504c1d30 100644 --- a/Common/GeneratedCode/Quantities/Speed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Speed.Common.g.cs @@ -830,16 +830,6 @@ int CompareTo(Speed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Speed)) - return false; - - var objQuantity = (Speed)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Speed within the given absolute or relative tolerance. @@ -891,20 +881,6 @@ public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Speed by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Speed, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Speed other, Speed maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs index 3e5e6b2891..f332113b81 100644 --- a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(Temperature other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Temperature)) - return false; - - var objQuantity = (Temperature)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Temperature within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(Temperature other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Temperature by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Temperature, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Temperature other, Temperature maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs index 842e3a13bd..795ed4d603 100644 --- a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs @@ -412,16 +412,6 @@ int CompareTo(TemperatureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is TemperatureChangeRate)) - return false; - - var objQuantity = (TemperatureChangeRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. @@ -473,20 +463,6 @@ public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another TemperatureChangeRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(TemperatureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(TemperatureChangeRate other, TemperatureChangeRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs index f450738404..ba2df9fe97 100644 --- a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs @@ -541,16 +541,6 @@ int CompareTo(TemperatureDelta other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is TemperatureDelta)) - return false; - - var objQuantity = (TemperatureDelta)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. @@ -602,20 +592,6 @@ public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another TemperatureDelta by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(TemperatureDelta, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(TemperatureDelta other, TemperatureDelta maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs index 799d338c54..da68e4cdd8 100644 --- a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(ThermalConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ThermalConductivity)) - return false; - - var objQuantity = (ThermalConductivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(ThermalConductivity other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ThermalConductivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ThermalConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ThermalConductivity other, ThermalConductivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs index 89f752dae9..a755023826 100644 --- a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs @@ -317,16 +317,6 @@ int CompareTo(ThermalResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ThermalResistance)) - return false; - - var objQuantity = (ThermalResistance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. @@ -378,20 +368,6 @@ public bool Equals(ThermalResistance other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ThermalResistance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ThermalResistance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ThermalResistance other, ThermalResistance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Torque.Common.g.cs b/Common/GeneratedCode/Quantities/Torque.Common.g.cs index b81e935d7c..88a6fd4cf9 100644 --- a/Common/GeneratedCode/Quantities/Torque.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Torque.Common.g.cs @@ -621,16 +621,6 @@ int CompareTo(Torque other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Torque)) - return false; - - var objQuantity = (Torque)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Torque within the given absolute or relative tolerance. @@ -682,20 +672,6 @@ public bool Equals(Torque other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Torque by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Torque, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Torque other, Torque maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs index 5764238125..331c692468 100644 --- a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs @@ -240,16 +240,6 @@ int CompareTo(VitaminA other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is VitaminA)) - return false; - - var objQuantity = (VitaminA)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another VitaminA within the given absolute or relative tolerance. @@ -301,20 +291,6 @@ public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another VitaminA by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(VitaminA, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(VitaminA other, VitaminA maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Volume.Common.g.cs b/Common/GeneratedCode/Quantities/Volume.Common.g.cs index 7af8d0bd50..2f2fc68a08 100644 --- a/Common/GeneratedCode/Quantities/Volume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Volume.Common.g.cs @@ -1062,16 +1062,6 @@ int CompareTo(Volume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Volume)) - return false; - - var objQuantity = (Volume)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Volume within the given absolute or relative tolerance. @@ -1123,20 +1113,6 @@ public bool Equals(Volume other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Volume by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Volume, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Volume other, Volume maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs index 706449f20d..47e5cd648e 100644 --- a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs @@ -716,16 +716,6 @@ int CompareTo(VolumeFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is VolumeFlow)) - return false; - - var objQuantity = (VolumeFlow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. @@ -777,20 +767,6 @@ public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another VolumeFlow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(VolumeFlow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(VolumeFlow other, VolumeFlow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs index 6312872176..d5d8d54956 100644 --- a/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs @@ -269,28 +269,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meterpersecondsquared.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Acceleration a = Acceleration.FromMetersPerSecondSquared(1); - Acceleration b = Acceleration.FromMetersPerSecondSquared(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Acceleration v = Acceleration.FromMetersPerSecondSquared(1); - Assert.True(v.Equals(Acceleration.FromMetersPerSecondSquared(1), Acceleration.FromMetersPerSecondSquared(MetersPerSecondSquaredTolerance))); - Assert.False(v.Equals(Acceleration.Zero, Acceleration.FromMetersPerSecondSquared(MetersPerSecondSquaredTolerance))); + Assert.True(v.Equals(Acceleration.FromMetersPerSecondSquared(1), MetersPerSecondSquaredTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Acceleration.Zero, MetersPerSecondSquaredTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs index ea9b263136..ad91ab381d 100644 --- a/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs @@ -279,28 +279,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => mole.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AmountOfSubstance a = AmountOfSubstance.FromMoles(1); - AmountOfSubstance b = AmountOfSubstance.FromMoles(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AmountOfSubstance v = AmountOfSubstance.FromMoles(1); - Assert.True(v.Equals(AmountOfSubstance.FromMoles(1), AmountOfSubstance.FromMoles(MolesTolerance))); - Assert.False(v.Equals(AmountOfSubstance.Zero, AmountOfSubstance.FromMoles(MolesTolerance))); + Assert.True(v.Equals(AmountOfSubstance.FromMoles(1), MolesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AmountOfSubstance.Zero, MolesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs index 5ef7153039..56400c05f3 100644 --- a/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs @@ -184,28 +184,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibelvolt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AmplitudeRatio a = AmplitudeRatio.FromDecibelVolts(1); - AmplitudeRatio b = AmplitudeRatio.FromDecibelVolts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AmplitudeRatio v = AmplitudeRatio.FromDecibelVolts(1); - Assert.True(v.Equals(AmplitudeRatio.FromDecibelVolts(1), AmplitudeRatio.FromDecibelVolts(DecibelVoltsTolerance))); - Assert.False(v.Equals(AmplitudeRatio.Zero, AmplitudeRatio.FromDecibelVolts(DecibelVoltsTolerance))); + Assert.True(v.Equals(AmplitudeRatio.FromDecibelVolts(1), DecibelVoltsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AmplitudeRatio.Zero, DecibelVoltsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs index 6589478a78..b024d92619 100644 --- a/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs @@ -279,28 +279,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => degree.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Angle a = Angle.FromDegrees(1); - Angle b = Angle.FromDegrees(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Angle v = Angle.FromDegrees(1); - Assert.True(v.Equals(Angle.FromDegrees(1), Angle.FromDegrees(DegreesTolerance))); - Assert.False(v.Equals(Angle.Zero, Angle.FromDegrees(DegreesTolerance))); + Assert.True(v.Equals(Angle.FromDegrees(1), DegreesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Angle.Zero, DegreesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs index 7515f60b10..6fab19f62f 100644 --- a/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltamperehour.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ApparentEnergy a = ApparentEnergy.FromVoltampereHours(1); - ApparentEnergy b = ApparentEnergy.FromVoltampereHours(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ApparentEnergy v = ApparentEnergy.FromVoltampereHours(1); - Assert.True(v.Equals(ApparentEnergy.FromVoltampereHours(1), ApparentEnergy.FromVoltampereHours(VoltampereHoursTolerance))); - Assert.False(v.Equals(ApparentEnergy.Zero, ApparentEnergy.FromVoltampereHours(VoltampereHoursTolerance))); + Assert.True(v.Equals(ApparentEnergy.FromVoltampereHours(1), VoltampereHoursTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ApparentEnergy.Zero, VoltampereHoursTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs index 198401e9cd..91ad20b6c2 100644 --- a/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltampere.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ApparentPower a = ApparentPower.FromVoltamperes(1); - ApparentPower b = ApparentPower.FromVoltamperes(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ApparentPower v = ApparentPower.FromVoltamperes(1); - Assert.True(v.Equals(ApparentPower.FromVoltamperes(1), ApparentPower.FromVoltamperes(VoltamperesTolerance))); - Assert.False(v.Equals(ApparentPower.Zero, ApparentPower.FromVoltamperes(VoltamperesTolerance))); + Assert.True(v.Equals(ApparentPower.FromVoltamperes(1), VoltamperesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ApparentPower.Zero, VoltamperesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs index bb580bc641..0d2dea3d1a 100644 --- a/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AreaDensity a = AreaDensity.FromKilogramsPerSquareMeter(1); - AreaDensity b = AreaDensity.FromKilogramsPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AreaDensity v = AreaDensity.FromKilogramsPerSquareMeter(1); - Assert.True(v.Equals(AreaDensity.FromKilogramsPerSquareMeter(1), AreaDensity.FromKilogramsPerSquareMeter(KilogramsPerSquareMeterTolerance))); - Assert.False(v.Equals(AreaDensity.Zero, AreaDensity.FromKilogramsPerSquareMeter(KilogramsPerSquareMeterTolerance))); + Assert.True(v.Equals(AreaDensity.FromKilogramsPerSquareMeter(1), KilogramsPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AreaDensity.Zero, KilogramsPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs index 0811084f53..95e82fc60a 100644 --- a/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs @@ -199,28 +199,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => metertothefourth.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AreaMomentOfInertia a = AreaMomentOfInertia.FromMetersToTheFourth(1); - AreaMomentOfInertia b = AreaMomentOfInertia.FromMetersToTheFourth(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AreaMomentOfInertia v = AreaMomentOfInertia.FromMetersToTheFourth(1); - Assert.True(v.Equals(AreaMomentOfInertia.FromMetersToTheFourth(1), AreaMomentOfInertia.FromMetersToTheFourth(MetersToTheFourthTolerance))); - Assert.False(v.Equals(AreaMomentOfInertia.Zero, AreaMomentOfInertia.FromMetersToTheFourth(MetersToTheFourthTolerance))); + Assert.True(v.Equals(AreaMomentOfInertia.FromMetersToTheFourth(1), MetersToTheFourthTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AreaMomentOfInertia.Zero, MetersToTheFourthTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs index bc77c9e71f..fd609e9363 100644 --- a/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs @@ -269,28 +269,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => squaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Area a = Area.FromSquareMeters(1); - Area b = Area.FromSquareMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Area v = Area.FromSquareMeters(1); - Assert.True(v.Equals(Area.FromSquareMeters(1), Area.FromSquareMeters(SquareMetersTolerance))); - Assert.False(v.Equals(Area.Zero, Area.FromSquareMeters(SquareMetersTolerance))); + Assert.True(v.Equals(Area.FromSquareMeters(1), SquareMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Area.Zero, SquareMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs index 6d249382a5..4ffd779db9 100644 --- a/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => bitpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - BitRate a = BitRate.FromBitsPerSecond(1); - BitRate b = BitRate.FromBitsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { BitRate v = BitRate.FromBitsPerSecond(1); - Assert.True(v.Equals(BitRate.FromBitsPerSecond(1), BitRate.FromBitsPerSecond(BitsPerSecondTolerance))); - Assert.False(v.Equals(BitRate.Zero, BitRate.FromBitsPerSecond(BitsPerSecondTolerance))); + Assert.True(v.Equals(BitRate.FromBitsPerSecond(1), BitsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(BitRate.Zero, BitsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs index 04aa19ffc5..f6970db1c4 100644 --- a/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogramperjoule.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - BrakeSpecificFuelConsumption a = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); - BrakeSpecificFuelConsumption b = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { BrakeSpecificFuelConsumption v = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); - Assert.True(v.Equals(BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1), BrakeSpecificFuelConsumption.FromKilogramsPerJoule(KilogramsPerJouleTolerance))); - Assert.False(v.Equals(BrakeSpecificFuelConsumption.Zero, BrakeSpecificFuelConsumption.FromKilogramsPerJoule(KilogramsPerJouleTolerance))); + Assert.True(v.Equals(BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1), KilogramsPerJouleTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(BrakeSpecificFuelConsumption.Zero, KilogramsPerJouleTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs index 36e8413b89..bf1403edc7 100644 --- a/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => farad.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Capacitance a = Capacitance.FromFarads(1); - Capacitance b = Capacitance.FromFarads(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Capacitance v = Capacitance.FromFarads(1); - Assert.True(v.Equals(Capacitance.FromFarads(1), Capacitance.FromFarads(FaradsTolerance))); - Assert.False(v.Equals(Capacitance.Zero, Capacitance.FromFarads(FaradsTolerance))); + Assert.True(v.Equals(Capacitance.FromFarads(1), FaradsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Capacitance.Zero, FaradsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs index 3a721ca51e..367edee704 100644 --- a/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs @@ -519,28 +519,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Density a = Density.FromKilogramsPerCubicMeter(1); - Density b = Density.FromKilogramsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Density v = Density.FromKilogramsPerCubicMeter(1); - Assert.True(v.Equals(Density.FromKilogramsPerCubicMeter(1), Density.FromKilogramsPerCubicMeter(KilogramsPerCubicMeterTolerance))); - Assert.False(v.Equals(Density.Zero, Density.FromKilogramsPerCubicMeter(KilogramsPerCubicMeterTolerance))); + Assert.True(v.Equals(Density.FromKilogramsPerCubicMeter(1), KilogramsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Density.Zero, KilogramsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs index 0c107c622b..46ffcb501f 100644 --- a/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs @@ -259,28 +259,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => second.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Duration a = Duration.FromSeconds(1); - Duration b = Duration.FromSeconds(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Duration v = Duration.FromSeconds(1); - Assert.True(v.Equals(Duration.FromSeconds(1), Duration.FromSeconds(SecondsTolerance))); - Assert.False(v.Equals(Duration.Zero, Duration.FromSeconds(SecondsTolerance))); + Assert.True(v.Equals(Duration.FromSeconds(1), SecondsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Duration.Zero, SecondsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs index fe80050f24..3d0034f8bd 100644 --- a/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs @@ -199,28 +199,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonsecondpermetersquared.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - DynamicViscosity a = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); - DynamicViscosity b = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { DynamicViscosity v = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); - Assert.True(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1), DynamicViscosity.FromNewtonSecondsPerMeterSquared(NewtonSecondsPerMeterSquaredTolerance))); - Assert.False(v.Equals(DynamicViscosity.Zero, DynamicViscosity.FromNewtonSecondsPerMeterSquared(NewtonSecondsPerMeterSquaredTolerance))); + Assert.True(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1), NewtonSecondsPerMeterSquaredTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(DynamicViscosity.Zero, NewtonSecondsPerMeterSquaredTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs index 58097b5e01..52ce56c277 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => siemens.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricAdmittance a = ElectricAdmittance.FromSiemens(1); - ElectricAdmittance b = ElectricAdmittance.FromSiemens(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricAdmittance v = ElectricAdmittance.FromSiemens(1); - Assert.True(v.Equals(ElectricAdmittance.FromSiemens(1), ElectricAdmittance.FromSiemens(SiemensTolerance))); - Assert.False(v.Equals(ElectricAdmittance.Zero, ElectricAdmittance.FromSiemens(SiemensTolerance))); + Assert.True(v.Equals(ElectricAdmittance.FromSiemens(1), SiemensTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricAdmittance.Zero, SiemensTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs index 21589616fb..f8db7c5e41 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => coulombpercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricChargeDensity a = ElectricChargeDensity.FromCoulombsPerCubicMeter(1); - ElectricChargeDensity b = ElectricChargeDensity.FromCoulombsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricChargeDensity v = ElectricChargeDensity.FromCoulombsPerCubicMeter(1); - Assert.True(v.Equals(ElectricChargeDensity.FromCoulombsPerCubicMeter(1), ElectricChargeDensity.FromCoulombsPerCubicMeter(CoulombsPerCubicMeterTolerance))); - Assert.False(v.Equals(ElectricChargeDensity.Zero, ElectricChargeDensity.FromCoulombsPerCubicMeter(CoulombsPerCubicMeterTolerance))); + Assert.True(v.Equals(ElectricChargeDensity.FromCoulombsPerCubicMeter(1), CoulombsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricChargeDensity.Zero, CoulombsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs index e867eb01ab..dca2f01ccc 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => coulomb.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCharge a = ElectricCharge.FromCoulombs(1); - ElectricCharge b = ElectricCharge.FromCoulombs(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCharge v = ElectricCharge.FromCoulombs(1); - Assert.True(v.Equals(ElectricCharge.FromCoulombs(1), ElectricCharge.FromCoulombs(CoulombsTolerance))); - Assert.False(v.Equals(ElectricCharge.Zero, ElectricCharge.FromCoulombs(CoulombsTolerance))); + Assert.True(v.Equals(ElectricCharge.FromCoulombs(1), CoulombsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCharge.Zero, CoulombsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs index e6e565c53f..dc0bf955c7 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => siemens.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricConductance a = ElectricConductance.FromSiemens(1); - ElectricConductance b = ElectricConductance.FromSiemens(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricConductance v = ElectricConductance.FromSiemens(1); - Assert.True(v.Equals(ElectricConductance.FromSiemens(1), ElectricConductance.FromSiemens(SiemensTolerance))); - Assert.False(v.Equals(ElectricConductance.Zero, ElectricConductance.FromSiemens(SiemensTolerance))); + Assert.True(v.Equals(ElectricConductance.FromSiemens(1), SiemensTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricConductance.Zero, SiemensTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs index afa9552ae4..e2b68f3af9 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => siemenspermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricConductivity a = ElectricConductivity.FromSiemensPerMeter(1); - ElectricConductivity b = ElectricConductivity.FromSiemensPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricConductivity v = ElectricConductivity.FromSiemensPerMeter(1); - Assert.True(v.Equals(ElectricConductivity.FromSiemensPerMeter(1), ElectricConductivity.FromSiemensPerMeter(SiemensPerMeterTolerance))); - Assert.False(v.Equals(ElectricConductivity.Zero, ElectricConductivity.FromSiemensPerMeter(SiemensPerMeterTolerance))); + Assert.True(v.Equals(ElectricConductivity.FromSiemensPerMeter(1), SiemensPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricConductivity.Zero, SiemensPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs index 4f28d50282..ec9b3c9491 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => amperepersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCurrentDensity a = ElectricCurrentDensity.FromAmperesPerSquareMeter(1); - ElectricCurrentDensity b = ElectricCurrentDensity.FromAmperesPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCurrentDensity v = ElectricCurrentDensity.FromAmperesPerSquareMeter(1); - Assert.True(v.Equals(ElectricCurrentDensity.FromAmperesPerSquareMeter(1), ElectricCurrentDensity.FromAmperesPerSquareMeter(AmperesPerSquareMeterTolerance))); - Assert.False(v.Equals(ElectricCurrentDensity.Zero, ElectricCurrentDensity.FromAmperesPerSquareMeter(AmperesPerSquareMeterTolerance))); + Assert.True(v.Equals(ElectricCurrentDensity.FromAmperesPerSquareMeter(1), AmperesPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCurrentDensity.Zero, AmperesPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs index 066f847fa9..87a2096ef1 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => amperepersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCurrentGradient a = ElectricCurrentGradient.FromAmperesPerSecond(1); - ElectricCurrentGradient b = ElectricCurrentGradient.FromAmperesPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCurrentGradient v = ElectricCurrentGradient.FromAmperesPerSecond(1); - Assert.True(v.Equals(ElectricCurrentGradient.FromAmperesPerSecond(1), ElectricCurrentGradient.FromAmperesPerSecond(AmperesPerSecondTolerance))); - Assert.False(v.Equals(ElectricCurrentGradient.Zero, ElectricCurrentGradient.FromAmperesPerSecond(AmperesPerSecondTolerance))); + Assert.True(v.Equals(ElectricCurrentGradient.FromAmperesPerSecond(1), AmperesPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCurrentGradient.Zero, AmperesPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs index 44e66c1490..fbdc010cd2 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => ampere.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCurrent a = ElectricCurrent.FromAmperes(1); - ElectricCurrent b = ElectricCurrent.FromAmperes(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCurrent v = ElectricCurrent.FromAmperes(1); - Assert.True(v.Equals(ElectricCurrent.FromAmperes(1), ElectricCurrent.FromAmperes(AmperesTolerance))); - Assert.False(v.Equals(ElectricCurrent.Zero, ElectricCurrent.FromAmperes(AmperesTolerance))); + Assert.True(v.Equals(ElectricCurrent.FromAmperes(1), AmperesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCurrent.Zero, AmperesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs index 559f971e51..ee0f64934c 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricField a = ElectricField.FromVoltsPerMeter(1); - ElectricField b = ElectricField.FromVoltsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricField v = ElectricField.FromVoltsPerMeter(1); - Assert.True(v.Equals(ElectricField.FromVoltsPerMeter(1), ElectricField.FromVoltsPerMeter(VoltsPerMeterTolerance))); - Assert.False(v.Equals(ElectricField.Zero, ElectricField.FromVoltsPerMeter(VoltsPerMeterTolerance))); + Assert.True(v.Equals(ElectricField.FromVoltsPerMeter(1), VoltsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricField.Zero, VoltsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs index ad2bfe300a..21cb45fb10 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => henry.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricInductance a = ElectricInductance.FromHenries(1); - ElectricInductance b = ElectricInductance.FromHenries(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricInductance v = ElectricInductance.FromHenries(1); - Assert.True(v.Equals(ElectricInductance.FromHenries(1), ElectricInductance.FromHenries(HenriesTolerance))); - Assert.False(v.Equals(ElectricInductance.Zero, ElectricInductance.FromHenries(HenriesTolerance))); + Assert.True(v.Equals(ElectricInductance.FromHenries(1), HenriesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricInductance.Zero, HenriesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs index 382dca9c20..4e00d0f1d4 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltac.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricPotentialAc a = ElectricPotentialAc.FromVoltsAc(1); - ElectricPotentialAc b = ElectricPotentialAc.FromVoltsAc(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricPotentialAc v = ElectricPotentialAc.FromVoltsAc(1); - Assert.True(v.Equals(ElectricPotentialAc.FromVoltsAc(1), ElectricPotentialAc.FromVoltsAc(VoltsAcTolerance))); - Assert.False(v.Equals(ElectricPotentialAc.Zero, ElectricPotentialAc.FromVoltsAc(VoltsAcTolerance))); + Assert.True(v.Equals(ElectricPotentialAc.FromVoltsAc(1), VoltsAcTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricPotentialAc.Zero, VoltsAcTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs index d87ca1945b..31ae99171d 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltdc.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricPotentialDc a = ElectricPotentialDc.FromVoltsDc(1); - ElectricPotentialDc b = ElectricPotentialDc.FromVoltsDc(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricPotentialDc v = ElectricPotentialDc.FromVoltsDc(1); - Assert.True(v.Equals(ElectricPotentialDc.FromVoltsDc(1), ElectricPotentialDc.FromVoltsDc(VoltsDcTolerance))); - Assert.False(v.Equals(ElectricPotentialDc.Zero, ElectricPotentialDc.FromVoltsDc(VoltsDcTolerance))); + Assert.True(v.Equals(ElectricPotentialDc.FromVoltsDc(1), VoltsDcTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricPotentialDc.Zero, VoltsDcTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs index b3f20c8c98..3418f8e556 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => volt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricPotential a = ElectricPotential.FromVolts(1); - ElectricPotential b = ElectricPotential.FromVolts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricPotential v = ElectricPotential.FromVolts(1); - Assert.True(v.Equals(ElectricPotential.FromVolts(1), ElectricPotential.FromVolts(VoltsTolerance))); - Assert.False(v.Equals(ElectricPotential.Zero, ElectricPotential.FromVolts(VoltsTolerance))); + Assert.True(v.Equals(ElectricPotential.FromVolts(1), VoltsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricPotential.Zero, VoltsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs index 503519f667..58d093de1f 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => ohm.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricResistance a = ElectricResistance.FromOhms(1); - ElectricResistance b = ElectricResistance.FromOhms(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricResistance v = ElectricResistance.FromOhms(1); - Assert.True(v.Equals(ElectricResistance.FromOhms(1), ElectricResistance.FromOhms(OhmsTolerance))); - Assert.False(v.Equals(ElectricResistance.Zero, ElectricResistance.FromOhms(OhmsTolerance))); + Assert.True(v.Equals(ElectricResistance.FromOhms(1), OhmsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricResistance.Zero, OhmsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs index af17382b28..e3f152c82d 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => ohmmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricResistivity a = ElectricResistivity.FromOhmMeters(1); - ElectricResistivity b = ElectricResistivity.FromOhmMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricResistivity v = ElectricResistivity.FromOhmMeters(1); - Assert.True(v.Equals(ElectricResistivity.FromOhmMeters(1), ElectricResistivity.FromOhmMeters(OhmMetersTolerance))); - Assert.False(v.Equals(ElectricResistivity.Zero, ElectricResistivity.FromOhmMeters(OhmMetersTolerance))); + Assert.True(v.Equals(ElectricResistivity.FromOhmMeters(1), OhmMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricResistivity.Zero, OhmMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs index 9b33409387..185cb209b8 100644 --- a/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs @@ -359,28 +359,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joule.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Energy a = Energy.FromJoules(1); - Energy b = Energy.FromJoules(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Energy v = Energy.FromJoules(1); - Assert.True(v.Equals(Energy.FromJoules(1), Energy.FromJoules(JoulesTolerance))); - Assert.False(v.Equals(Energy.Zero, Energy.FromJoules(JoulesTolerance))); + Assert.True(v.Equals(Energy.FromJoules(1), JoulesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Energy.Zero, JoulesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs index 0e56dca59c..9be160a987 100644 --- a/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs @@ -209,28 +209,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => jouleperkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Entropy a = Entropy.FromJoulesPerKelvin(1); - Entropy b = Entropy.FromJoulesPerKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Entropy v = Entropy.FromJoulesPerKelvin(1); - Assert.True(v.Equals(Entropy.FromJoulesPerKelvin(1), Entropy.FromJoulesPerKelvin(JoulesPerKelvinTolerance))); - Assert.False(v.Equals(Entropy.Zero, Entropy.FromJoulesPerKelvin(JoulesPerKelvinTolerance))); + Assert.True(v.Equals(Entropy.FromJoulesPerKelvin(1), JoulesPerKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Entropy.Zero, JoulesPerKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs index 3b2b44ce5e..aa810042a6 100644 --- a/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs @@ -379,28 +379,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Flow a = Flow.FromCubicMetersPerSecond(1); - Flow b = Flow.FromCubicMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Flow v = Flow.FromCubicMetersPerSecond(1); - Assert.True(v.Equals(Flow.FromCubicMetersPerSecond(1), Flow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); - Assert.False(v.Equals(Flow.Zero, Flow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); + Assert.True(v.Equals(Flow.FromCubicMetersPerSecond(1), CubicMetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Flow.Zero, CubicMetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs index c7cc526d7e..71a10c50cd 100644 --- a/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs @@ -249,28 +249,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ForceChangeRate a = ForceChangeRate.FromNewtonsPerSecond(1); - ForceChangeRate b = ForceChangeRate.FromNewtonsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ForceChangeRate v = ForceChangeRate.FromNewtonsPerSecond(1); - Assert.True(v.Equals(ForceChangeRate.FromNewtonsPerSecond(1), ForceChangeRate.FromNewtonsPerSecond(NewtonsPerSecondTolerance))); - Assert.False(v.Equals(ForceChangeRate.Zero, ForceChangeRate.FromNewtonsPerSecond(NewtonsPerSecondTolerance))); + Assert.True(v.Equals(ForceChangeRate.FromNewtonsPerSecond(1), NewtonsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ForceChangeRate.Zero, NewtonsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs index df43843b85..475ba70f58 100644 --- a/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs @@ -229,28 +229,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ForcePerLength a = ForcePerLength.FromNewtonsPerMeter(1); - ForcePerLength b = ForcePerLength.FromNewtonsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ForcePerLength v = ForcePerLength.FromNewtonsPerMeter(1); - Assert.True(v.Equals(ForcePerLength.FromNewtonsPerMeter(1), ForcePerLength.FromNewtonsPerMeter(NewtonsPerMeterTolerance))); - Assert.False(v.Equals(ForcePerLength.Zero, ForcePerLength.FromNewtonsPerMeter(NewtonsPerMeterTolerance))); + Assert.True(v.Equals(ForcePerLength.FromNewtonsPerMeter(1), NewtonsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ForcePerLength.Zero, NewtonsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs index 72f36a6078..675e78b0aa 100644 --- a/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs @@ -239,28 +239,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newton.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Force a = Force.FromNewtons(1); - Force b = Force.FromNewtons(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Force v = Force.FromNewtons(1); - Assert.True(v.Equals(Force.FromNewtons(1), Force.FromNewtons(NewtonsTolerance))); - Assert.False(v.Equals(Force.Zero, Force.FromNewtons(NewtonsTolerance))); + Assert.True(v.Equals(Force.FromNewtons(1), NewtonsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Force.Zero, NewtonsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs index 095f12058a..57829de236 100644 --- a/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => hertz.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Frequency a = Frequency.FromHertz(1); - Frequency b = Frequency.FromHertz(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Frequency v = Frequency.FromHertz(1); - Assert.True(v.Equals(Frequency.FromHertz(1), Frequency.FromHertz(HertzTolerance))); - Assert.False(v.Equals(Frequency.Zero, Frequency.FromHertz(HertzTolerance))); + Assert.True(v.Equals(Frequency.FromHertz(1), HertzTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Frequency.Zero, HertzTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs index f704b9faff..745ab078d4 100644 --- a/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs @@ -299,28 +299,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - HeatFlux a = HeatFlux.FromWattsPerSquareMeter(1); - HeatFlux b = HeatFlux.FromWattsPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { HeatFlux v = HeatFlux.FromWattsPerSquareMeter(1); - Assert.True(v.Equals(HeatFlux.FromWattsPerSquareMeter(1), HeatFlux.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); - Assert.False(v.Equals(HeatFlux.Zero, HeatFlux.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); + Assert.True(v.Equals(HeatFlux.FromWattsPerSquareMeter(1), WattsPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(HeatFlux.Zero, WattsPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs index 38c513a17a..fbb8dfae1a 100644 --- a/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpersquaremeterkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - HeatTransferCoefficient a = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); - HeatTransferCoefficient b = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { HeatTransferCoefficient v = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); - Assert.True(v.Equals(HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1), HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(WattsPerSquareMeterKelvinTolerance))); - Assert.False(v.Equals(HeatTransferCoefficient.Zero, HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(WattsPerSquareMeterKelvinTolerance))); + Assert.True(v.Equals(HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1), WattsPerSquareMeterKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(HeatTransferCoefficient.Zero, WattsPerSquareMeterKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs index 19d2830557..bb41e712c1 100644 --- a/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => lux.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Illuminance a = Illuminance.FromLux(1); - Illuminance b = Illuminance.FromLux(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Illuminance v = Illuminance.FromLux(1); - Assert.True(v.Equals(Illuminance.FromLux(1), Illuminance.FromLux(LuxTolerance))); - Assert.False(v.Equals(Illuminance.Zero, Illuminance.FromLux(LuxTolerance))); + Assert.True(v.Equals(Illuminance.FromLux(1), LuxTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Illuminance.Zero, LuxTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs index 635c68699f..9838aae21a 100644 --- a/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => bit.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Information a = Information.FromBits(1); - Information b = Information.FromBits(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Information v = Information.FromBits(1); - Assert.True(v.Equals(Information.FromBits(1), Information.FromBits(BitsTolerance))); - Assert.False(v.Equals(Information.Zero, Information.FromBits(BitsTolerance))); + Assert.True(v.Equals(Information.FromBits(1), BitsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Information.Zero, BitsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs index 2fef8007e2..abafe1662d 100644 --- a/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Irradiance a = Irradiance.FromWattsPerSquareMeter(1); - Irradiance b = Irradiance.FromWattsPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Irradiance v = Irradiance.FromWattsPerSquareMeter(1); - Assert.True(v.Equals(Irradiance.FromWattsPerSquareMeter(1), Irradiance.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); - Assert.False(v.Equals(Irradiance.Zero, Irradiance.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); + Assert.True(v.Equals(Irradiance.FromWattsPerSquareMeter(1), WattsPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Irradiance.Zero, WattsPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs index f77c29779f..9beaf2316b 100644 --- a/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joulepersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Irradiation a = Irradiation.FromJoulesPerSquareMeter(1); - Irradiation b = Irradiation.FromJoulesPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Irradiation v = Irradiation.FromJoulesPerSquareMeter(1); - Assert.True(v.Equals(Irradiation.FromJoulesPerSquareMeter(1), Irradiation.FromJoulesPerSquareMeter(JoulesPerSquareMeterTolerance))); - Assert.False(v.Equals(Irradiation.Zero, Irradiation.FromJoulesPerSquareMeter(JoulesPerSquareMeterTolerance))); + Assert.True(v.Equals(Irradiation.FromJoulesPerSquareMeter(1), JoulesPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Irradiation.Zero, JoulesPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs index 1182770b7b..8658aff7ea 100644 --- a/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => squaremeterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - KinematicViscosity a = KinematicViscosity.FromSquareMetersPerSecond(1); - KinematicViscosity b = KinematicViscosity.FromSquareMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { KinematicViscosity v = KinematicViscosity.FromSquareMetersPerSecond(1); - Assert.True(v.Equals(KinematicViscosity.FromSquareMetersPerSecond(1), KinematicViscosity.FromSquareMetersPerSecond(SquareMetersPerSecondTolerance))); - Assert.False(v.Equals(KinematicViscosity.Zero, KinematicViscosity.FromSquareMetersPerSecond(SquareMetersPerSecondTolerance))); + Assert.True(v.Equals(KinematicViscosity.FromSquareMetersPerSecond(1), SquareMetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(KinematicViscosity.Zero, SquareMetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs index 10c3f138ff..7d2fcf1f37 100644 --- a/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => degreecelsiusperkilometer.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LapseRate a = LapseRate.FromDegreesCelciusPerKilometer(1); - LapseRate b = LapseRate.FromDegreesCelciusPerKilometer(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LapseRate v = LapseRate.FromDegreesCelciusPerKilometer(1); - Assert.True(v.Equals(LapseRate.FromDegreesCelciusPerKilometer(1), LapseRate.FromDegreesCelciusPerKilometer(DegreesCelciusPerKilometerTolerance))); - Assert.False(v.Equals(LapseRate.Zero, LapseRate.FromDegreesCelciusPerKilometer(DegreesCelciusPerKilometerTolerance))); + Assert.True(v.Equals(LapseRate.FromDegreesCelciusPerKilometer(1), DegreesCelciusPerKilometerTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LapseRate.Zero, DegreesCelciusPerKilometerTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs index 6db53d0741..3b3e68c55a 100644 --- a/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs @@ -359,28 +359,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Length a = Length.FromMeters(1); - Length b = Length.FromMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Length v = Length.FromMeters(1); - Assert.True(v.Equals(Length.FromMeters(1), Length.FromMeters(MetersTolerance))); - Assert.False(v.Equals(Length.Zero, Length.FromMeters(MetersTolerance))); + Assert.True(v.Equals(Length.FromMeters(1), MetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Length.Zero, MetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs index 361a62038e..3bb2e29d6e 100644 --- a/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs @@ -164,28 +164,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibel.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Level a = Level.FromDecibels(1); - Level b = Level.FromDecibels(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Level v = Level.FromDecibels(1); - Assert.True(v.Equals(Level.FromDecibels(1), Level.FromDecibels(DecibelsTolerance))); - Assert.False(v.Equals(Level.Zero, Level.FromDecibels(DecibelsTolerance))); + Assert.True(v.Equals(Level.FromDecibels(1), DecibelsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Level.Zero, DecibelsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs index 1efda1e3cc..f539cd5237 100644 --- a/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LinearDensity a = LinearDensity.FromKilogramsPerMeter(1); - LinearDensity b = LinearDensity.FromKilogramsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LinearDensity v = LinearDensity.FromKilogramsPerMeter(1); - Assert.True(v.Equals(LinearDensity.FromKilogramsPerMeter(1), LinearDensity.FromKilogramsPerMeter(KilogramsPerMeterTolerance))); - Assert.False(v.Equals(LinearDensity.Zero, LinearDensity.FromKilogramsPerMeter(KilogramsPerMeterTolerance))); + Assert.True(v.Equals(LinearDensity.FromKilogramsPerMeter(1), KilogramsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LinearDensity.Zero, KilogramsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs index acc5cbb383..1d8377c939 100644 --- a/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => lumen.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LuminousFlux a = LuminousFlux.FromLumens(1); - LuminousFlux b = LuminousFlux.FromLumens(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LuminousFlux v = LuminousFlux.FromLumens(1); - Assert.True(v.Equals(LuminousFlux.FromLumens(1), LuminousFlux.FromLumens(LumensTolerance))); - Assert.False(v.Equals(LuminousFlux.Zero, LuminousFlux.FromLumens(LumensTolerance))); + Assert.True(v.Equals(LuminousFlux.FromLumens(1), LumensTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LuminousFlux.Zero, LumensTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs index 51855d73cc..43a3f8571f 100644 --- a/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => candela.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LuminousIntensity a = LuminousIntensity.FromCandela(1); - LuminousIntensity b = LuminousIntensity.FromCandela(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LuminousIntensity v = LuminousIntensity.FromCandela(1); - Assert.True(v.Equals(LuminousIntensity.FromCandela(1), LuminousIntensity.FromCandela(CandelaTolerance))); - Assert.False(v.Equals(LuminousIntensity.Zero, LuminousIntensity.FromCandela(CandelaTolerance))); + Assert.True(v.Equals(LuminousIntensity.FromCandela(1), CandelaTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LuminousIntensity.Zero, CandelaTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs index 2245cd6973..aa8c49db3f 100644 --- a/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => tesla.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MagneticField a = MagneticField.FromTeslas(1); - MagneticField b = MagneticField.FromTeslas(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MagneticField v = MagneticField.FromTeslas(1); - Assert.True(v.Equals(MagneticField.FromTeslas(1), MagneticField.FromTeslas(TeslasTolerance))); - Assert.False(v.Equals(MagneticField.Zero, MagneticField.FromTeslas(TeslasTolerance))); + Assert.True(v.Equals(MagneticField.FromTeslas(1), TeslasTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MagneticField.Zero, TeslasTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs index 9a67e75476..0324d949a3 100644 --- a/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => weber.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MagneticFlux a = MagneticFlux.FromWebers(1); - MagneticFlux b = MagneticFlux.FromWebers(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MagneticFlux v = MagneticFlux.FromWebers(1); - Assert.True(v.Equals(MagneticFlux.FromWebers(1), MagneticFlux.FromWebers(WebersTolerance))); - Assert.False(v.Equals(MagneticFlux.Zero, MagneticFlux.FromWebers(WebersTolerance))); + Assert.True(v.Equals(MagneticFlux.FromWebers(1), WebersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MagneticFlux.Zero, WebersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs index 7e3f1aeae2..9d0205fa94 100644 --- a/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => amperepermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Magnetization a = Magnetization.FromAmperesPerMeter(1); - Magnetization b = Magnetization.FromAmperesPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Magnetization v = Magnetization.FromAmperesPerMeter(1); - Assert.True(v.Equals(Magnetization.FromAmperesPerMeter(1), Magnetization.FromAmperesPerMeter(AmperesPerMeterTolerance))); - Assert.False(v.Equals(Magnetization.Zero, Magnetization.FromAmperesPerMeter(AmperesPerMeterTolerance))); + Assert.True(v.Equals(Magnetization.FromAmperesPerMeter(1), AmperesPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Magnetization.Zero, AmperesPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs index 8f6aa826ea..9fd4c1d834 100644 --- a/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs @@ -289,28 +289,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => grampersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MassFlow a = MassFlow.FromGramsPerSecond(1); - MassFlow b = MassFlow.FromGramsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MassFlow v = MassFlow.FromGramsPerSecond(1); - Assert.True(v.Equals(MassFlow.FromGramsPerSecond(1), MassFlow.FromGramsPerSecond(GramsPerSecondTolerance))); - Assert.False(v.Equals(MassFlow.Zero, MassFlow.FromGramsPerSecond(GramsPerSecondTolerance))); + Assert.True(v.Equals(MassFlow.FromGramsPerSecond(1), GramsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MassFlow.Zero, GramsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs index d1a1e0acc2..d8edec8a0b 100644 --- a/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampersecondpersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MassFlux a = MassFlux.FromKilogramsPerSecondPerSquareMeter(1); - MassFlux b = MassFlux.FromKilogramsPerSecondPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MassFlux v = MassFlux.FromKilogramsPerSecondPerSquareMeter(1); - Assert.True(v.Equals(MassFlux.FromKilogramsPerSecondPerSquareMeter(1), MassFlux.FromKilogramsPerSecondPerSquareMeter(KilogramsPerSecondPerSquareMeterTolerance))); - Assert.False(v.Equals(MassFlux.Zero, MassFlux.FromKilogramsPerSecondPerSquareMeter(KilogramsPerSecondPerSquareMeterTolerance))); + Assert.True(v.Equals(MassFlux.FromKilogramsPerSecondPerSquareMeter(1), KilogramsPerSecondPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MassFlux.Zero, KilogramsPerSecondPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs index 33f518a927..ab3adee533 100644 --- a/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogramsquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MassMomentOfInertia a = MassMomentOfInertia.FromKilogramSquareMeters(1); - MassMomentOfInertia b = MassMomentOfInertia.FromKilogramSquareMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MassMomentOfInertia v = MassMomentOfInertia.FromKilogramSquareMeters(1); - Assert.True(v.Equals(MassMomentOfInertia.FromKilogramSquareMeters(1), MassMomentOfInertia.FromKilogramSquareMeters(KilogramSquareMetersTolerance))); - Assert.False(v.Equals(MassMomentOfInertia.Zero, MassMomentOfInertia.FromKilogramSquareMeters(KilogramSquareMetersTolerance))); + Assert.True(v.Equals(MassMomentOfInertia.FromKilogramSquareMeters(1), KilogramSquareMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MassMomentOfInertia.Zero, KilogramSquareMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs index 1e15593177..13586290ae 100644 --- a/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs @@ -349,28 +349,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogram.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Mass a = Mass.FromKilograms(1); - Mass b = Mass.FromKilograms(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Mass v = Mass.FromKilograms(1); - Assert.True(v.Equals(Mass.FromKilograms(1), Mass.FromKilograms(KilogramsTolerance))); - Assert.False(v.Equals(Mass.Zero, Mass.FromKilograms(KilogramsTolerance))); + Assert.True(v.Equals(Mass.FromKilograms(1), KilogramsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Mass.Zero, KilogramsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs index 920f219a95..d513b87f1d 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joulepermole.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MolarEnergy a = MolarEnergy.FromJoulesPerMole(1); - MolarEnergy b = MolarEnergy.FromJoulesPerMole(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MolarEnergy v = MolarEnergy.FromJoulesPerMole(1); - Assert.True(v.Equals(MolarEnergy.FromJoulesPerMole(1), MolarEnergy.FromJoulesPerMole(JoulesPerMoleTolerance))); - Assert.False(v.Equals(MolarEnergy.Zero, MolarEnergy.FromJoulesPerMole(JoulesPerMoleTolerance))); + Assert.True(v.Equals(MolarEnergy.FromJoulesPerMole(1), JoulesPerMoleTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MolarEnergy.Zero, JoulesPerMoleTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs index 7892dcd4e6..fc31da2b01 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joulepermolekelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MolarEntropy a = MolarEntropy.FromJoulesPerMoleKelvin(1); - MolarEntropy b = MolarEntropy.FromJoulesPerMoleKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MolarEntropy v = MolarEntropy.FromJoulesPerMoleKelvin(1); - Assert.True(v.Equals(MolarEntropy.FromJoulesPerMoleKelvin(1), MolarEntropy.FromJoulesPerMoleKelvin(JoulesPerMoleKelvinTolerance))); - Assert.False(v.Equals(MolarEntropy.Zero, MolarEntropy.FromJoulesPerMoleKelvin(JoulesPerMoleKelvinTolerance))); + Assert.True(v.Equals(MolarEntropy.FromJoulesPerMoleKelvin(1), JoulesPerMoleKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MolarEntropy.Zero, JoulesPerMoleKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs index 83f82c605b..fd8a848e71 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs @@ -259,28 +259,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampermole.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MolarMass a = MolarMass.FromKilogramsPerMole(1); - MolarMass b = MolarMass.FromKilogramsPerMole(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MolarMass v = MolarMass.FromKilogramsPerMole(1); - Assert.True(v.Equals(MolarMass.FromKilogramsPerMole(1), MolarMass.FromKilogramsPerMole(KilogramsPerMoleTolerance))); - Assert.False(v.Equals(MolarMass.Zero, MolarMass.FromKilogramsPerMole(KilogramsPerMoleTolerance))); + Assert.True(v.Equals(MolarMass.FromKilogramsPerMole(1), KilogramsPerMoleTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MolarMass.Zero, KilogramsPerMoleTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs index d918cebc4f..2d0bdd0d89 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => molespercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Molarity a = Molarity.FromMolesPerCubicMeter(1); - Molarity b = Molarity.FromMolesPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Molarity v = Molarity.FromMolesPerCubicMeter(1); - Assert.True(v.Equals(Molarity.FromMolesPerCubicMeter(1), Molarity.FromMolesPerCubicMeter(MolesPerCubicMeterTolerance))); - Assert.False(v.Equals(Molarity.Zero, Molarity.FromMolesPerCubicMeter(MolesPerCubicMeterTolerance))); + Assert.True(v.Equals(Molarity.FromMolesPerCubicMeter(1), MolesPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Molarity.Zero, MolesPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs index 0826bfbfdd..f307316701 100644 --- a/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => henrypermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Permeability a = Permeability.FromHenriesPerMeter(1); - Permeability b = Permeability.FromHenriesPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Permeability v = Permeability.FromHenriesPerMeter(1); - Assert.True(v.Equals(Permeability.FromHenriesPerMeter(1), Permeability.FromHenriesPerMeter(HenriesPerMeterTolerance))); - Assert.False(v.Equals(Permeability.Zero, Permeability.FromHenriesPerMeter(HenriesPerMeterTolerance))); + Assert.True(v.Equals(Permeability.FromHenriesPerMeter(1), HenriesPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Permeability.Zero, HenriesPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs index f3137f003a..2ab368854a 100644 --- a/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => faradpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Permittivity a = Permittivity.FromFaradsPerMeter(1); - Permittivity b = Permittivity.FromFaradsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Permittivity v = Permittivity.FromFaradsPerMeter(1); - Assert.True(v.Equals(Permittivity.FromFaradsPerMeter(1), Permittivity.FromFaradsPerMeter(FaradsPerMeterTolerance))); - Assert.False(v.Equals(Permittivity.Zero, Permittivity.FromFaradsPerMeter(FaradsPerMeterTolerance))); + Assert.True(v.Equals(Permittivity.FromFaradsPerMeter(1), FaradsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Permittivity.Zero, FaradsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs index 7ec8597875..8bc82409e1 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs @@ -579,28 +579,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - PowerDensity a = PowerDensity.FromWattsPerCubicMeter(1); - PowerDensity b = PowerDensity.FromWattsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { PowerDensity v = PowerDensity.FromWattsPerCubicMeter(1); - Assert.True(v.Equals(PowerDensity.FromWattsPerCubicMeter(1), PowerDensity.FromWattsPerCubicMeter(WattsPerCubicMeterTolerance))); - Assert.False(v.Equals(PowerDensity.Zero, PowerDensity.FromWattsPerCubicMeter(WattsPerCubicMeterTolerance))); + Assert.True(v.Equals(PowerDensity.FromWattsPerCubicMeter(1), WattsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(PowerDensity.Zero, WattsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs index 9ee129a240..998f067817 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs @@ -164,28 +164,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibelwatt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - PowerRatio a = PowerRatio.FromDecibelWatts(1); - PowerRatio b = PowerRatio.FromDecibelWatts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { PowerRatio v = PowerRatio.FromDecibelWatts(1); - Assert.True(v.Equals(PowerRatio.FromDecibelWatts(1), PowerRatio.FromDecibelWatts(DecibelWattsTolerance))); - Assert.False(v.Equals(PowerRatio.Zero, PowerRatio.FromDecibelWatts(DecibelWattsTolerance))); + Assert.True(v.Equals(PowerRatio.FromDecibelWatts(1), DecibelWattsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(PowerRatio.Zero, DecibelWattsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs index 894accc13a..965e63128c 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs @@ -339,28 +339,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => watt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Power a = Power.FromWatts(1); - Power b = Power.FromWatts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Power v = Power.FromWatts(1); - Assert.True(v.Equals(Power.FromWatts(1), Power.FromWatts(WattsTolerance))); - Assert.False(v.Equals(Power.Zero, Power.FromWatts(WattsTolerance))); + Assert.True(v.Equals(Power.FromWatts(1), WattsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Power.Zero, WattsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs index a682b11362..879d0f0cd0 100644 --- a/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => pascalpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - PressureChangeRate a = PressureChangeRate.FromPascalsPerSecond(1); - PressureChangeRate b = PressureChangeRate.FromPascalsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { PressureChangeRate v = PressureChangeRate.FromPascalsPerSecond(1); - Assert.True(v.Equals(PressureChangeRate.FromPascalsPerSecond(1), PressureChangeRate.FromPascalsPerSecond(PascalsPerSecondTolerance))); - Assert.False(v.Equals(PressureChangeRate.Zero, PressureChangeRate.FromPascalsPerSecond(PascalsPerSecondTolerance))); + Assert.True(v.Equals(PressureChangeRate.FromPascalsPerSecond(1), PascalsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(PressureChangeRate.Zero, PascalsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs index fad6f6b86e..900ee1ffe5 100644 --- a/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs @@ -519,28 +519,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => pascal.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Pressure a = Pressure.FromPascals(1); - Pressure b = Pressure.FromPascals(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Pressure v = Pressure.FromPascals(1); - Assert.True(v.Equals(Pressure.FromPascals(1), Pressure.FromPascals(PascalsTolerance))); - Assert.False(v.Equals(Pressure.Zero, Pressure.FromPascals(PascalsTolerance))); + Assert.True(v.Equals(Pressure.FromPascals(1), PascalsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Pressure.Zero, PascalsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs index 0b1e156e0d..2c2397753a 100644 --- a/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs @@ -199,28 +199,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decimalfraction.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Ratio a = Ratio.FromDecimalFractions(1); - Ratio b = Ratio.FromDecimalFractions(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Ratio v = Ratio.FromDecimalFractions(1); - Assert.True(v.Equals(Ratio.FromDecimalFractions(1), Ratio.FromDecimalFractions(DecimalFractionsTolerance))); - Assert.False(v.Equals(Ratio.Zero, Ratio.FromDecimalFractions(DecimalFractionsTolerance))); + Assert.True(v.Equals(Ratio.FromDecimalFractions(1), DecimalFractionsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Ratio.Zero, DecimalFractionsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs index d0deaa44aa..78212a0e1f 100644 --- a/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltamperereactivehour.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ReactiveEnergy a = ReactiveEnergy.FromVoltampereReactiveHours(1); - ReactiveEnergy b = ReactiveEnergy.FromVoltampereReactiveHours(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ReactiveEnergy v = ReactiveEnergy.FromVoltampereReactiveHours(1); - Assert.True(v.Equals(ReactiveEnergy.FromVoltampereReactiveHours(1), ReactiveEnergy.FromVoltampereReactiveHours(VoltampereReactiveHoursTolerance))); - Assert.False(v.Equals(ReactiveEnergy.Zero, ReactiveEnergy.FromVoltampereReactiveHours(VoltampereReactiveHoursTolerance))); + Assert.True(v.Equals(ReactiveEnergy.FromVoltampereReactiveHours(1), VoltampereReactiveHoursTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ReactiveEnergy.Zero, VoltampereReactiveHoursTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs index 627bdaa5d3..9b325f9183 100644 --- a/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltamperereactive.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ReactivePower a = ReactivePower.FromVoltamperesReactive(1); - ReactivePower b = ReactivePower.FromVoltamperesReactive(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ReactivePower v = ReactivePower.FromVoltamperesReactive(1); - Assert.True(v.Equals(ReactivePower.FromVoltamperesReactive(1), ReactivePower.FromVoltamperesReactive(VoltamperesReactiveTolerance))); - Assert.False(v.Equals(ReactivePower.Zero, ReactivePower.FromVoltamperesReactive(VoltamperesReactiveTolerance))); + Assert.True(v.Equals(ReactivePower.FromVoltamperesReactive(1), VoltamperesReactiveTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ReactivePower.Zero, VoltamperesReactiveTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs index c22d688973..3e23884d1c 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => radianpersecondsquared.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalAcceleration a = RotationalAcceleration.FromRadiansPerSecondSquared(1); - RotationalAcceleration b = RotationalAcceleration.FromRadiansPerSecondSquared(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalAcceleration v = RotationalAcceleration.FromRadiansPerSecondSquared(1); - Assert.True(v.Equals(RotationalAcceleration.FromRadiansPerSecondSquared(1), RotationalAcceleration.FromRadiansPerSecondSquared(RadiansPerSecondSquaredTolerance))); - Assert.False(v.Equals(RotationalAcceleration.Zero, RotationalAcceleration.FromRadiansPerSecondSquared(RadiansPerSecondSquaredTolerance))); + Assert.True(v.Equals(RotationalAcceleration.FromRadiansPerSecondSquared(1), RadiansPerSecondSquaredTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalAcceleration.Zero, RadiansPerSecondSquaredTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs index 3ad5a6df0d..c031eebfde 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs @@ -269,28 +269,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => radianpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalSpeed a = RotationalSpeed.FromRadiansPerSecond(1); - RotationalSpeed b = RotationalSpeed.FromRadiansPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalSpeed v = RotationalSpeed.FromRadiansPerSecond(1); - Assert.True(v.Equals(RotationalSpeed.FromRadiansPerSecond(1), RotationalSpeed.FromRadiansPerSecond(RadiansPerSecondTolerance))); - Assert.False(v.Equals(RotationalSpeed.Zero, RotationalSpeed.FromRadiansPerSecond(RadiansPerSecondTolerance))); + Assert.True(v.Equals(RotationalSpeed.FromRadiansPerSecond(1), RadiansPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalSpeed.Zero, RadiansPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs index 333b1b1c5d..2d0dab215e 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonmeterperradianpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalStiffnessPerLength a = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1); - RotationalStiffnessPerLength b = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalStiffnessPerLength v = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1); - Assert.True(v.Equals(RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1), RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(NewtonMetersPerRadianPerMeterTolerance))); - Assert.False(v.Equals(RotationalStiffnessPerLength.Zero, RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(NewtonMetersPerRadianPerMeterTolerance))); + Assert.True(v.Equals(RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1), NewtonMetersPerRadianPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalStiffnessPerLength.Zero, NewtonMetersPerRadianPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs index 0dba2bc6c5..cf8e152fa6 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonmeterperradian.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalStiffness a = RotationalStiffness.FromNewtonMetersPerRadian(1); - RotationalStiffness b = RotationalStiffness.FromNewtonMetersPerRadian(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalStiffness v = RotationalStiffness.FromNewtonMetersPerRadian(1); - Assert.True(v.Equals(RotationalStiffness.FromNewtonMetersPerRadian(1), RotationalStiffness.FromNewtonMetersPerRadian(NewtonMetersPerRadianTolerance))); - Assert.False(v.Equals(RotationalStiffness.Zero, RotationalStiffness.FromNewtonMetersPerRadian(NewtonMetersPerRadianTolerance))); + Assert.True(v.Equals(RotationalStiffness.FromNewtonMetersPerRadian(1), NewtonMetersPerRadianTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalStiffness.Zero, NewtonMetersPerRadianTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs index 9a8ce58204..f673e26e4e 100644 --- a/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => steradian.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SolidAngle a = SolidAngle.FromSteradians(1); - SolidAngle b = SolidAngle.FromSteradians(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SolidAngle v = SolidAngle.FromSteradians(1); - Assert.True(v.Equals(SolidAngle.FromSteradians(1), SolidAngle.FromSteradians(SteradiansTolerance))); - Assert.False(v.Equals(SolidAngle.Zero, SolidAngle.FromSteradians(SteradiansTolerance))); + Assert.True(v.Equals(SolidAngle.FromSteradians(1), SteradiansTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SolidAngle.Zero, SteradiansTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs index 21f5e5a664..1072b5c4a3 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => jouleperkilogram.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificEnergy a = SpecificEnergy.FromJoulesPerKilogram(1); - SpecificEnergy b = SpecificEnergy.FromJoulesPerKilogram(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificEnergy v = SpecificEnergy.FromJoulesPerKilogram(1); - Assert.True(v.Equals(SpecificEnergy.FromJoulesPerKilogram(1), SpecificEnergy.FromJoulesPerKilogram(JoulesPerKilogramTolerance))); - Assert.False(v.Equals(SpecificEnergy.Zero, SpecificEnergy.FromJoulesPerKilogram(JoulesPerKilogramTolerance))); + Assert.True(v.Equals(SpecificEnergy.FromJoulesPerKilogram(1), JoulesPerKilogramTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificEnergy.Zero, JoulesPerKilogramTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs index 484e9ad12b..9c49f40558 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => jouleperkilogramkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificEntropy a = SpecificEntropy.FromJoulesPerKilogramKelvin(1); - SpecificEntropy b = SpecificEntropy.FromJoulesPerKilogramKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificEntropy v = SpecificEntropy.FromJoulesPerKilogramKelvin(1); - Assert.True(v.Equals(SpecificEntropy.FromJoulesPerKilogramKelvin(1), SpecificEntropy.FromJoulesPerKilogramKelvin(JoulesPerKilogramKelvinTolerance))); - Assert.False(v.Equals(SpecificEntropy.Zero, SpecificEntropy.FromJoulesPerKilogramKelvin(JoulesPerKilogramKelvinTolerance))); + Assert.True(v.Equals(SpecificEntropy.FromJoulesPerKilogramKelvin(1), JoulesPerKilogramKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificEntropy.Zero, JoulesPerKilogramKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs index 8ad46ec812..8a91d36863 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeterperkilogram.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificVolume a = SpecificVolume.FromCubicMetersPerKilogram(1); - SpecificVolume b = SpecificVolume.FromCubicMetersPerKilogram(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificVolume v = SpecificVolume.FromCubicMetersPerKilogram(1); - Assert.True(v.Equals(SpecificVolume.FromCubicMetersPerKilogram(1), SpecificVolume.FromCubicMetersPerKilogram(CubicMetersPerKilogramTolerance))); - Assert.False(v.Equals(SpecificVolume.Zero, SpecificVolume.FromCubicMetersPerKilogram(CubicMetersPerKilogramTolerance))); + Assert.True(v.Equals(SpecificVolume.FromCubicMetersPerKilogram(1), CubicMetersPerKilogramTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificVolume.Zero, CubicMetersPerKilogramTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs index 6ce9860bf4..6221a093a1 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs @@ -309,28 +309,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonpercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificWeight a = SpecificWeight.FromNewtonsPerCubicMeter(1); - SpecificWeight b = SpecificWeight.FromNewtonsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificWeight v = SpecificWeight.FromNewtonsPerCubicMeter(1); - Assert.True(v.Equals(SpecificWeight.FromNewtonsPerCubicMeter(1), SpecificWeight.FromNewtonsPerCubicMeter(NewtonsPerCubicMeterTolerance))); - Assert.False(v.Equals(SpecificWeight.Zero, SpecificWeight.FromNewtonsPerCubicMeter(NewtonsPerCubicMeterTolerance))); + Assert.True(v.Equals(SpecificWeight.FromNewtonsPerCubicMeter(1), NewtonsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificWeight.Zero, NewtonsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs index 44c1e91ab3..b26aec893d 100644 --- a/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs @@ -459,28 +459,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Speed a = Speed.FromMetersPerSecond(1); - Speed b = Speed.FromMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Speed v = Speed.FromMetersPerSecond(1); - Assert.True(v.Equals(Speed.FromMetersPerSecond(1), Speed.FromMetersPerSecond(MetersPerSecondTolerance))); - Assert.False(v.Equals(Speed.Zero, Speed.FromMetersPerSecond(MetersPerSecondTolerance))); + Assert.True(v.Equals(Speed.FromMetersPerSecond(1), MetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Speed.Zero, MetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs index a5d3503dc7..7d5d3aea7f 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs @@ -239,28 +239,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => degreecelsiuspersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - TemperatureChangeRate a = TemperatureChangeRate.FromDegreesCelsiusPerSecond(1); - TemperatureChangeRate b = TemperatureChangeRate.FromDegreesCelsiusPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { TemperatureChangeRate v = TemperatureChangeRate.FromDegreesCelsiusPerSecond(1); - Assert.True(v.Equals(TemperatureChangeRate.FromDegreesCelsiusPerSecond(1), TemperatureChangeRate.FromDegreesCelsiusPerSecond(DegreesCelsiusPerSecondTolerance))); - Assert.False(v.Equals(TemperatureChangeRate.Zero, TemperatureChangeRate.FromDegreesCelsiusPerSecond(DegreesCelsiusPerSecondTolerance))); + Assert.True(v.Equals(TemperatureChangeRate.FromDegreesCelsiusPerSecond(1), DegreesCelsiusPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(TemperatureChangeRate.Zero, DegreesCelsiusPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs index 3fd5e0a093..7e856964cf 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs @@ -299,28 +299,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - TemperatureDelta a = TemperatureDelta.FromKelvins(1); - TemperatureDelta b = TemperatureDelta.FromKelvins(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { TemperatureDelta v = TemperatureDelta.FromKelvins(1); - Assert.True(v.Equals(TemperatureDelta.FromKelvins(1), TemperatureDelta.FromKelvins(KelvinsTolerance))); - Assert.False(v.Equals(TemperatureDelta.Zero, TemperatureDelta.FromKelvins(KelvinsTolerance))); + Assert.True(v.Equals(TemperatureDelta.FromKelvins(1), KelvinsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(TemperatureDelta.Zero, KelvinsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs index e855ea235c..43f99b4864 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs @@ -207,28 +207,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Temperature a = Temperature.FromKelvins(1); - Temperature b = Temperature.FromKelvins(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Temperature v = Temperature.FromKelvins(1); - Assert.True(v.Equals(Temperature.FromKelvins(1), Temperature.FromKelvins(KelvinsTolerance))); - Assert.False(v.Equals(Temperature.Zero, Temperature.FromKelvins(KelvinsTolerance))); + Assert.True(v.Equals(Temperature.FromKelvins(1), KelvinsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Temperature.Zero, KelvinsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs index 0f59b697b8..8c8c4384b2 100644 --- a/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpermeterkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ThermalConductivity a = ThermalConductivity.FromWattsPerMeterKelvin(1); - ThermalConductivity b = ThermalConductivity.FromWattsPerMeterKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ThermalConductivity v = ThermalConductivity.FromWattsPerMeterKelvin(1); - Assert.True(v.Equals(ThermalConductivity.FromWattsPerMeterKelvin(1), ThermalConductivity.FromWattsPerMeterKelvin(WattsPerMeterKelvinTolerance))); - Assert.False(v.Equals(ThermalConductivity.Zero, ThermalConductivity.FromWattsPerMeterKelvin(WattsPerMeterKelvinTolerance))); + Assert.True(v.Equals(ThermalConductivity.FromWattsPerMeterKelvin(1), WattsPerMeterKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ThermalConductivity.Zero, WattsPerMeterKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs index b2f1989ed0..5a7b6d6e70 100644 --- a/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => squaremeterkelvinperkilowatt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ThermalResistance a = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1); - ThermalResistance b = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ThermalResistance v = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1); - Assert.True(v.Equals(ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1), ThermalResistance.FromSquareMeterKelvinsPerKilowatt(SquareMeterKelvinsPerKilowattTolerance))); - Assert.False(v.Equals(ThermalResistance.Zero, ThermalResistance.FromSquareMeterKelvinsPerKilowatt(SquareMeterKelvinsPerKilowattTolerance))); + Assert.True(v.Equals(ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1), SquareMeterKelvinsPerKilowattTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ThermalResistance.Zero, SquareMeterKelvinsPerKilowattTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs index 908ec3f2f0..297647516e 100644 --- a/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs @@ -349,28 +349,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Torque a = Torque.FromNewtonMeters(1); - Torque b = Torque.FromNewtonMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Torque v = Torque.FromNewtonMeters(1); - Assert.True(v.Equals(Torque.FromNewtonMeters(1), Torque.FromNewtonMeters(NewtonMetersTolerance))); - Assert.False(v.Equals(Torque.Zero, Torque.FromNewtonMeters(NewtonMetersTolerance))); + Assert.True(v.Equals(Torque.FromNewtonMeters(1), NewtonMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Torque.Zero, NewtonMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs index 8d75f4a4cc..8d5d86f2e6 100644 --- a/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => internationalunit.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - VitaminA a = VitaminA.FromInternationalUnits(1); - VitaminA b = VitaminA.FromInternationalUnits(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { VitaminA v = VitaminA.FromInternationalUnits(1); - Assert.True(v.Equals(VitaminA.FromInternationalUnits(1), VitaminA.FromInternationalUnits(InternationalUnitsTolerance))); - Assert.False(v.Equals(VitaminA.Zero, VitaminA.FromInternationalUnits(InternationalUnitsTolerance))); + Assert.True(v.Equals(VitaminA.FromInternationalUnits(1), InternationalUnitsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(VitaminA.Zero, InternationalUnitsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs index 30cdffaf77..e7f4484e3f 100644 --- a/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - VolumeFlow a = VolumeFlow.FromCubicMetersPerSecond(1); - VolumeFlow b = VolumeFlow.FromCubicMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { VolumeFlow v = VolumeFlow.FromCubicMetersPerSecond(1); - Assert.True(v.Equals(VolumeFlow.FromCubicMetersPerSecond(1), VolumeFlow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); - Assert.False(v.Equals(VolumeFlow.Zero, VolumeFlow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); + Assert.True(v.Equals(VolumeFlow.FromCubicMetersPerSecond(1), CubicMetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(VolumeFlow.Zero, CubicMetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs index feecaf0831..561e1a70a0 100644 --- a/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs @@ -579,28 +579,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Volume a = Volume.FromCubicMeters(1); - Volume b = Volume.FromCubicMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Volume v = Volume.FromCubicMeters(1); - Assert.True(v.Equals(Volume.FromCubicMeters(1), Volume.FromCubicMeters(CubicMetersTolerance))); - Assert.False(v.Equals(Volume.Zero, Volume.FromCubicMeters(CubicMetersTolerance))); + Assert.True(v.Equals(Volume.FromCubicMeters(1), CubicMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Volume.Zero, CubicMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedQuantityCodeTests.cs b/UnitsNet.Tests/GeneratedQuantityCodeTests.cs index 501c0c5675..4f188897f4 100644 --- a/UnitsNet.Tests/GeneratedQuantityCodeTests.cs +++ b/UnitsNet.Tests/GeneratedQuantityCodeTests.cs @@ -18,14 +18,15 @@ public class QuantitiesWithDouble [Fact] public void LengthEquals_GivenMaxError_ReturnsTrueIfWithinError() { - Length smallError = Length.FromMeters(1e-5); - Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), Length.Zero), "Integer values have zero difference."); - Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), smallError), "Using a max difference value should not change that fact."); + var smallError = 1e-5; - Assert.False(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), Length.Zero), + Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), 0, ComparisonType.Relative), "Integer values have zero difference."); + Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), smallError, ComparisonType.Relative), "Using a max difference value should not change that fact."); + + Assert.False(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), 0, ComparisonType.Relative), "Example of floating precision arithmetic that produces slightly different results."); - Assert.True(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), smallError), "But the difference is very small"); + Assert.True(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), smallError, ComparisonType.Relative), "But the difference is very small"); } } } -} \ No newline at end of file +} diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index afe7bad3d2..8ff4509d11 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -266,20 +266,6 @@ public static string GetAbbreviation(AccelerationUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Acceleration left, Acceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Acceleration left, Acceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 61e24dca68..b3d268d9ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -275,20 +275,6 @@ public static string GetAbbreviation(AmountOfSubstanceUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AmountOfSubstance left, AmountOfSubstance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AmountOfSubstance left, AmountOfSubstance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 23c643afd5..ca79c35eeb 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -193,20 +193,6 @@ public static string GetAbbreviation(AmplitudeRatioUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AmplitudeRatio left, AmplitudeRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AmplitudeRatio left, AmplitudeRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index ca02498de4..26fa2a5282 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -275,20 +275,6 @@ public static string GetAbbreviation(AngleUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Angle left, Angle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Angle left, Angle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 05dfc23e9d..b74eb3e4c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(ApparentEnergyUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ApparentEnergy left, ApparentEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ApparentEnergy left, ApparentEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index aea8d678f7..86196917d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ApparentPowerUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ApparentPower left, ApparentPower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ApparentPower left, ApparentPower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 5235e24c0d..b20482542a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -266,20 +266,6 @@ public static string GetAbbreviation(AreaUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Area left, Area right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Area left, Area right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 842a74b281..159a5b6241 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(AreaDensityUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AreaDensity left, AreaDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AreaDensity left, AreaDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 76f090fc9d..e0aea1f48c 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -203,20 +203,6 @@ public static string GetAbbreviation(AreaMomentOfInertiaUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AreaMomentOfInertia left, AreaMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AreaMomentOfInertia left, AreaMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 222a886e70..d1c325eb33 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -383,18 +383,6 @@ public static string GetAbbreviation(BitRateUnit unit, [CanBeNull] IFormatProvid return left.Value > right.AsBaseNumericType(left.Unit); } - public static bool operator ==(BitRate left, BitRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - public static bool operator !=(BitRate left, BitRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 9de58b5023..c92b6de956 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(BrakeSpecificFuelConsumptionUnit unit, [Can return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 1a0f3a3dd9..592a0dc187 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(CapacitanceUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Capacitance left, Capacitance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Capacitance left, Capacitance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index adc1b74e5f..d7cfe1e654 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -491,20 +491,6 @@ public static string GetAbbreviation(DensityUnit unit, [CanBeNull] IFormatProvid return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Density left, Density right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Density left, Density right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 351f373794..e70f240e05 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -257,20 +257,6 @@ public static string GetAbbreviation(DurationUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Duration left, Duration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Duration left, Duration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 40c15616e8..71ea9a2b70 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -203,20 +203,6 @@ public static string GetAbbreviation(DynamicViscosityUnit unit, [CanBeNull] IFor return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(DynamicViscosity left, DynamicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(DynamicViscosity left, DynamicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index d1814b926c..cc4f9f96f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ElectricAdmittanceUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricAdmittance left, ElectricAdmittance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricAdmittance left, ElectricAdmittance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index de311c02d2..79a455ea2b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricChargeUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCharge left, ElectricCharge right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCharge left, ElectricCharge right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index e5ac919058..8d9add2e54 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricChargeDensityUnit unit, [CanBeNull] return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricChargeDensity left, ElectricChargeDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricChargeDensity left, ElectricChargeDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index c8e5ee97db..af78377c84 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(ElectricConductanceUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricConductance left, ElectricConductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricConductance left, ElectricConductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d74de9be33..6500618905 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricConductivityUnit unit, [CanBeNull] return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricConductivity left, ElectricConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricConductivity left, ElectricConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 0f5858fe1b..4aceb2c5ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(ElectricCurrentUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCurrent left, ElectricCurrent right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCurrent left, ElectricCurrent right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 4ac621d58f..becc8ec8a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricCurrentDensityUnit unit, [CanBeNull return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCurrentDensity left, ElectricCurrentDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCurrentDensity left, ElectricCurrentDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 1bdea233a1..e3bc19a99c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricCurrentGradientUnit unit, [CanBeNul return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCurrentGradient left, ElectricCurrentGradient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCurrentGradient left, ElectricCurrentGradient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 5f7b4d55cd..39452e92ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricFieldUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricField left, ElectricField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricField left, ElectricField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 8b8e0060e5..79980fef27 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricInductanceUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricInductance left, ElectricInductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricInductance left, ElectricInductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index f9cebf55a4..9994c173c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ElectricPotentialUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricPotential left, ElectricPotential right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricPotential left, ElectricPotential right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index f3df5f0762..cb3dd8ab0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ElectricPotentialAcUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricPotentialAc left, ElectricPotentialAc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricPotentialAc left, ElectricPotentialAc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index ea6f85c7ae..9292794555 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ElectricPotentialDcUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricPotentialDc left, ElectricPotentialDc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricPotentialDc left, ElectricPotentialDc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index df944cce7a..a3ec5546fd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ElectricResistanceUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricResistance left, ElectricResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricResistance left, ElectricResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index e909be0ec1..32c54bfb66 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ElectricResistivityUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricResistivity left, ElectricResistivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricResistivity left, ElectricResistivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 0aab5ee9a9..77a86e561b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -347,20 +347,6 @@ public static string GetAbbreviation(EnergyUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Energy left, Energy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Energy left, Energy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 1e174a2486..cf8dbb9521 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -212,20 +212,6 @@ public static string GetAbbreviation(EntropyUnit unit, [CanBeNull] IFormatProvid return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Entropy left, Entropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Entropy left, Entropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs index 1530fa6888..3feb3a5a62 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs @@ -365,20 +365,6 @@ public static string GetAbbreviation(FlowUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Flow left, Flow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Flow left, Flow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index d741260a28..9ebb6099de 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -239,20 +239,6 @@ public static string GetAbbreviation(ForceUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Force left, Force right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Force left, Force right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 1c5ec27ce0..1830a881da 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -248,20 +248,6 @@ public static string GetAbbreviation(ForceChangeRateUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ForceChangeRate left, ForceChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ForceChangeRate left, ForceChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index a221b700b4..f725f96d81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -230,20 +230,6 @@ public static string GetAbbreviation(ForcePerLengthUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ForcePerLength left, ForcePerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ForcePerLength left, ForcePerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 649b2a2c52..871f03d11f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(FrequencyUnit unit, [CanBeNull] IFormatProv return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Frequency left, Frequency right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Frequency left, Frequency right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 3e1fdde1d7..f1c0910311 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -293,20 +293,6 @@ public static string GetAbbreviation(HeatFluxUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(HeatFlux left, HeatFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(HeatFlux left, HeatFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index cf0bf1e253..4acb91b185 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(HeatTransferCoefficientUnit unit, [CanBeNul return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(HeatTransferCoefficient left, HeatTransferCoefficient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(HeatTransferCoefficient left, HeatTransferCoefficient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 16e9931409..22a3ac2e3f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(IlluminanceUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Illuminance left, Illuminance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Illuminance left, Illuminance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index bf562afe24..f7c313d6f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -383,18 +383,6 @@ public static string GetAbbreviation(InformationUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - public static bool operator ==(Information left, Information right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - public static bool operator !=(Information left, Information right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 8a1ef1ab60..0c1c4e8f7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(IrradianceUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Irradiance left, Irradiance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Irradiance left, Irradiance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 486da8cd88..1c5a322dac 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(IrradiationUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Irradiation left, Irradiation right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Irradiation left, Irradiation right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index c9d49d1d19..7b0dd7d370 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(KinematicViscosityUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(KinematicViscosity left, KinematicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(KinematicViscosity left, KinematicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1cd3e7621f..5064f495a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(LapseRateUnit unit, [CanBeNull] IFormatProv return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LapseRate left, LapseRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LapseRate left, LapseRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index f15c49f2f5..35b75bd61b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -347,20 +347,6 @@ public static string GetAbbreviation(LengthUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Length left, Length right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Length left, Length right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 75bab150c4..17214b7202 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -175,20 +175,6 @@ public static string GetAbbreviation(LevelUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Level left, Level right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Level left, Level right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index b2c1100816..a5ce6de6f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(LinearDensityUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LinearDensity left, LinearDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LinearDensity left, LinearDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 778aabad6d..6f418ef2d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(LuminousFluxUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LuminousFlux left, LuminousFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LuminousFlux left, LuminousFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 56388d68d1..626e4293b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(LuminousIntensityUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LuminousIntensity left, LuminousIntensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LuminousIntensity left, LuminousIntensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 636e0610cb..c2c14df516 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(MagneticFieldUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MagneticField left, MagneticField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MagneticField left, MagneticField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index f3f3eefdb3..a390959ed0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(MagneticFluxUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MagneticFlux left, MagneticFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MagneticFlux left, MagneticFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 9ee47929f2..a66a45d478 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(MagnetizationUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Magnetization left, Magnetization right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Magnetization left, Magnetization right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index a2aff8b53e..0ffc4ce043 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -338,20 +338,6 @@ public static string GetAbbreviation(MassUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Mass left, Mass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Mass left, Mass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index e90181d29f..2e7158bdc1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -284,20 +284,6 @@ public static string GetAbbreviation(MassFlowUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MassFlow left, MassFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MassFlow left, MassFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index ff966c6ddb..708514cb02 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(MassFluxUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MassFlux left, MassFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MassFlux left, MassFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 009ea8b31d..c45d040c61 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -383,20 +383,6 @@ public static string GetAbbreviation(MassMomentOfInertiaUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MassMomentOfInertia left, MassMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MassMomentOfInertia left, MassMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 0eedd254a6..c471ecff0f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(MolarEnergyUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MolarEnergy left, MolarEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MolarEnergy left, MolarEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 854cf36bea..7c9a6617dc 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(MolarEntropyUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MolarEntropy left, MolarEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MolarEntropy left, MolarEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index a04598777e..791565bf01 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -257,20 +257,6 @@ public static string GetAbbreviation(MolarMassUnit unit, [CanBeNull] IFormatProv return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MolarMass left, MolarMass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MolarMass left, MolarMass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index c431a9a647..f8ba36dc26 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(MolarityUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Molarity left, Molarity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Molarity left, Molarity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index d767808955..1e5c230ea6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(PermeabilityUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Permeability left, Permeability right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Permeability left, Permeability right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 4891ceb3de..0a27fa02f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(PermittivityUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Permittivity left, Permittivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Permittivity left, Permittivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 9287d3cbb3..6d9af936d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -329,18 +329,6 @@ public static string GetAbbreviation(PowerUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - public static bool operator ==(Power left, Power right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - public static bool operator !=(Power left, Power right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index c1612bea8f..bee5470e28 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -545,20 +545,6 @@ public static string GetAbbreviation(PowerDensityUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(PowerDensity left, PowerDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(PowerDensity left, PowerDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index fb8b9b3639..1a3cbfe419 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -175,20 +175,6 @@ public static string GetAbbreviation(PowerRatioUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(PowerRatio left, PowerRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(PowerRatio left, PowerRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 251ae0bce2..246c0248d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -491,20 +491,6 @@ public static string GetAbbreviation(PressureUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Pressure left, Pressure right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Pressure left, Pressure right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index e9133a77a8..cd0a41f8a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(PressureChangeRateUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(PressureChangeRate left, PressureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(PressureChangeRate left, PressureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 993c2015d3..8862c5769f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -203,20 +203,6 @@ public static string GetAbbreviation(RatioUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Ratio left, Ratio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Ratio left, Ratio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 390183475b..e8207d067e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(ReactiveEnergyUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ReactiveEnergy left, ReactiveEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ReactiveEnergy left, ReactiveEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 086effb16a..160e450433 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ReactivePowerUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ReactivePower left, ReactivePower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ReactivePower left, ReactivePower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 16b0a47185..c1aac79709 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(RotationalAccelerationUnit unit, [CanBeNull return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalAcceleration left, RotationalAcceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalAcceleration left, RotationalAcceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index baf25cc9cf..d80bcd0c84 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -266,20 +266,6 @@ public static string GetAbbreviation(RotationalSpeedUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalSpeed left, RotationalSpeed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalSpeed left, RotationalSpeed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index db4b15e846..635fe64fdf 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(RotationalStiffnessUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalStiffness left, RotationalStiffness right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalStiffness left, RotationalStiffness right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 0a41d0fef4..3185bd92f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(RotationalStiffnessPerLengthUnit unit, [Can return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 802e37b63a..3c23ce20e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(SolidAngleUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SolidAngle left, SolidAngle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SolidAngle left, SolidAngle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 5d6fd503d4..88300d9590 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(SpecificEnergyUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificEnergy left, SpecificEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificEnergy left, SpecificEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index df6ff742b1..d20600f5ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(SpecificEntropyUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificEntropy left, SpecificEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificEntropy left, SpecificEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 1e06b97f10..695f5eaa54 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(SpecificVolumeUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificVolume left, SpecificVolume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificVolume left, SpecificVolume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 417b4170e6..e863c6c3b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -302,20 +302,6 @@ public static string GetAbbreviation(SpecificWeightUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificWeight left, SpecificWeight right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificWeight left, SpecificWeight right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index daf8ab45d8..f6aede04a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -437,20 +437,6 @@ public static string GetAbbreviation(SpeedUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Speed left, Speed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Speed left, Speed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 920828df1b..a368122031 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -182,20 +182,6 @@ public static string GetAbbreviation(TemperatureUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Temperature left, Temperature right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Temperature left, Temperature right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 87c254bb63..de51fe0be5 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -239,20 +239,6 @@ public static string GetAbbreviation(TemperatureChangeRateUnit unit, [CanBeNull] return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(TemperatureChangeRate left, TemperatureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(TemperatureChangeRate left, TemperatureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1a85aa86c7..03c02671a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -293,20 +293,6 @@ public static string GetAbbreviation(TemperatureDeltaUnit unit, [CanBeNull] IFor return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(TemperatureDelta left, TemperatureDelta right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(TemperatureDelta left, TemperatureDelta right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 9d4eb1d11e..78c5f00e09 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(ThermalConductivityUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ThermalConductivity left, ThermalConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ThermalConductivity left, ThermalConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 8924ea7ab4..8cd0081ba2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ThermalResistanceUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ThermalResistance left, ThermalResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ThermalResistance left, ThermalResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 3f03228011..ee7d3746d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -338,20 +338,6 @@ public static string GetAbbreviation(TorqueUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Torque left, Torque right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Torque left, Torque right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index b8ff7ad03b..eb5a2f0284 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(VitaminAUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(VitaminA left, VitaminA right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(VitaminA left, VitaminA right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 17ec35b34f..d310e85923 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -545,20 +545,6 @@ public static string GetAbbreviation(VolumeUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Volume left, Volume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Volume left, Volume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index c4f7944647..13211f2989 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -383,20 +383,6 @@ public static string GetAbbreviation(VolumeFlowUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(VolumeFlow left, VolumeFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(VolumeFlow left, VolumeFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 index a95f59ca75..c57ca8574c 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 @@ -315,15 +315,6 @@ if ($obsoleteAttribute) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - $($obsoleteEqualityIfDouble)public override bool Equals(object obj) - { - if(obj is null || !(obj is $quantityName)) - return false; - - var objQuantity = ($quantityName)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another $quantityName within the given absolute or relative tolerance. @@ -375,20 +366,6 @@ if ($obsoleteAttribute) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another $quantityName by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals($quantityName, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals($quantityName other, $quantityName maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 index 6baf780cb9..25a72ef097 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 @@ -209,18 +209,6 @@ namespace UnitsNet return left.Value > right.AsBaseNumericType(left.Unit); } - $($obsoleteEqualityIfDouble)public static bool operator ==($quantityName left, $quantityName right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - $($obsoleteEqualityIfDouble)public static bool operator !=($quantityName left, $quantityName right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 index 37e87d401d..a1ae92fc08 100644 --- a/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 @@ -198,28 +198,12 @@ namespace UnitsNet.Tests Assert.Throws(() => $baseUnitVariableName.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - $quantityName a = $quantityName.From$baseUnitPluralName(1); - $quantityName b = $quantityName.From$baseUnitPluralName(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { $quantityName v = $quantityName.From$baseUnitPluralName(1); - Assert.True(v.Equals($quantityName.From$baseUnitPluralName(1), $quantityName.From$baseUnitPluralName($($baseUnitPluralName)Tolerance))); - Assert.False(v.Equals($quantityName.Zero, $quantityName.From$baseUnitPluralName($($baseUnitPluralName)Tolerance))); + Assert.True(v.Equals($quantityName.From$baseUnitPluralName(1), $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); + Assert.False(v.Equals($quantityName.Zero, $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); } [Fact]