diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs index b9a6039db9..057401212f 100644 --- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs @@ -1162,32 +1162,11 @@ public override string ToString() return ToString(null, null); }} - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - {{ - return ToString(null, provider); - }} - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - {{ - return ToString(format, null); - }} - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) {{ return QuantityFormatter.Default.Format(this, format, provider); }} diff --git a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs index 9e4b57dd00..1f5ae99155 100644 --- a/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs +++ b/CodeGen/Generators/UnitsNetGen/UnitTestBaseClassGenerator.cs @@ -1045,7 +1045,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture foreach (var unit in _quantity.Units) { Writer.WL($@" - Assert.Equal(""1{GetEnglishAbbreviation(unit)}"", new {_quantity.Name}(1, {GetUnitFullName(unit)}).ToString(swedishCulture));"); + Assert.Equal(""1{GetEnglishAbbreviation(unit)}"", new {_quantity.Name}(1, {GetUnitFullName(unit)}).ToString(null, swedishCulture));"); } Writer.WL($@" }} diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index f658ed9d87..e9a225d30d 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -167,7 +167,7 @@ public void LengthTimesSpecificWeightEqualsPressure() public void ToStringReturnsCorrectNumberAndUnitWithDefaultUnitWhichIsMeter() { var meter = Length.FromMeters(5); - string meterString = meter.ToString(CultureInfo.InvariantCulture); + string meterString = meter.ToString(null, CultureInfo.InvariantCulture); Assert.Equal("5 m", meterString); } @@ -175,7 +175,7 @@ public void ToStringReturnsCorrectNumberAndUnitWithDefaultUnitWhichIsMeter() public void ToStringReturnsCorrectNumberAndUnitWithCentimeterAsDefaultUnit() { var value = Length.From(2, LengthUnit.Centimeter); - string valueString = value.ToString(CultureInfo.InvariantCulture); + string valueString = value.ToString(null, CultureInfo.InvariantCulture); Assert.Equal("2 cm", valueString); } diff --git a/UnitsNet.Tests/CustomQuantities/HowMuch.cs b/UnitsNet.Tests/CustomQuantities/HowMuch.cs index 40ed9752e6..6e5277dda4 100644 --- a/UnitsNet.Tests/CustomQuantities/HowMuch.cs +++ b/UnitsNet.Tests/CustomQuantities/HowMuch.cs @@ -69,7 +69,6 @@ public IQuantity ToUnit(Enum unit) public override string ToString() => $"{Value} {Unit}"; public string ToString(string? format, IFormatProvider? formatProvider) => $"HowMuch ({format}, {formatProvider})"; - public string ToString(IFormatProvider? provider) => $"HowMuch ({provider})"; #endregion } diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs index 7e984c3ebd..6c478ea92e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AbsorbedDoseOfIonizingRadiationTestsBase.g.cs @@ -1281,22 +1281,22 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Centigray).ToString(swedishCulture)); - Assert.Equal("1 fGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Femtogray).ToString(swedishCulture)); - Assert.Equal("1 GGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Gigagray).ToString(swedishCulture)); - Assert.Equal("1 Gy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Gray).ToString(swedishCulture)); - Assert.Equal("1 kGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Kilogray).ToString(swedishCulture)); - Assert.Equal("1 krad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Kilorad).ToString(swedishCulture)); - Assert.Equal("1 MGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Megagray).ToString(swedishCulture)); - Assert.Equal("1 Mrad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Megarad).ToString(swedishCulture)); - Assert.Equal("1 µGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Microgray).ToString(swedishCulture)); - Assert.Equal("1 mGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Milligray).ToString(swedishCulture)); - Assert.Equal("1 mrad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Millirad).ToString(swedishCulture)); - Assert.Equal("1 nGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Nanogray).ToString(swedishCulture)); - Assert.Equal("1 PGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Petagray).ToString(swedishCulture)); - Assert.Equal("1 pGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Picogray).ToString(swedishCulture)); - Assert.Equal("1 rad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Rad).ToString(swedishCulture)); - Assert.Equal("1 TGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Teragray).ToString(swedishCulture)); + Assert.Equal("1 cGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Centigray).ToString(null, swedishCulture)); + Assert.Equal("1 fGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Femtogray).ToString(null, swedishCulture)); + Assert.Equal("1 GGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Gigagray).ToString(null, swedishCulture)); + Assert.Equal("1 Gy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Gray).ToString(null, swedishCulture)); + Assert.Equal("1 kGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Kilogray).ToString(null, swedishCulture)); + Assert.Equal("1 krad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Kilorad).ToString(null, swedishCulture)); + Assert.Equal("1 MGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Megagray).ToString(null, swedishCulture)); + Assert.Equal("1 Mrad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Megarad).ToString(null, swedishCulture)); + Assert.Equal("1 µGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Microgray).ToString(null, swedishCulture)); + Assert.Equal("1 mGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Milligray).ToString(null, swedishCulture)); + Assert.Equal("1 mrad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Millirad).ToString(null, swedishCulture)); + Assert.Equal("1 nGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Nanogray).ToString(null, swedishCulture)); + Assert.Equal("1 PGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Petagray).ToString(null, swedishCulture)); + Assert.Equal("1 pGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Picogray).ToString(null, swedishCulture)); + Assert.Equal("1 rad", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Rad).ToString(null, swedishCulture)); + Assert.Equal("1 TGy", new AbsorbedDoseOfIonizingRadiation(1, AbsorbedDoseOfIonizingRadiationUnit.Teragray).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs index 71a8043327..503f53178c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AccelerationTestsBase.g.cs @@ -1253,20 +1253,20 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm/s²", new Acceleration(1, AccelerationUnit.CentimeterPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 dm/s²", new Acceleration(1, AccelerationUnit.DecimeterPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 ft/s²", new Acceleration(1, AccelerationUnit.FootPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 in/s²", new Acceleration(1, AccelerationUnit.InchPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 km/s²", new Acceleration(1, AccelerationUnit.KilometerPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 kn/h", new Acceleration(1, AccelerationUnit.KnotPerHour).ToString(swedishCulture)); - Assert.Equal("1 kn/min", new Acceleration(1, AccelerationUnit.KnotPerMinute).ToString(swedishCulture)); - Assert.Equal("1 kn/s", new Acceleration(1, AccelerationUnit.KnotPerSecond).ToString(swedishCulture)); - Assert.Equal("1 m/s²", new Acceleration(1, AccelerationUnit.MeterPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 µm/s²", new Acceleration(1, AccelerationUnit.MicrometerPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 mm/s²", new Acceleration(1, AccelerationUnit.MillimeterPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 mg", new Acceleration(1, AccelerationUnit.MillistandardGravity).ToString(swedishCulture)); - Assert.Equal("1 nm/s²", new Acceleration(1, AccelerationUnit.NanometerPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 g", new Acceleration(1, AccelerationUnit.StandardGravity).ToString(swedishCulture)); + Assert.Equal("1 cm/s²", new Acceleration(1, AccelerationUnit.CentimeterPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 dm/s²", new Acceleration(1, AccelerationUnit.DecimeterPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 ft/s²", new Acceleration(1, AccelerationUnit.FootPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 in/s²", new Acceleration(1, AccelerationUnit.InchPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 km/s²", new Acceleration(1, AccelerationUnit.KilometerPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 kn/h", new Acceleration(1, AccelerationUnit.KnotPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kn/min", new Acceleration(1, AccelerationUnit.KnotPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kn/s", new Acceleration(1, AccelerationUnit.KnotPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 m/s²", new Acceleration(1, AccelerationUnit.MeterPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 µm/s²", new Acceleration(1, AccelerationUnit.MicrometerPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 mm/s²", new Acceleration(1, AccelerationUnit.MillimeterPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 mg", new Acceleration(1, AccelerationUnit.MillistandardGravity).ToString(null, swedishCulture)); + Assert.Equal("1 nm/s²", new Acceleration(1, AccelerationUnit.NanometerPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 g", new Acceleration(1, AccelerationUnit.StandardGravity).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs index 00822f557e..fb5148357f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmountOfSubstanceTestsBase.g.cs @@ -1102,23 +1102,23 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Centimole).ToString(swedishCulture)); - Assert.Equal("1 clbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.CentipoundMole).ToString(swedishCulture)); - Assert.Equal("1 dmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Decimole).ToString(swedishCulture)); - Assert.Equal("1 dlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.DecipoundMole).ToString(swedishCulture)); - Assert.Equal("1 fmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Femtomole).ToString(swedishCulture)); - Assert.Equal("1 kmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Kilomole).ToString(swedishCulture)); - Assert.Equal("1 klbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.KilopoundMole).ToString(swedishCulture)); - Assert.Equal("1 Mmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Megamole).ToString(swedishCulture)); - Assert.Equal("1 µmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Micromole).ToString(swedishCulture)); - Assert.Equal("1 µlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.MicropoundMole).ToString(swedishCulture)); - Assert.Equal("1 mmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Millimole).ToString(swedishCulture)); - Assert.Equal("1 mlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.MillipoundMole).ToString(swedishCulture)); - Assert.Equal("1 mol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Mole).ToString(swedishCulture)); - Assert.Equal("1 nmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Nanomole).ToString(swedishCulture)); - Assert.Equal("1 nlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.NanopoundMole).ToString(swedishCulture)); - Assert.Equal("1 pmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Picomole).ToString(swedishCulture)); - Assert.Equal("1 lbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.PoundMole).ToString(swedishCulture)); + Assert.Equal("1 cmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Centimole).ToString(null, swedishCulture)); + Assert.Equal("1 clbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.CentipoundMole).ToString(null, swedishCulture)); + Assert.Equal("1 dmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Decimole).ToString(null, swedishCulture)); + Assert.Equal("1 dlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.DecipoundMole).ToString(null, swedishCulture)); + Assert.Equal("1 fmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Femtomole).ToString(null, swedishCulture)); + Assert.Equal("1 kmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Kilomole).ToString(null, swedishCulture)); + Assert.Equal("1 klbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.KilopoundMole).ToString(null, swedishCulture)); + Assert.Equal("1 Mmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Megamole).ToString(null, swedishCulture)); + Assert.Equal("1 µmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Micromole).ToString(null, swedishCulture)); + Assert.Equal("1 µlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.MicropoundMole).ToString(null, swedishCulture)); + Assert.Equal("1 mmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Millimole).ToString(null, swedishCulture)); + Assert.Equal("1 mlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.MillipoundMole).ToString(null, swedishCulture)); + Assert.Equal("1 mol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Mole).ToString(null, swedishCulture)); + Assert.Equal("1 nmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Nanomole).ToString(null, swedishCulture)); + Assert.Equal("1 nlbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.NanopoundMole).ToString(null, swedishCulture)); + Assert.Equal("1 pmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.Picomole).ToString(null, swedishCulture)); + Assert.Equal("1 lbmol", new AmountOfSubstance(1, AmountOfSubstanceUnit.PoundMole).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs index ae50044142..15fe33fbe8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AmplitudeRatioTestsBase.g.cs @@ -629,10 +629,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 dBµV", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelMicrovolt).ToString(swedishCulture)); - Assert.Equal("1 dBmV", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelMillivolt).ToString(swedishCulture)); - Assert.Equal("1 dBu", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelUnloaded).ToString(swedishCulture)); - Assert.Equal("1 dBV", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelVolt).ToString(swedishCulture)); + Assert.Equal("1 dBµV", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelMicrovolt).ToString(null, swedishCulture)); + Assert.Equal("1 dBmV", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelMillivolt).ToString(null, swedishCulture)); + Assert.Equal("1 dBu", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelUnloaded).ToString(null, swedishCulture)); + Assert.Equal("1 dBV", new AmplitudeRatio(1, AmplitudeRatioUnit.DecibelVolt).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs index 64de88c7b0..bd87b1121f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AngleTestsBase.g.cs @@ -1402,21 +1402,21 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 '", new Angle(1, AngleUnit.Arcminute).ToString(swedishCulture)); - Assert.Equal("1 ″", new Angle(1, AngleUnit.Arcsecond).ToString(swedishCulture)); - Assert.Equal("1 crad", new Angle(1, AngleUnit.Centiradian).ToString(swedishCulture)); - Assert.Equal("1 drad", new Angle(1, AngleUnit.Deciradian).ToString(swedishCulture)); - Assert.Equal("1 °", new Angle(1, AngleUnit.Degree).ToString(swedishCulture)); - Assert.Equal("1 g", new Angle(1, AngleUnit.Gradian).ToString(swedishCulture)); - Assert.Equal("1 µ°", new Angle(1, AngleUnit.Microdegree).ToString(swedishCulture)); - Assert.Equal("1 µrad", new Angle(1, AngleUnit.Microradian).ToString(swedishCulture)); - Assert.Equal("1 m°", new Angle(1, AngleUnit.Millidegree).ToString(swedishCulture)); - Assert.Equal("1 mrad", new Angle(1, AngleUnit.Milliradian).ToString(swedishCulture)); - Assert.Equal("1 n°", new Angle(1, AngleUnit.Nanodegree).ToString(swedishCulture)); - Assert.Equal("1 nrad", new Angle(1, AngleUnit.Nanoradian).ToString(swedishCulture)); - Assert.Equal("1 mil", new Angle(1, AngleUnit.NatoMil).ToString(swedishCulture)); - Assert.Equal("1 rad", new Angle(1, AngleUnit.Radian).ToString(swedishCulture)); - Assert.Equal("1 r", new Angle(1, AngleUnit.Revolution).ToString(swedishCulture)); + Assert.Equal("1 '", new Angle(1, AngleUnit.Arcminute).ToString(null, swedishCulture)); + Assert.Equal("1 ″", new Angle(1, AngleUnit.Arcsecond).ToString(null, swedishCulture)); + Assert.Equal("1 crad", new Angle(1, AngleUnit.Centiradian).ToString(null, swedishCulture)); + Assert.Equal("1 drad", new Angle(1, AngleUnit.Deciradian).ToString(null, swedishCulture)); + Assert.Equal("1 °", new Angle(1, AngleUnit.Degree).ToString(null, swedishCulture)); + Assert.Equal("1 g", new Angle(1, AngleUnit.Gradian).ToString(null, swedishCulture)); + Assert.Equal("1 µ°", new Angle(1, AngleUnit.Microdegree).ToString(null, swedishCulture)); + Assert.Equal("1 µrad", new Angle(1, AngleUnit.Microradian).ToString(null, swedishCulture)); + Assert.Equal("1 m°", new Angle(1, AngleUnit.Millidegree).ToString(null, swedishCulture)); + Assert.Equal("1 mrad", new Angle(1, AngleUnit.Milliradian).ToString(null, swedishCulture)); + Assert.Equal("1 n°", new Angle(1, AngleUnit.Nanodegree).ToString(null, swedishCulture)); + Assert.Equal("1 nrad", new Angle(1, AngleUnit.Nanoradian).ToString(null, swedishCulture)); + Assert.Equal("1 mil", new Angle(1, AngleUnit.NatoMil).ToString(null, swedishCulture)); + Assert.Equal("1 rad", new Angle(1, AngleUnit.Radian).ToString(null, swedishCulture)); + Assert.Equal("1 r", new Angle(1, AngleUnit.Revolution).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs index d98d7d9414..3cee5b8f24 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaDensityTestsBase.g.cs @@ -673,9 +673,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 g/m²", new AreaDensity(1, AreaDensityUnit.GramPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kg/m²", new AreaDensity(1, AreaDensityUnit.KilogramPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mg/m²", new AreaDensity(1, AreaDensityUnit.MilligramPerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 g/m²", new AreaDensity(1, AreaDensityUnit.GramPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/m²", new AreaDensity(1, AreaDensityUnit.KilogramPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/m²", new AreaDensity(1, AreaDensityUnit.MilligramPerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs index a0589f34c2..a8692d0c8e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaMomentOfInertiaTestsBase.g.cs @@ -751,12 +751,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.CentimeterToTheFourth).ToString(swedishCulture)); - Assert.Equal("1 dm⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.DecimeterToTheFourth).ToString(swedishCulture)); - Assert.Equal("1 ft⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.FootToTheFourth).ToString(swedishCulture)); - Assert.Equal("1 in⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.InchToTheFourth).ToString(swedishCulture)); - Assert.Equal("1 m⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.MeterToTheFourth).ToString(swedishCulture)); - Assert.Equal("1 mm⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.MillimeterToTheFourth).ToString(swedishCulture)); + Assert.Equal("1 cm⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.CentimeterToTheFourth).ToString(null, swedishCulture)); + Assert.Equal("1 dm⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.DecimeterToTheFourth).ToString(null, swedishCulture)); + Assert.Equal("1 ft⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.FootToTheFourth).ToString(null, swedishCulture)); + Assert.Equal("1 in⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.InchToTheFourth).ToString(null, swedishCulture)); + Assert.Equal("1 m⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.MeterToTheFourth).ToString(null, swedishCulture)); + Assert.Equal("1 mm⁴", new AreaMomentOfInertia(1, AreaMomentOfInertiaUnit.MillimeterToTheFourth).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs index 040e06fcac..b76d9ef730 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/AreaTestsBase.g.cs @@ -1468,20 +1468,20 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 ac", new Area(1, AreaUnit.Acre).ToString(swedishCulture)); - Assert.Equal("1 ha", new Area(1, AreaUnit.Hectare).ToString(swedishCulture)); - Assert.Equal("1 cm²", new Area(1, AreaUnit.SquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 dm²", new Area(1, AreaUnit.SquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 ft²", new Area(1, AreaUnit.SquareFoot).ToString(swedishCulture)); - Assert.Equal("1 in²", new Area(1, AreaUnit.SquareInch).ToString(swedishCulture)); - Assert.Equal("1 km²", new Area(1, AreaUnit.SquareKilometer).ToString(swedishCulture)); - Assert.Equal("1 m²", new Area(1, AreaUnit.SquareMeter).ToString(swedishCulture)); - Assert.Equal("1 µm²", new Area(1, AreaUnit.SquareMicrometer).ToString(swedishCulture)); - Assert.Equal("1 mi²", new Area(1, AreaUnit.SquareMile).ToString(swedishCulture)); - Assert.Equal("1 mm²", new Area(1, AreaUnit.SquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 nmi²", new Area(1, AreaUnit.SquareNauticalMile).ToString(swedishCulture)); - Assert.Equal("1 yd²", new Area(1, AreaUnit.SquareYard).ToString(swedishCulture)); - Assert.Equal("1 ft² (US)", new Area(1, AreaUnit.UsSurveySquareFoot).ToString(swedishCulture)); + Assert.Equal("1 ac", new Area(1, AreaUnit.Acre).ToString(null, swedishCulture)); + Assert.Equal("1 ha", new Area(1, AreaUnit.Hectare).ToString(null, swedishCulture)); + Assert.Equal("1 cm²", new Area(1, AreaUnit.SquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dm²", new Area(1, AreaUnit.SquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ft²", new Area(1, AreaUnit.SquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 in²", new Area(1, AreaUnit.SquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 km²", new Area(1, AreaUnit.SquareKilometer).ToString(null, swedishCulture)); + Assert.Equal("1 m²", new Area(1, AreaUnit.SquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µm²", new Area(1, AreaUnit.SquareMicrometer).ToString(null, swedishCulture)); + Assert.Equal("1 mi²", new Area(1, AreaUnit.SquareMile).ToString(null, swedishCulture)); + Assert.Equal("1 mm²", new Area(1, AreaUnit.SquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 nmi²", new Area(1, AreaUnit.SquareNauticalMile).ToString(null, swedishCulture)); + Assert.Equal("1 yd²", new Area(1, AreaUnit.SquareYard).ToString(null, swedishCulture)); + Assert.Equal("1 ft² (US)", new Area(1, AreaUnit.UsSurveySquareFoot).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs index 9063e7d0fa..1f7e896ebe 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BitRateTestsBase.g.cs @@ -2113,45 +2113,45 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 bit/s", new BitRate(1, BitRateUnit.BitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 B/s", new BitRate(1, BitRateUnit.BytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Ebit/s", new BitRate(1, BitRateUnit.ExabitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 EB/s", new BitRate(1, BitRateUnit.ExabytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Eo/s", new BitRate(1, BitRateUnit.ExaoctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Eibit/s", new BitRate(1, BitRateUnit.ExbibitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 EiB/s", new BitRate(1, BitRateUnit.ExbibytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Eio/s", new BitRate(1, BitRateUnit.ExbioctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Gibit/s", new BitRate(1, BitRateUnit.GibibitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 GiB/s", new BitRate(1, BitRateUnit.GibibytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Gio/s", new BitRate(1, BitRateUnit.GibioctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Gbit/s", new BitRate(1, BitRateUnit.GigabitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 GB/s", new BitRate(1, BitRateUnit.GigabytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Go/s", new BitRate(1, BitRateUnit.GigaoctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Kibit/s", new BitRate(1, BitRateUnit.KibibitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 KiB/s", new BitRate(1, BitRateUnit.KibibytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Kio/s", new BitRate(1, BitRateUnit.KibioctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kbit/s", new BitRate(1, BitRateUnit.KilobitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kB/s", new BitRate(1, BitRateUnit.KilobytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 ko/s", new BitRate(1, BitRateUnit.KilooctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mibit/s", new BitRate(1, BitRateUnit.MebibitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 MiB/s", new BitRate(1, BitRateUnit.MebibytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mio/s", new BitRate(1, BitRateUnit.MebioctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mbit/s", new BitRate(1, BitRateUnit.MegabitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 MB/s", new BitRate(1, BitRateUnit.MegabytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mo/s", new BitRate(1, BitRateUnit.MegaoctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 o/s", new BitRate(1, BitRateUnit.OctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Pibit/s", new BitRate(1, BitRateUnit.PebibitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 PiB/s", new BitRate(1, BitRateUnit.PebibytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Pio/s", new BitRate(1, BitRateUnit.PebioctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Pbit/s", new BitRate(1, BitRateUnit.PetabitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 PB/s", new BitRate(1, BitRateUnit.PetabytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Po/s", new BitRate(1, BitRateUnit.PetaoctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Tibit/s", new BitRate(1, BitRateUnit.TebibitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 TiB/s", new BitRate(1, BitRateUnit.TebibytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 Tio/s", new BitRate(1, BitRateUnit.TebioctetPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Tbit/s", new BitRate(1, BitRateUnit.TerabitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 TB/s", new BitRate(1, BitRateUnit.TerabytePerSecond).ToString(swedishCulture)); - Assert.Equal("1 To/s", new BitRate(1, BitRateUnit.TeraoctetPerSecond).ToString(swedishCulture)); + Assert.Equal("1 bit/s", new BitRate(1, BitRateUnit.BitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 B/s", new BitRate(1, BitRateUnit.BytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Ebit/s", new BitRate(1, BitRateUnit.ExabitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 EB/s", new BitRate(1, BitRateUnit.ExabytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Eo/s", new BitRate(1, BitRateUnit.ExaoctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Eibit/s", new BitRate(1, BitRateUnit.ExbibitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 EiB/s", new BitRate(1, BitRateUnit.ExbibytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Eio/s", new BitRate(1, BitRateUnit.ExbioctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Gibit/s", new BitRate(1, BitRateUnit.GibibitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 GiB/s", new BitRate(1, BitRateUnit.GibibytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Gio/s", new BitRate(1, BitRateUnit.GibioctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Gbit/s", new BitRate(1, BitRateUnit.GigabitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 GB/s", new BitRate(1, BitRateUnit.GigabytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Go/s", new BitRate(1, BitRateUnit.GigaoctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Kibit/s", new BitRate(1, BitRateUnit.KibibitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 KiB/s", new BitRate(1, BitRateUnit.KibibytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Kio/s", new BitRate(1, BitRateUnit.KibioctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kbit/s", new BitRate(1, BitRateUnit.KilobitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kB/s", new BitRate(1, BitRateUnit.KilobytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 ko/s", new BitRate(1, BitRateUnit.KilooctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mibit/s", new BitRate(1, BitRateUnit.MebibitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 MiB/s", new BitRate(1, BitRateUnit.MebibytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mio/s", new BitRate(1, BitRateUnit.MebioctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mbit/s", new BitRate(1, BitRateUnit.MegabitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 MB/s", new BitRate(1, BitRateUnit.MegabytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mo/s", new BitRate(1, BitRateUnit.MegaoctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 o/s", new BitRate(1, BitRateUnit.OctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Pibit/s", new BitRate(1, BitRateUnit.PebibitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 PiB/s", new BitRate(1, BitRateUnit.PebibytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Pio/s", new BitRate(1, BitRateUnit.PebioctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Pbit/s", new BitRate(1, BitRateUnit.PetabitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 PB/s", new BitRate(1, BitRateUnit.PetabytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Po/s", new BitRate(1, BitRateUnit.PetaoctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Tibit/s", new BitRate(1, BitRateUnit.TebibitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 TiB/s", new BitRate(1, BitRateUnit.TebibytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Tio/s", new BitRate(1, BitRateUnit.TebioctetPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Tbit/s", new BitRate(1, BitRateUnit.TerabitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 TB/s", new BitRate(1, BitRateUnit.TerabytePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 To/s", new BitRate(1, BitRateUnit.TeraoctetPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs index 2f766a9ec5..1b5dcafe15 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/BrakeSpecificFuelConsumptionTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 g/kWh", new BrakeSpecificFuelConsumption(1, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour).ToString(swedishCulture)); - Assert.Equal("1 kg/J", new BrakeSpecificFuelConsumption(1, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule).ToString(swedishCulture)); - Assert.Equal("1 lb/hph", new BrakeSpecificFuelConsumption(1, BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour).ToString(swedishCulture)); + Assert.Equal("1 g/kWh", new BrakeSpecificFuelConsumption(1, BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour).ToString(null, swedishCulture)); + Assert.Equal("1 kg/J", new BrakeSpecificFuelConsumption(1, BrakeSpecificFuelConsumptionUnit.KilogramPerJoule).ToString(null, swedishCulture)); + Assert.Equal("1 lb/hph", new BrakeSpecificFuelConsumption(1, BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs index 83b6a28a6c..fd08a791a3 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CoefficientOfThermalExpansionTestsBase.g.cs @@ -751,12 +751,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 °C⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 °F⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 K⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerKelvin).ToString(swedishCulture)); - Assert.Equal("1 ppm/°C", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 ppm/°F", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 ppm/K", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PpmPerKelvin).ToString(swedishCulture)); + Assert.Equal("1 °C⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 °F⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 K⁻¹", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PerKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 ppm/°C", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 ppm/°F", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 ppm/K", new CoefficientOfThermalExpansion(1, CoefficientOfThermalExpansionUnit.PpmPerKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs index 5421a37f7d..1436c594d7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/CompressibilityTestsBase.g.cs @@ -931,13 +931,13 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 atm⁻¹", new Compressibility(1, CompressibilityUnit.InverseAtmosphere).ToString(swedishCulture)); - Assert.Equal("1 bar⁻¹", new Compressibility(1, CompressibilityUnit.InverseBar).ToString(swedishCulture)); - Assert.Equal("1 kPa⁻¹", new Compressibility(1, CompressibilityUnit.InverseKilopascal).ToString(swedishCulture)); - Assert.Equal("1 MPa⁻¹", new Compressibility(1, CompressibilityUnit.InverseMegapascal).ToString(swedishCulture)); - Assert.Equal("1 mbar⁻¹", new Compressibility(1, CompressibilityUnit.InverseMillibar).ToString(swedishCulture)); - Assert.Equal("1 Pa⁻¹", new Compressibility(1, CompressibilityUnit.InversePascal).ToString(swedishCulture)); - Assert.Equal("1 psi⁻¹", new Compressibility(1, CompressibilityUnit.InversePoundForcePerSquareInch).ToString(swedishCulture)); + Assert.Equal("1 atm⁻¹", new Compressibility(1, CompressibilityUnit.InverseAtmosphere).ToString(null, swedishCulture)); + Assert.Equal("1 bar⁻¹", new Compressibility(1, CompressibilityUnit.InverseBar).ToString(null, swedishCulture)); + Assert.Equal("1 kPa⁻¹", new Compressibility(1, CompressibilityUnit.InverseKilopascal).ToString(null, swedishCulture)); + Assert.Equal("1 MPa⁻¹", new Compressibility(1, CompressibilityUnit.InverseMegapascal).ToString(null, swedishCulture)); + Assert.Equal("1 mbar⁻¹", new Compressibility(1, CompressibilityUnit.InverseMillibar).ToString(null, swedishCulture)); + Assert.Equal("1 Pa⁻¹", new Compressibility(1, CompressibilityUnit.InversePascal).ToString(null, swedishCulture)); + Assert.Equal("1 psi⁻¹", new Compressibility(1, CompressibilityUnit.InversePoundForcePerSquareInch).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs index b2abef6f0f..4f7eff7681 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DensityTestsBase.g.cs @@ -2595,62 +2595,62 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cg/dl", new Density(1, DensityUnit.CentigramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 cg/l", new Density(1, DensityUnit.CentigramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 cg/ml", new Density(1, DensityUnit.CentigramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 dg/dl", new Density(1, DensityUnit.DecigramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 dg/l", new Density(1, DensityUnit.DecigramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 dg/ml", new Density(1, DensityUnit.DecigramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 fg/dl", new Density(1, DensityUnit.FemtogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 fg/l", new Density(1, DensityUnit.FemtogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 fg/ml", new Density(1, DensityUnit.FemtogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 g/cm³", new Density(1, DensityUnit.GramPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 g/ft³", new Density(1, DensityUnit.GramPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 g/in³", new Density(1, DensityUnit.GramPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 g/m³", new Density(1, DensityUnit.GramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 g/mm³", new Density(1, DensityUnit.GramPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 g/dl", new Density(1, DensityUnit.GramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 g/l", new Density(1, DensityUnit.GramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 g/ml", new Density(1, DensityUnit.GramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 kg/cm³", new Density(1, DensityUnit.KilogramPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kg/m³", new Density(1, DensityUnit.KilogramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kg/mm³", new Density(1, DensityUnit.KilogramPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kg/l", new Density(1, DensityUnit.KilogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 kip/ft³", new Density(1, DensityUnit.KilopoundPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 kip/in³", new Density(1, DensityUnit.KilopoundPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 kip/yd³", new Density(1, DensityUnit.KilopoundPerCubicYard).ToString(swedishCulture)); - Assert.Equal("1 µg/m³", new Density(1, DensityUnit.MicrogramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 µg/dl", new Density(1, DensityUnit.MicrogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 µg/l", new Density(1, DensityUnit.MicrogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 µg/ml", new Density(1, DensityUnit.MicrogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 mg/m³", new Density(1, DensityUnit.MilligramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mg/dl", new Density(1, DensityUnit.MilligramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 mg/l", new Density(1, DensityUnit.MilligramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 mg/ml", new Density(1, DensityUnit.MilligramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 ng/dl", new Density(1, DensityUnit.NanogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 ng/l", new Density(1, DensityUnit.NanogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 ng/ml", new Density(1, DensityUnit.NanogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 pg/dl", new Density(1, DensityUnit.PicogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 pg/l", new Density(1, DensityUnit.PicogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 pg/ml", new Density(1, DensityUnit.PicogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 lb/cm³", new Density(1, DensityUnit.PoundPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 lb/ft³", new Density(1, DensityUnit.PoundPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 lb/in³", new Density(1, DensityUnit.PoundPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 lb/m³", new Density(1, DensityUnit.PoundPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 lb/mm³", new Density(1, DensityUnit.PoundPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 lb/yd³", new Density(1, DensityUnit.PoundPerCubicYard).ToString(swedishCulture)); - Assert.Equal("1 ppg (imp.)", new Density(1, DensityUnit.PoundPerImperialGallon).ToString(swedishCulture)); - Assert.Equal("1 ppg (U.S.)", new Density(1, DensityUnit.PoundPerUSGallon).ToString(swedishCulture)); - Assert.Equal("1 slug/cm³", new Density(1, DensityUnit.SlugPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 slug/ft³", new Density(1, DensityUnit.SlugPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 slug/in³", new Density(1, DensityUnit.SlugPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 slug/m³", new Density(1, DensityUnit.SlugPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 slug/mm³", new Density(1, DensityUnit.SlugPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 t/cm³", new Density(1, DensityUnit.TonnePerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 t/ft³", new Density(1, DensityUnit.TonnePerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 t/in³", new Density(1, DensityUnit.TonnePerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 t/m³", new Density(1, DensityUnit.TonnePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 t/mm³", new Density(1, DensityUnit.TonnePerCubicMillimeter).ToString(swedishCulture)); + Assert.Equal("1 cg/dl", new Density(1, DensityUnit.CentigramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 cg/l", new Density(1, DensityUnit.CentigramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 cg/ml", new Density(1, DensityUnit.CentigramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/dl", new Density(1, DensityUnit.DecigramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/l", new Density(1, DensityUnit.DecigramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/ml", new Density(1, DensityUnit.DecigramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 fg/dl", new Density(1, DensityUnit.FemtogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 fg/l", new Density(1, DensityUnit.FemtogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 fg/ml", new Density(1, DensityUnit.FemtogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 g/cm³", new Density(1, DensityUnit.GramPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/ft³", new Density(1, DensityUnit.GramPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 g/in³", new Density(1, DensityUnit.GramPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 g/m³", new Density(1, DensityUnit.GramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/mm³", new Density(1, DensityUnit.GramPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/dl", new Density(1, DensityUnit.GramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 g/l", new Density(1, DensityUnit.GramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 g/ml", new Density(1, DensityUnit.GramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/cm³", new Density(1, DensityUnit.KilogramPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/m³", new Density(1, DensityUnit.KilogramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/mm³", new Density(1, DensityUnit.KilogramPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/l", new Density(1, DensityUnit.KilogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 kip/ft³", new Density(1, DensityUnit.KilopoundPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kip/in³", new Density(1, DensityUnit.KilopoundPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 kip/yd³", new Density(1, DensityUnit.KilopoundPerCubicYard).ToString(null, swedishCulture)); + Assert.Equal("1 µg/m³", new Density(1, DensityUnit.MicrogramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/dl", new Density(1, DensityUnit.MicrogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/l", new Density(1, DensityUnit.MicrogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/ml", new Density(1, DensityUnit.MicrogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/m³", new Density(1, DensityUnit.MilligramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/dl", new Density(1, DensityUnit.MilligramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/l", new Density(1, DensityUnit.MilligramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/ml", new Density(1, DensityUnit.MilligramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/dl", new Density(1, DensityUnit.NanogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/l", new Density(1, DensityUnit.NanogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/ml", new Density(1, DensityUnit.NanogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 pg/dl", new Density(1, DensityUnit.PicogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 pg/l", new Density(1, DensityUnit.PicogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 pg/ml", new Density(1, DensityUnit.PicogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 lb/cm³", new Density(1, DensityUnit.PoundPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 lb/ft³", new Density(1, DensityUnit.PoundPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lb/in³", new Density(1, DensityUnit.PoundPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 lb/m³", new Density(1, DensityUnit.PoundPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 lb/mm³", new Density(1, DensityUnit.PoundPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 lb/yd³", new Density(1, DensityUnit.PoundPerCubicYard).ToString(null, swedishCulture)); + Assert.Equal("1 ppg (imp.)", new Density(1, DensityUnit.PoundPerImperialGallon).ToString(null, swedishCulture)); + Assert.Equal("1 ppg (U.S.)", new Density(1, DensityUnit.PoundPerUSGallon).ToString(null, swedishCulture)); + Assert.Equal("1 slug/cm³", new Density(1, DensityUnit.SlugPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 slug/ft³", new Density(1, DensityUnit.SlugPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 slug/in³", new Density(1, DensityUnit.SlugPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 slug/m³", new Density(1, DensityUnit.SlugPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 slug/mm³", new Density(1, DensityUnit.SlugPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 t/cm³", new Density(1, DensityUnit.TonnePerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 t/ft³", new Density(1, DensityUnit.TonnePerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 t/in³", new Density(1, DensityUnit.TonnePerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 t/m³", new Density(1, DensityUnit.TonnePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 t/mm³", new Density(1, DensityUnit.TonnePerCubicMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs index 4af2534b2f..34fc1d7f60 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DoseAreaProductTestsBase.g.cs @@ -1553,26 +1553,26 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 cGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 cGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareMeter).ToString(swedishCulture)); - Assert.Equal("1 cGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 dGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 dGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 dGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareMeter).ToString(swedishCulture)); - Assert.Equal("1 dGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 Gy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 Gy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 Gy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareMeter).ToString(swedishCulture)); - Assert.Equal("1 Gy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 µGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 µGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 µGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareMeter).ToString(swedishCulture)); - Assert.Equal("1 µGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 mGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 mGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareMillimeter).ToString(swedishCulture)); + Assert.Equal("1 cGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 cGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 cGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 cGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.CentigraySquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 dGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.DecigraySquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Gy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Gy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Gy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 Gy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.GraySquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.MicrograySquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mGy·cm²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mGy·dm²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mGy·m²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mGy·mm²", new DoseAreaProduct(1, DoseAreaProductUnit.MilligraySquareMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs index 0d995447c0..7d2c55732f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DurationTestsBase.g.cs @@ -1914,18 +1914,18 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 d", new Duration(1, DurationUnit.Day).ToString(swedishCulture)); - Assert.Equal("1 h", new Duration(1, DurationUnit.Hour).ToString(swedishCulture)); - Assert.Equal("1 jyr", new Duration(1, DurationUnit.JulianYear).ToString(swedishCulture)); - Assert.Equal("1 µs", new Duration(1, DurationUnit.Microsecond).ToString(swedishCulture)); - Assert.Equal("1 ms", new Duration(1, DurationUnit.Millisecond).ToString(swedishCulture)); - Assert.Equal("1 m", new Duration(1, DurationUnit.Minute).ToString(swedishCulture)); - Assert.Equal("1 mo", new Duration(1, DurationUnit.Month30).ToString(swedishCulture)); - Assert.Equal("1 ns", new Duration(1, DurationUnit.Nanosecond).ToString(swedishCulture)); - Assert.Equal("1 s", new Duration(1, DurationUnit.Second).ToString(swedishCulture)); - Assert.Equal("1 sol", new Duration(1, DurationUnit.Sol).ToString(swedishCulture)); - Assert.Equal("1 wk", new Duration(1, DurationUnit.Week).ToString(swedishCulture)); - Assert.Equal("1 yr", new Duration(1, DurationUnit.Year365).ToString(swedishCulture)); + Assert.Equal("1 d", new Duration(1, DurationUnit.Day).ToString(null, swedishCulture)); + Assert.Equal("1 h", new Duration(1, DurationUnit.Hour).ToString(null, swedishCulture)); + Assert.Equal("1 jyr", new Duration(1, DurationUnit.JulianYear).ToString(null, swedishCulture)); + Assert.Equal("1 µs", new Duration(1, DurationUnit.Microsecond).ToString(null, swedishCulture)); + Assert.Equal("1 ms", new Duration(1, DurationUnit.Millisecond).ToString(null, swedishCulture)); + Assert.Equal("1 m", new Duration(1, DurationUnit.Minute).ToString(null, swedishCulture)); + Assert.Equal("1 mo", new Duration(1, DurationUnit.Month30).ToString(null, swedishCulture)); + Assert.Equal("1 ns", new Duration(1, DurationUnit.Nanosecond).ToString(null, swedishCulture)); + Assert.Equal("1 s", new Duration(1, DurationUnit.Second).ToString(null, swedishCulture)); + Assert.Equal("1 sol", new Duration(1, DurationUnit.Sol).ToString(null, swedishCulture)); + Assert.Equal("1 wk", new Duration(1, DurationUnit.Week).ToString(null, swedishCulture)); + Assert.Equal("1 yr", new Duration(1, DurationUnit.Year365).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs index f4f9260cb7..a7b0cb18f2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/DynamicViscosityTestsBase.g.cs @@ -946,16 +946,16 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cP", new DynamicViscosity(1, DynamicViscosityUnit.Centipoise).ToString(swedishCulture)); - Assert.Equal("1 µPa·s", new DynamicViscosity(1, DynamicViscosityUnit.MicropascalSecond).ToString(swedishCulture)); - Assert.Equal("1 mPa·s", new DynamicViscosity(1, DynamicViscosityUnit.MillipascalSecond).ToString(swedishCulture)); - Assert.Equal("1 Ns/m²", new DynamicViscosity(1, DynamicViscosityUnit.NewtonSecondPerMeterSquared).ToString(swedishCulture)); - Assert.Equal("1 Pa·s", new DynamicViscosity(1, DynamicViscosityUnit.PascalSecond).ToString(swedishCulture)); - Assert.Equal("1 P", new DynamicViscosity(1, DynamicViscosityUnit.Poise).ToString(swedishCulture)); - Assert.Equal("1 lbf·s/ft²", new DynamicViscosity(1, DynamicViscosityUnit.PoundForceSecondPerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 lbf·s/in²", new DynamicViscosity(1, DynamicViscosityUnit.PoundForceSecondPerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 lb/(ft·s)", new DynamicViscosity(1, DynamicViscosityUnit.PoundPerFootSecond).ToString(swedishCulture)); - Assert.Equal("1 reyn", new DynamicViscosity(1, DynamicViscosityUnit.Reyn).ToString(swedishCulture)); + Assert.Equal("1 cP", new DynamicViscosity(1, DynamicViscosityUnit.Centipoise).ToString(null, swedishCulture)); + Assert.Equal("1 µPa·s", new DynamicViscosity(1, DynamicViscosityUnit.MicropascalSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mPa·s", new DynamicViscosity(1, DynamicViscosityUnit.MillipascalSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Ns/m²", new DynamicViscosity(1, DynamicViscosityUnit.NewtonSecondPerMeterSquared).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·s", new DynamicViscosity(1, DynamicViscosityUnit.PascalSecond).ToString(null, swedishCulture)); + Assert.Equal("1 P", new DynamicViscosity(1, DynamicViscosityUnit.Poise).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·s/ft²", new DynamicViscosity(1, DynamicViscosityUnit.PoundForceSecondPerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·s/in²", new DynamicViscosity(1, DynamicViscosityUnit.PoundForceSecondPerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 lb/(ft·s)", new DynamicViscosity(1, DynamicViscosityUnit.PoundPerFootSecond).ToString(null, swedishCulture)); + Assert.Equal("1 reyn", new DynamicViscosity(1, DynamicViscosityUnit.Reyn).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs index 930e787458..5d7455f3f1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs @@ -1057,22 +1057,22 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 G℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Gigamho).ToString(swedishCulture)); - Assert.Equal("1 GS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Gigasiemens).ToString(swedishCulture)); - Assert.Equal("1 k℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Kilomho).ToString(swedishCulture)); - Assert.Equal("1 kS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Kilosiemens).ToString(swedishCulture)); - Assert.Equal("1 M℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Megamho).ToString(swedishCulture)); - Assert.Equal("1 MS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Megasiemens).ToString(swedishCulture)); - Assert.Equal("1 ℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Mho).ToString(swedishCulture)); - Assert.Equal("1 µ℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Micromho).ToString(swedishCulture)); - Assert.Equal("1 µS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Microsiemens).ToString(swedishCulture)); - Assert.Equal("1 m℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Millimho).ToString(swedishCulture)); - Assert.Equal("1 mS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Millisiemens).ToString(swedishCulture)); - Assert.Equal("1 n℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Nanomho).ToString(swedishCulture)); - Assert.Equal("1 nS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Nanosiemens).ToString(swedishCulture)); - Assert.Equal("1 S", new ElectricAdmittance(1, ElectricAdmittanceUnit.Siemens).ToString(swedishCulture)); - Assert.Equal("1 T℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Teramho).ToString(swedishCulture)); - Assert.Equal("1 TS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Terasiemens).ToString(swedishCulture)); + Assert.Equal("1 G℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Gigamho).ToString(null, swedishCulture)); + Assert.Equal("1 GS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Gigasiemens).ToString(null, swedishCulture)); + Assert.Equal("1 k℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Kilomho).ToString(null, swedishCulture)); + Assert.Equal("1 kS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Kilosiemens).ToString(null, swedishCulture)); + Assert.Equal("1 M℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Megamho).ToString(null, swedishCulture)); + Assert.Equal("1 MS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Megasiemens).ToString(null, swedishCulture)); + Assert.Equal("1 ℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Mho).ToString(null, swedishCulture)); + Assert.Equal("1 µ℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Micromho).ToString(null, swedishCulture)); + Assert.Equal("1 µS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Microsiemens).ToString(null, swedishCulture)); + Assert.Equal("1 m℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Millimho).ToString(null, swedishCulture)); + Assert.Equal("1 mS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Millisiemens).ToString(null, swedishCulture)); + Assert.Equal("1 n℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Nanomho).ToString(null, swedishCulture)); + Assert.Equal("1 nS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Nanosiemens).ToString(null, swedishCulture)); + Assert.Equal("1 S", new ElectricAdmittance(1, ElectricAdmittanceUnit.Siemens).ToString(null, swedishCulture)); + Assert.Equal("1 T℧", new ElectricAdmittance(1, ElectricAdmittanceUnit.Teramho).ToString(null, swedishCulture)); + Assert.Equal("1 TS", new ElectricAdmittance(1, ElectricAdmittanceUnit.Terasiemens).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs index edb4ddefc1..9ae030215b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentEnergyTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kVAh", new ElectricApparentEnergy(1, ElectricApparentEnergyUnit.KilovoltampereHour).ToString(swedishCulture)); - Assert.Equal("1 MVAh", new ElectricApparentEnergy(1, ElectricApparentEnergyUnit.MegavoltampereHour).ToString(swedishCulture)); - Assert.Equal("1 VAh", new ElectricApparentEnergy(1, ElectricApparentEnergyUnit.VoltampereHour).ToString(swedishCulture)); + Assert.Equal("1 kVAh", new ElectricApparentEnergy(1, ElectricApparentEnergyUnit.KilovoltampereHour).ToString(null, swedishCulture)); + Assert.Equal("1 MVAh", new ElectricApparentEnergy(1, ElectricApparentEnergyUnit.MegavoltampereHour).ToString(null, swedishCulture)); + Assert.Equal("1 VAh", new ElectricApparentEnergy(1, ElectricApparentEnergyUnit.VoltampereHour).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs index eab8ab5ac1..72d29a19a8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricApparentPowerTestsBase.g.cs @@ -739,12 +739,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 GVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Gigavoltampere).ToString(swedishCulture)); - Assert.Equal("1 kVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Kilovoltampere).ToString(swedishCulture)); - Assert.Equal("1 MVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Megavoltampere).ToString(swedishCulture)); - Assert.Equal("1 µVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Microvoltampere).ToString(swedishCulture)); - Assert.Equal("1 mVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Millivoltampere).ToString(swedishCulture)); - Assert.Equal("1 VA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Voltampere).ToString(swedishCulture)); + Assert.Equal("1 GVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Gigavoltampere).ToString(null, swedishCulture)); + Assert.Equal("1 kVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Kilovoltampere).ToString(null, swedishCulture)); + Assert.Equal("1 MVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Megavoltampere).ToString(null, swedishCulture)); + Assert.Equal("1 µVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Microvoltampere).ToString(null, swedishCulture)); + Assert.Equal("1 mVA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Millivoltampere).ToString(null, swedishCulture)); + Assert.Equal("1 VA", new ElectricApparentPower(1, ElectricApparentPowerUnit.Voltampere).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs index 5e36873363..5eeab5f9d6 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCapacitanceTestsBase.g.cs @@ -772,13 +772,13 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 F", new ElectricCapacitance(1, ElectricCapacitanceUnit.Farad).ToString(swedishCulture)); - Assert.Equal("1 kF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Kilofarad).ToString(swedishCulture)); - Assert.Equal("1 MF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Megafarad).ToString(swedishCulture)); - Assert.Equal("1 µF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Microfarad).ToString(swedishCulture)); - Assert.Equal("1 mF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Millifarad).ToString(swedishCulture)); - Assert.Equal("1 nF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Nanofarad).ToString(swedishCulture)); - Assert.Equal("1 pF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Picofarad).ToString(swedishCulture)); + Assert.Equal("1 F", new ElectricCapacitance(1, ElectricCapacitanceUnit.Farad).ToString(null, swedishCulture)); + Assert.Equal("1 kF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Kilofarad).ToString(null, swedishCulture)); + Assert.Equal("1 MF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Megafarad).ToString(null, swedishCulture)); + Assert.Equal("1 µF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Microfarad).ToString(null, swedishCulture)); + Assert.Equal("1 mF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Millifarad).ToString(null, swedishCulture)); + Assert.Equal("1 nF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Nanofarad).ToString(null, swedishCulture)); + Assert.Equal("1 pF", new ElectricCapacitance(1, ElectricCapacitanceUnit.Picofarad).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs index e646150fe1..44f46784da 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeDensityTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 C/m³", new ElectricChargeDensity(1, ElectricChargeDensityUnit.CoulombPerCubicMeter).ToString(swedishCulture)); + Assert.Equal("1 C/m³", new ElectricChargeDensity(1, ElectricChargeDensityUnit.CoulombPerCubicMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs index 4dd96c0e1d..72b3a08dc2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricChargeTestsBase.g.cs @@ -964,17 +964,17 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 A-h", new ElectricCharge(1, ElectricChargeUnit.AmpereHour).ToString(swedishCulture)); - Assert.Equal("1 C", new ElectricCharge(1, ElectricChargeUnit.Coulomb).ToString(swedishCulture)); - Assert.Equal("1 kA-h", new ElectricCharge(1, ElectricChargeUnit.KiloampereHour).ToString(swedishCulture)); - Assert.Equal("1 kC", new ElectricCharge(1, ElectricChargeUnit.Kilocoulomb).ToString(swedishCulture)); - Assert.Equal("1 MA-h", new ElectricCharge(1, ElectricChargeUnit.MegaampereHour).ToString(swedishCulture)); - Assert.Equal("1 MC", new ElectricCharge(1, ElectricChargeUnit.Megacoulomb).ToString(swedishCulture)); - Assert.Equal("1 µC", new ElectricCharge(1, ElectricChargeUnit.Microcoulomb).ToString(swedishCulture)); - Assert.Equal("1 mA-h", new ElectricCharge(1, ElectricChargeUnit.MilliampereHour).ToString(swedishCulture)); - Assert.Equal("1 mC", new ElectricCharge(1, ElectricChargeUnit.Millicoulomb).ToString(swedishCulture)); - Assert.Equal("1 nC", new ElectricCharge(1, ElectricChargeUnit.Nanocoulomb).ToString(swedishCulture)); - Assert.Equal("1 pC", new ElectricCharge(1, ElectricChargeUnit.Picocoulomb).ToString(swedishCulture)); + Assert.Equal("1 A-h", new ElectricCharge(1, ElectricChargeUnit.AmpereHour).ToString(null, swedishCulture)); + Assert.Equal("1 C", new ElectricCharge(1, ElectricChargeUnit.Coulomb).ToString(null, swedishCulture)); + Assert.Equal("1 kA-h", new ElectricCharge(1, ElectricChargeUnit.KiloampereHour).ToString(null, swedishCulture)); + Assert.Equal("1 kC", new ElectricCharge(1, ElectricChargeUnit.Kilocoulomb).ToString(null, swedishCulture)); + Assert.Equal("1 MA-h", new ElectricCharge(1, ElectricChargeUnit.MegaampereHour).ToString(null, swedishCulture)); + Assert.Equal("1 MC", new ElectricCharge(1, ElectricChargeUnit.Megacoulomb).ToString(null, swedishCulture)); + Assert.Equal("1 µC", new ElectricCharge(1, ElectricChargeUnit.Microcoulomb).ToString(null, swedishCulture)); + Assert.Equal("1 mA-h", new ElectricCharge(1, ElectricChargeUnit.MilliampereHour).ToString(null, swedishCulture)); + Assert.Equal("1 mC", new ElectricCharge(1, ElectricChargeUnit.Millicoulomb).ToString(null, swedishCulture)); + Assert.Equal("1 nC", new ElectricCharge(1, ElectricChargeUnit.Nanocoulomb).ToString(null, swedishCulture)); + Assert.Equal("1 pC", new ElectricCharge(1, ElectricChargeUnit.Picocoulomb).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs index 430db4201c..70ec303b4d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs @@ -1057,22 +1057,22 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 G℧", new ElectricConductance(1, ElectricConductanceUnit.Gigamho).ToString(swedishCulture)); - Assert.Equal("1 GS", new ElectricConductance(1, ElectricConductanceUnit.Gigasiemens).ToString(swedishCulture)); - Assert.Equal("1 k℧", new ElectricConductance(1, ElectricConductanceUnit.Kilomho).ToString(swedishCulture)); - Assert.Equal("1 kS", new ElectricConductance(1, ElectricConductanceUnit.Kilosiemens).ToString(swedishCulture)); - Assert.Equal("1 M℧", new ElectricConductance(1, ElectricConductanceUnit.Megamho).ToString(swedishCulture)); - Assert.Equal("1 MS", new ElectricConductance(1, ElectricConductanceUnit.Megasiemens).ToString(swedishCulture)); - Assert.Equal("1 ℧", new ElectricConductance(1, ElectricConductanceUnit.Mho).ToString(swedishCulture)); - Assert.Equal("1 µ℧", new ElectricConductance(1, ElectricConductanceUnit.Micromho).ToString(swedishCulture)); - Assert.Equal("1 µS", new ElectricConductance(1, ElectricConductanceUnit.Microsiemens).ToString(swedishCulture)); - Assert.Equal("1 m℧", new ElectricConductance(1, ElectricConductanceUnit.Millimho).ToString(swedishCulture)); - Assert.Equal("1 mS", new ElectricConductance(1, ElectricConductanceUnit.Millisiemens).ToString(swedishCulture)); - Assert.Equal("1 n℧", new ElectricConductance(1, ElectricConductanceUnit.Nanomho).ToString(swedishCulture)); - Assert.Equal("1 nS", new ElectricConductance(1, ElectricConductanceUnit.Nanosiemens).ToString(swedishCulture)); - Assert.Equal("1 S", new ElectricConductance(1, ElectricConductanceUnit.Siemens).ToString(swedishCulture)); - Assert.Equal("1 T℧", new ElectricConductance(1, ElectricConductanceUnit.Teramho).ToString(swedishCulture)); - Assert.Equal("1 TS", new ElectricConductance(1, ElectricConductanceUnit.Terasiemens).ToString(swedishCulture)); + Assert.Equal("1 G℧", new ElectricConductance(1, ElectricConductanceUnit.Gigamho).ToString(null, swedishCulture)); + Assert.Equal("1 GS", new ElectricConductance(1, ElectricConductanceUnit.Gigasiemens).ToString(null, swedishCulture)); + Assert.Equal("1 k℧", new ElectricConductance(1, ElectricConductanceUnit.Kilomho).ToString(null, swedishCulture)); + Assert.Equal("1 kS", new ElectricConductance(1, ElectricConductanceUnit.Kilosiemens).ToString(null, swedishCulture)); + Assert.Equal("1 M℧", new ElectricConductance(1, ElectricConductanceUnit.Megamho).ToString(null, swedishCulture)); + Assert.Equal("1 MS", new ElectricConductance(1, ElectricConductanceUnit.Megasiemens).ToString(null, swedishCulture)); + Assert.Equal("1 ℧", new ElectricConductance(1, ElectricConductanceUnit.Mho).ToString(null, swedishCulture)); + Assert.Equal("1 µ℧", new ElectricConductance(1, ElectricConductanceUnit.Micromho).ToString(null, swedishCulture)); + Assert.Equal("1 µS", new ElectricConductance(1, ElectricConductanceUnit.Microsiemens).ToString(null, swedishCulture)); + Assert.Equal("1 m℧", new ElectricConductance(1, ElectricConductanceUnit.Millimho).ToString(null, swedishCulture)); + Assert.Equal("1 mS", new ElectricConductance(1, ElectricConductanceUnit.Millisiemens).ToString(null, swedishCulture)); + Assert.Equal("1 n℧", new ElectricConductance(1, ElectricConductanceUnit.Nanomho).ToString(null, swedishCulture)); + Assert.Equal("1 nS", new ElectricConductance(1, ElectricConductanceUnit.Nanosiemens).ToString(null, swedishCulture)); + Assert.Equal("1 S", new ElectricConductance(1, ElectricConductanceUnit.Siemens).ToString(null, swedishCulture)); + Assert.Equal("1 T℧", new ElectricConductance(1, ElectricConductanceUnit.Teramho).ToString(null, swedishCulture)); + Assert.Equal("1 TS", new ElectricConductance(1, ElectricConductanceUnit.Terasiemens).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs index 3070d32283..c997bb4fc7 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductivityTestsBase.g.cs @@ -751,12 +751,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 µS/cm", new ElectricConductivity(1, ElectricConductivityUnit.MicrosiemensPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mS/cm", new ElectricConductivity(1, ElectricConductivityUnit.MillisiemensPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 S/cm", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 S/ft", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerFoot).ToString(swedishCulture)); - Assert.Equal("1 S/in", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerInch).ToString(swedishCulture)); - Assert.Equal("1 S/m", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerMeter).ToString(swedishCulture)); + Assert.Equal("1 µS/cm", new ElectricConductivity(1, ElectricConductivityUnit.MicrosiemensPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mS/cm", new ElectricConductivity(1, ElectricConductivityUnit.MillisiemensPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 S/cm", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 S/ft", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 S/in", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerInch).ToString(null, swedishCulture)); + Assert.Equal("1 S/m", new ElectricConductivity(1, ElectricConductivityUnit.SiemensPerMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs index f3dc1f8131..4428591c15 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentDensityTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 A/ft²", new ElectricCurrentDensity(1, ElectricCurrentDensityUnit.AmperePerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 A/in²", new ElectricCurrentDensity(1, ElectricCurrentDensityUnit.AmperePerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 A/m²", new ElectricCurrentDensity(1, ElectricCurrentDensityUnit.AmperePerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 A/ft²", new ElectricCurrentDensity(1, ElectricCurrentDensityUnit.AmperePerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 A/in²", new ElectricCurrentDensity(1, ElectricCurrentDensityUnit.AmperePerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 A/m²", new ElectricCurrentDensity(1, ElectricCurrentDensityUnit.AmperePerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs index 5a28952e40..946c73a2b4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentGradientTestsBase.g.cs @@ -784,13 +784,13 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 A/μs", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerMicrosecond).ToString(swedishCulture)); - Assert.Equal("1 A/ms", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerMillisecond).ToString(swedishCulture)); - Assert.Equal("1 A/min", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerMinute).ToString(swedishCulture)); - Assert.Equal("1 A/ns", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerNanosecond).ToString(swedishCulture)); - Assert.Equal("1 A/s", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerSecond).ToString(swedishCulture)); - Assert.Equal("1 mA/min", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.MilliamperePerMinute).ToString(swedishCulture)); - Assert.Equal("1 mA/s", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.MilliamperePerSecond).ToString(swedishCulture)); + Assert.Equal("1 A/μs", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerMicrosecond).ToString(null, swedishCulture)); + Assert.Equal("1 A/ms", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerMillisecond).ToString(null, swedishCulture)); + Assert.Equal("1 A/min", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 A/ns", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerNanosecond).ToString(null, swedishCulture)); + Assert.Equal("1 A/s", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.AmperePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mA/min", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.MilliamperePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 mA/s", new ElectricCurrentGradient(1, ElectricCurrentGradientUnit.MilliamperePerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs index dcab219ec5..5531bf3e5d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricCurrentTestsBase.g.cs @@ -838,15 +838,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 A", new ElectricCurrent(1, ElectricCurrentUnit.Ampere).ToString(swedishCulture)); - Assert.Equal("1 cA", new ElectricCurrent(1, ElectricCurrentUnit.Centiampere).ToString(swedishCulture)); - Assert.Equal("1 fA", new ElectricCurrent(1, ElectricCurrentUnit.Femtoampere).ToString(swedishCulture)); - Assert.Equal("1 kA", new ElectricCurrent(1, ElectricCurrentUnit.Kiloampere).ToString(swedishCulture)); - Assert.Equal("1 MA", new ElectricCurrent(1, ElectricCurrentUnit.Megaampere).ToString(swedishCulture)); - Assert.Equal("1 µA", new ElectricCurrent(1, ElectricCurrentUnit.Microampere).ToString(swedishCulture)); - Assert.Equal("1 mA", new ElectricCurrent(1, ElectricCurrentUnit.Milliampere).ToString(swedishCulture)); - Assert.Equal("1 nA", new ElectricCurrent(1, ElectricCurrentUnit.Nanoampere).ToString(swedishCulture)); - Assert.Equal("1 pA", new ElectricCurrent(1, ElectricCurrentUnit.Picoampere).ToString(swedishCulture)); + Assert.Equal("1 A", new ElectricCurrent(1, ElectricCurrentUnit.Ampere).ToString(null, swedishCulture)); + Assert.Equal("1 cA", new ElectricCurrent(1, ElectricCurrentUnit.Centiampere).ToString(null, swedishCulture)); + Assert.Equal("1 fA", new ElectricCurrent(1, ElectricCurrentUnit.Femtoampere).ToString(null, swedishCulture)); + Assert.Equal("1 kA", new ElectricCurrent(1, ElectricCurrentUnit.Kiloampere).ToString(null, swedishCulture)); + Assert.Equal("1 MA", new ElectricCurrent(1, ElectricCurrentUnit.Megaampere).ToString(null, swedishCulture)); + Assert.Equal("1 µA", new ElectricCurrent(1, ElectricCurrentUnit.Microampere).ToString(null, swedishCulture)); + Assert.Equal("1 mA", new ElectricCurrent(1, ElectricCurrentUnit.Milliampere).ToString(null, swedishCulture)); + Assert.Equal("1 nA", new ElectricCurrent(1, ElectricCurrentUnit.Nanoampere).ToString(null, swedishCulture)); + Assert.Equal("1 pA", new ElectricCurrent(1, ElectricCurrentUnit.Picoampere).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs index 8c72f0c083..e1ca71541f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricFieldTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 V/m", new ElectricField(1, ElectricFieldUnit.VoltPerMeter).ToString(swedishCulture)); + Assert.Equal("1 V/m", new ElectricField(1, ElectricFieldUnit.VoltPerMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs index 1f93d38d3f..f9579bb61f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricImpedanceTestsBase.g.cs @@ -805,14 +805,14 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 GΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Gigaohm).ToString(swedishCulture)); - Assert.Equal("1 kΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Kiloohm).ToString(swedishCulture)); - Assert.Equal("1 MΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Megaohm).ToString(swedishCulture)); - Assert.Equal("1 µΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Microohm).ToString(swedishCulture)); - Assert.Equal("1 mΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Milliohm).ToString(swedishCulture)); - Assert.Equal("1 nΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Nanoohm).ToString(swedishCulture)); - Assert.Equal("1 Ω", new ElectricImpedance(1, ElectricImpedanceUnit.Ohm).ToString(swedishCulture)); - Assert.Equal("1 TΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Teraohm).ToString(swedishCulture)); + Assert.Equal("1 GΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Gigaohm).ToString(null, swedishCulture)); + Assert.Equal("1 kΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Kiloohm).ToString(null, swedishCulture)); + Assert.Equal("1 MΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Megaohm).ToString(null, swedishCulture)); + Assert.Equal("1 µΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Microohm).ToString(null, swedishCulture)); + Assert.Equal("1 mΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Milliohm).ToString(null, swedishCulture)); + Assert.Equal("1 nΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Nanoohm).ToString(null, swedishCulture)); + Assert.Equal("1 Ω", new ElectricImpedance(1, ElectricImpedanceUnit.Ohm).ToString(null, swedishCulture)); + Assert.Equal("1 TΩ", new ElectricImpedance(1, ElectricImpedanceUnit.Teraohm).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs index 1d4d90304c..153dec2d13 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricInductanceTestsBase.g.cs @@ -718,11 +718,11 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 H", new ElectricInductance(1, ElectricInductanceUnit.Henry).ToString(swedishCulture)); - Assert.Equal("1 µH", new ElectricInductance(1, ElectricInductanceUnit.Microhenry).ToString(swedishCulture)); - Assert.Equal("1 mH", new ElectricInductance(1, ElectricInductanceUnit.Millihenry).ToString(swedishCulture)); - Assert.Equal("1 nH", new ElectricInductance(1, ElectricInductanceUnit.Nanohenry).ToString(swedishCulture)); - Assert.Equal("1 pH", new ElectricInductance(1, ElectricInductanceUnit.Picohenry).ToString(swedishCulture)); + Assert.Equal("1 H", new ElectricInductance(1, ElectricInductanceUnit.Henry).ToString(null, swedishCulture)); + Assert.Equal("1 µH", new ElectricInductance(1, ElectricInductanceUnit.Microhenry).ToString(null, swedishCulture)); + Assert.Equal("1 mH", new ElectricInductance(1, ElectricInductanceUnit.Millihenry).ToString(null, swedishCulture)); + Assert.Equal("1 nH", new ElectricInductance(1, ElectricInductanceUnit.Nanohenry).ToString(null, swedishCulture)); + Assert.Equal("1 pH", new ElectricInductance(1, ElectricInductanceUnit.Picohenry).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs index c4fc663776..20cc9b258f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialChangeRateTestsBase.g.cs @@ -1165,26 +1165,26 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerHour).ToString(swedishCulture)); - Assert.Equal("1 kV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond).ToString(swedishCulture)); - Assert.Equal("1 kV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerMinute).ToString(swedishCulture)); - Assert.Equal("1 kV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerSecond).ToString(swedishCulture)); - Assert.Equal("1 MV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerHour).ToString(swedishCulture)); - Assert.Equal("1 MV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond).ToString(swedishCulture)); - Assert.Equal("1 MV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerMinute).ToString(swedishCulture)); - Assert.Equal("1 MV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerSecond).ToString(swedishCulture)); - Assert.Equal("1 µV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerHour).ToString(swedishCulture)); - Assert.Equal("1 µV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond).ToString(swedishCulture)); - Assert.Equal("1 µV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerMinute).ToString(swedishCulture)); - Assert.Equal("1 µV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerHour).ToString(swedishCulture)); - Assert.Equal("1 mV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond).ToString(swedishCulture)); - Assert.Equal("1 mV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerMinute).ToString(swedishCulture)); - Assert.Equal("1 mV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerSecond).ToString(swedishCulture)); - Assert.Equal("1 V/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerHour).ToString(swedishCulture)); - Assert.Equal("1 V/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerMicrosecond).ToString(swedishCulture)); - Assert.Equal("1 V/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerMinute).ToString(swedishCulture)); - Assert.Equal("1 V/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerSecond).ToString(swedishCulture)); + Assert.Equal("1 kV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond).ToString(null, swedishCulture)); + Assert.Equal("1 kV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.KilovoltPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 MV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 MV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond).ToString(null, swedishCulture)); + Assert.Equal("1 MV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 MV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MegavoltPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 µV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond).ToString(null, swedishCulture)); + Assert.Equal("1 µV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 µV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MicrovoltPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mV/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mV/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond).ToString(null, swedishCulture)); + Assert.Equal("1 mV/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 mV/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.MillivoltPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 V/h", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 V/μs", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerMicrosecond).ToString(null, swedishCulture)); + Assert.Equal("1 V/min", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 V/s", new ElectricPotentialChangeRate(1, ElectricPotentialChangeRateUnit.VoltPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs index c8fd56395d..cbafde46be 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricPotentialTestsBase.g.cs @@ -829,12 +829,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kV", new ElectricPotential(1, ElectricPotentialUnit.Kilovolt).ToString(swedishCulture)); - Assert.Equal("1 MV", new ElectricPotential(1, ElectricPotentialUnit.Megavolt).ToString(swedishCulture)); - Assert.Equal("1 µV", new ElectricPotential(1, ElectricPotentialUnit.Microvolt).ToString(swedishCulture)); - Assert.Equal("1 mV", new ElectricPotential(1, ElectricPotentialUnit.Millivolt).ToString(swedishCulture)); - Assert.Equal("1 nV", new ElectricPotential(1, ElectricPotentialUnit.Nanovolt).ToString(swedishCulture)); - Assert.Equal("1 V", new ElectricPotential(1, ElectricPotentialUnit.Volt).ToString(swedishCulture)); + Assert.Equal("1 kV", new ElectricPotential(1, ElectricPotentialUnit.Kilovolt).ToString(null, swedishCulture)); + Assert.Equal("1 MV", new ElectricPotential(1, ElectricPotentialUnit.Megavolt).ToString(null, swedishCulture)); + Assert.Equal("1 µV", new ElectricPotential(1, ElectricPotentialUnit.Microvolt).ToString(null, swedishCulture)); + Assert.Equal("1 mV", new ElectricPotential(1, ElectricPotentialUnit.Millivolt).ToString(null, swedishCulture)); + Assert.Equal("1 nV", new ElectricPotential(1, ElectricPotentialUnit.Nanovolt).ToString(null, swedishCulture)); + Assert.Equal("1 V", new ElectricPotential(1, ElectricPotentialUnit.Volt).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs index bb6050424c..29f802cb71 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactanceTestsBase.g.cs @@ -805,14 +805,14 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 GΩ", new ElectricReactance(1, ElectricReactanceUnit.Gigaohm).ToString(swedishCulture)); - Assert.Equal("1 kΩ", new ElectricReactance(1, ElectricReactanceUnit.Kiloohm).ToString(swedishCulture)); - Assert.Equal("1 MΩ", new ElectricReactance(1, ElectricReactanceUnit.Megaohm).ToString(swedishCulture)); - Assert.Equal("1 µΩ", new ElectricReactance(1, ElectricReactanceUnit.Microohm).ToString(swedishCulture)); - Assert.Equal("1 mΩ", new ElectricReactance(1, ElectricReactanceUnit.Milliohm).ToString(swedishCulture)); - Assert.Equal("1 nΩ", new ElectricReactance(1, ElectricReactanceUnit.Nanoohm).ToString(swedishCulture)); - Assert.Equal("1 Ω", new ElectricReactance(1, ElectricReactanceUnit.Ohm).ToString(swedishCulture)); - Assert.Equal("1 TΩ", new ElectricReactance(1, ElectricReactanceUnit.Teraohm).ToString(swedishCulture)); + Assert.Equal("1 GΩ", new ElectricReactance(1, ElectricReactanceUnit.Gigaohm).ToString(null, swedishCulture)); + Assert.Equal("1 kΩ", new ElectricReactance(1, ElectricReactanceUnit.Kiloohm).ToString(null, swedishCulture)); + Assert.Equal("1 MΩ", new ElectricReactance(1, ElectricReactanceUnit.Megaohm).ToString(null, swedishCulture)); + Assert.Equal("1 µΩ", new ElectricReactance(1, ElectricReactanceUnit.Microohm).ToString(null, swedishCulture)); + Assert.Equal("1 mΩ", new ElectricReactance(1, ElectricReactanceUnit.Milliohm).ToString(null, swedishCulture)); + Assert.Equal("1 nΩ", new ElectricReactance(1, ElectricReactanceUnit.Nanoohm).ToString(null, swedishCulture)); + Assert.Equal("1 Ω", new ElectricReactance(1, ElectricReactanceUnit.Ohm).ToString(null, swedishCulture)); + Assert.Equal("1 TΩ", new ElectricReactance(1, ElectricReactanceUnit.Teraohm).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs index e7f7a81569..bb7dda2c5b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactiveEnergyTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kvarh", new ElectricReactiveEnergy(1, ElectricReactiveEnergyUnit.KilovoltampereReactiveHour).ToString(swedishCulture)); - Assert.Equal("1 Mvarh", new ElectricReactiveEnergy(1, ElectricReactiveEnergyUnit.MegavoltampereReactiveHour).ToString(swedishCulture)); - Assert.Equal("1 varh", new ElectricReactiveEnergy(1, ElectricReactiveEnergyUnit.VoltampereReactiveHour).ToString(swedishCulture)); + Assert.Equal("1 kvarh", new ElectricReactiveEnergy(1, ElectricReactiveEnergyUnit.KilovoltampereReactiveHour).ToString(null, swedishCulture)); + Assert.Equal("1 Mvarh", new ElectricReactiveEnergy(1, ElectricReactiveEnergyUnit.MegavoltampereReactiveHour).ToString(null, swedishCulture)); + Assert.Equal("1 varh", new ElectricReactiveEnergy(1, ElectricReactiveEnergyUnit.VoltampereReactiveHour).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs index 1898a607fb..fad405347f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricReactivePowerTestsBase.g.cs @@ -685,10 +685,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Gvar", new ElectricReactivePower(1, ElectricReactivePowerUnit.GigavoltampereReactive).ToString(swedishCulture)); - Assert.Equal("1 kvar", new ElectricReactivePower(1, ElectricReactivePowerUnit.KilovoltampereReactive).ToString(swedishCulture)); - Assert.Equal("1 Mvar", new ElectricReactivePower(1, ElectricReactivePowerUnit.MegavoltampereReactive).ToString(swedishCulture)); - Assert.Equal("1 var", new ElectricReactivePower(1, ElectricReactivePowerUnit.VoltampereReactive).ToString(swedishCulture)); + Assert.Equal("1 Gvar", new ElectricReactivePower(1, ElectricReactivePowerUnit.GigavoltampereReactive).ToString(null, swedishCulture)); + Assert.Equal("1 kvar", new ElectricReactivePower(1, ElectricReactivePowerUnit.KilovoltampereReactive).ToString(null, swedishCulture)); + Assert.Equal("1 Mvar", new ElectricReactivePower(1, ElectricReactivePowerUnit.MegavoltampereReactive).ToString(null, swedishCulture)); + Assert.Equal("1 var", new ElectricReactivePower(1, ElectricReactivePowerUnit.VoltampereReactive).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs index 01926457f7..598a9a4293 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs @@ -805,14 +805,14 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 GΩ", new ElectricResistance(1, ElectricResistanceUnit.Gigaohm).ToString(swedishCulture)); - Assert.Equal("1 kΩ", new ElectricResistance(1, ElectricResistanceUnit.Kiloohm).ToString(swedishCulture)); - Assert.Equal("1 MΩ", new ElectricResistance(1, ElectricResistanceUnit.Megaohm).ToString(swedishCulture)); - Assert.Equal("1 µΩ", new ElectricResistance(1, ElectricResistanceUnit.Microohm).ToString(swedishCulture)); - Assert.Equal("1 mΩ", new ElectricResistance(1, ElectricResistanceUnit.Milliohm).ToString(swedishCulture)); - Assert.Equal("1 nΩ", new ElectricResistance(1, ElectricResistanceUnit.Nanoohm).ToString(swedishCulture)); - Assert.Equal("1 Ω", new ElectricResistance(1, ElectricResistanceUnit.Ohm).ToString(swedishCulture)); - Assert.Equal("1 TΩ", new ElectricResistance(1, ElectricResistanceUnit.Teraohm).ToString(swedishCulture)); + Assert.Equal("1 GΩ", new ElectricResistance(1, ElectricResistanceUnit.Gigaohm).ToString(null, swedishCulture)); + Assert.Equal("1 kΩ", new ElectricResistance(1, ElectricResistanceUnit.Kiloohm).ToString(null, swedishCulture)); + Assert.Equal("1 MΩ", new ElectricResistance(1, ElectricResistanceUnit.Megaohm).ToString(null, swedishCulture)); + Assert.Equal("1 µΩ", new ElectricResistance(1, ElectricResistanceUnit.Microohm).ToString(null, swedishCulture)); + Assert.Equal("1 mΩ", new ElectricResistance(1, ElectricResistanceUnit.Milliohm).ToString(null, swedishCulture)); + Assert.Equal("1 nΩ", new ElectricResistance(1, ElectricResistanceUnit.Nanoohm).ToString(null, swedishCulture)); + Assert.Equal("1 Ω", new ElectricResistance(1, ElectricResistanceUnit.Ohm).ToString(null, swedishCulture)); + Assert.Equal("1 TΩ", new ElectricResistance(1, ElectricResistanceUnit.Teraohm).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs index 7dfc3ba1e1..769de2ce89 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistivityTestsBase.g.cs @@ -991,20 +991,20 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.KiloohmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.KiloohmMeter).ToString(swedishCulture)); - Assert.Equal("1 MΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.MegaohmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 MΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.MegaohmMeter).ToString(swedishCulture)); - Assert.Equal("1 µΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.MicroohmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 µΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.MicroohmMeter).ToString(swedishCulture)); - Assert.Equal("1 mΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.MilliohmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.MilliohmMeter).ToString(swedishCulture)); - Assert.Equal("1 nΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.NanoohmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 nΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.NanoohmMeter).ToString(swedishCulture)); - Assert.Equal("1 Ω·cm", new ElectricResistivity(1, ElectricResistivityUnit.OhmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 Ω·m", new ElectricResistivity(1, ElectricResistivityUnit.OhmMeter).ToString(swedishCulture)); - Assert.Equal("1 pΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.PicoohmCentimeter).ToString(swedishCulture)); - Assert.Equal("1 pΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.PicoohmMeter).ToString(swedishCulture)); + Assert.Equal("1 kΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.KiloohmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.KiloohmMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.MegaohmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 MΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.MegaohmMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.MicroohmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.MicroohmMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.MilliohmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.MilliohmMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.NanoohmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 nΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.NanoohmMeter).ToString(null, swedishCulture)); + Assert.Equal("1 Ω·cm", new ElectricResistivity(1, ElectricResistivityUnit.OhmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Ω·m", new ElectricResistivity(1, ElectricResistivityUnit.OhmMeter).ToString(null, swedishCulture)); + Assert.Equal("1 pΩ·cm", new ElectricResistivity(1, ElectricResistivityUnit.PicoohmCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 pΩ·m", new ElectricResistivity(1, ElectricResistivityUnit.PicoohmMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs index 0b5989bb2c..3a49dacd33 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSurfaceChargeDensityTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 C/cm²", new ElectricSurfaceChargeDensity(1, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 C/in²", new ElectricSurfaceChargeDensity(1, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 C/m²", new ElectricSurfaceChargeDensity(1, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 C/cm²", new ElectricSurfaceChargeDensity(1, ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 C/in²", new ElectricSurfaceChargeDensity(1, ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 C/m²", new ElectricSurfaceChargeDensity(1, ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs index 63651a7adf..3390226b1c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ElectricSusceptanceTestsBase.g.cs @@ -1057,22 +1057,22 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 G℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Gigamho).ToString(swedishCulture)); - Assert.Equal("1 GS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Gigasiemens).ToString(swedishCulture)); - Assert.Equal("1 k℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Kilomho).ToString(swedishCulture)); - Assert.Equal("1 kS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Kilosiemens).ToString(swedishCulture)); - Assert.Equal("1 M℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Megamho).ToString(swedishCulture)); - Assert.Equal("1 MS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Megasiemens).ToString(swedishCulture)); - Assert.Equal("1 ℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Mho).ToString(swedishCulture)); - Assert.Equal("1 µ℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Micromho).ToString(swedishCulture)); - Assert.Equal("1 µS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Microsiemens).ToString(swedishCulture)); - Assert.Equal("1 m℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Millimho).ToString(swedishCulture)); - Assert.Equal("1 mS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Millisiemens).ToString(swedishCulture)); - Assert.Equal("1 n℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Nanomho).ToString(swedishCulture)); - Assert.Equal("1 nS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Nanosiemens).ToString(swedishCulture)); - Assert.Equal("1 S", new ElectricSusceptance(1, ElectricSusceptanceUnit.Siemens).ToString(swedishCulture)); - Assert.Equal("1 T℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Teramho).ToString(swedishCulture)); - Assert.Equal("1 TS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Terasiemens).ToString(swedishCulture)); + Assert.Equal("1 G℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Gigamho).ToString(null, swedishCulture)); + Assert.Equal("1 GS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Gigasiemens).ToString(null, swedishCulture)); + Assert.Equal("1 k℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Kilomho).ToString(null, swedishCulture)); + Assert.Equal("1 kS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Kilosiemens).ToString(null, swedishCulture)); + Assert.Equal("1 M℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Megamho).ToString(null, swedishCulture)); + Assert.Equal("1 MS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Megasiemens).ToString(null, swedishCulture)); + Assert.Equal("1 ℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Mho).ToString(null, swedishCulture)); + Assert.Equal("1 µ℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Micromho).ToString(null, swedishCulture)); + Assert.Equal("1 µS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Microsiemens).ToString(null, swedishCulture)); + Assert.Equal("1 m℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Millimho).ToString(null, swedishCulture)); + Assert.Equal("1 mS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Millisiemens).ToString(null, swedishCulture)); + Assert.Equal("1 n℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Nanomho).ToString(null, swedishCulture)); + Assert.Equal("1 nS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Nanosiemens).ToString(null, swedishCulture)); + Assert.Equal("1 S", new ElectricSusceptance(1, ElectricSusceptanceUnit.Siemens).ToString(null, swedishCulture)); + Assert.Equal("1 T℧", new ElectricSusceptance(1, ElectricSusceptanceUnit.Teramho).ToString(null, swedishCulture)); + Assert.Equal("1 TS", new ElectricSusceptance(1, ElectricSusceptanceUnit.Terasiemens).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs index 81cbe0c958..341572044d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyDensityTestsBase.g.cs @@ -949,18 +949,18 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 GJ/m³", new EnergyDensity(1, EnergyDensityUnit.GigajoulePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 GWh/m³", new EnergyDensity(1, EnergyDensityUnit.GigawattHourPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 J/m³", new EnergyDensity(1, EnergyDensityUnit.JoulePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kJ/m³", new EnergyDensity(1, EnergyDensityUnit.KilojoulePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kWh/m³", new EnergyDensity(1, EnergyDensityUnit.KilowattHourPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 MJ/m³", new EnergyDensity(1, EnergyDensityUnit.MegajoulePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 MWh/m³", new EnergyDensity(1, EnergyDensityUnit.MegawattHourPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 PJ/m³", new EnergyDensity(1, EnergyDensityUnit.PetajoulePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 PWh/m³", new EnergyDensity(1, EnergyDensityUnit.PetawattHourPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 TJ/m³", new EnergyDensity(1, EnergyDensityUnit.TerajoulePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 TWh/m³", new EnergyDensity(1, EnergyDensityUnit.TerawattHourPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 Wh/m³", new EnergyDensity(1, EnergyDensityUnit.WattHourPerCubicMeter).ToString(swedishCulture)); + Assert.Equal("1 GJ/m³", new EnergyDensity(1, EnergyDensityUnit.GigajoulePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 GWh/m³", new EnergyDensity(1, EnergyDensityUnit.GigawattHourPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 J/m³", new EnergyDensity(1, EnergyDensityUnit.JoulePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/m³", new EnergyDensity(1, EnergyDensityUnit.KilojoulePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kWh/m³", new EnergyDensity(1, EnergyDensityUnit.KilowattHourPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/m³", new EnergyDensity(1, EnergyDensityUnit.MegajoulePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MWh/m³", new EnergyDensity(1, EnergyDensityUnit.MegawattHourPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 PJ/m³", new EnergyDensity(1, EnergyDensityUnit.PetajoulePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 PWh/m³", new EnergyDensity(1, EnergyDensityUnit.PetawattHourPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 TJ/m³", new EnergyDensity(1, EnergyDensityUnit.TerajoulePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 TWh/m³", new EnergyDensity(1, EnergyDensityUnit.TerawattHourPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 Wh/m³", new EnergyDensity(1, EnergyDensityUnit.WattHourPerCubicMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs index 5c0848d361..57d0ceebfc 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EnergyTestsBase.g.cs @@ -2218,46 +2218,46 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 BTU", new Energy(1, EnergyUnit.BritishThermalUnit).ToString(swedishCulture)); - Assert.Equal("1 cal", new Energy(1, EnergyUnit.Calorie).ToString(swedishCulture)); - Assert.Equal("1 Dth (E.C.)", new Energy(1, EnergyUnit.DecathermEc).ToString(swedishCulture)); - Assert.Equal("1 Dth (imp.)", new Energy(1, EnergyUnit.DecathermImperial).ToString(swedishCulture)); - Assert.Equal("1 Dth (U.S.)", new Energy(1, EnergyUnit.DecathermUs).ToString(swedishCulture)); - Assert.Equal("1 eV", new Energy(1, EnergyUnit.ElectronVolt).ToString(swedishCulture)); - Assert.Equal("1 erg", new Energy(1, EnergyUnit.Erg).ToString(swedishCulture)); - Assert.Equal("1 ft·lb", new Energy(1, EnergyUnit.FootPound).ToString(swedishCulture)); - Assert.Equal("1 GBTU", new Energy(1, EnergyUnit.GigabritishThermalUnit).ToString(swedishCulture)); - Assert.Equal("1 GeV", new Energy(1, EnergyUnit.GigaelectronVolt).ToString(swedishCulture)); - Assert.Equal("1 GJ", new Energy(1, EnergyUnit.Gigajoule).ToString(swedishCulture)); - Assert.Equal("1 GWd", new Energy(1, EnergyUnit.GigawattDay).ToString(swedishCulture)); - Assert.Equal("1 GWh", new Energy(1, EnergyUnit.GigawattHour).ToString(swedishCulture)); - Assert.Equal("1 hp·h", new Energy(1, EnergyUnit.HorsepowerHour).ToString(swedishCulture)); - Assert.Equal("1 J", new Energy(1, EnergyUnit.Joule).ToString(swedishCulture)); - Assert.Equal("1 kBTU", new Energy(1, EnergyUnit.KilobritishThermalUnit).ToString(swedishCulture)); - Assert.Equal("1 kcal", new Energy(1, EnergyUnit.Kilocalorie).ToString(swedishCulture)); - Assert.Equal("1 keV", new Energy(1, EnergyUnit.KiloelectronVolt).ToString(swedishCulture)); - Assert.Equal("1 kJ", new Energy(1, EnergyUnit.Kilojoule).ToString(swedishCulture)); - Assert.Equal("1 kWd", new Energy(1, EnergyUnit.KilowattDay).ToString(swedishCulture)); - Assert.Equal("1 kWh", new Energy(1, EnergyUnit.KilowattHour).ToString(swedishCulture)); - Assert.Equal("1 MBTU", new Energy(1, EnergyUnit.MegabritishThermalUnit).ToString(swedishCulture)); - Assert.Equal("1 Mcal", new Energy(1, EnergyUnit.Megacalorie).ToString(swedishCulture)); - Assert.Equal("1 MeV", new Energy(1, EnergyUnit.MegaelectronVolt).ToString(swedishCulture)); - Assert.Equal("1 MJ", new Energy(1, EnergyUnit.Megajoule).ToString(swedishCulture)); - Assert.Equal("1 MWd", new Energy(1, EnergyUnit.MegawattDay).ToString(swedishCulture)); - Assert.Equal("1 MWh", new Energy(1, EnergyUnit.MegawattHour).ToString(swedishCulture)); - Assert.Equal("1 µJ", new Energy(1, EnergyUnit.Microjoule).ToString(swedishCulture)); - Assert.Equal("1 mJ", new Energy(1, EnergyUnit.Millijoule).ToString(swedishCulture)); - Assert.Equal("1 nJ", new Energy(1, EnergyUnit.Nanojoule).ToString(swedishCulture)); - Assert.Equal("1 PJ", new Energy(1, EnergyUnit.Petajoule).ToString(swedishCulture)); - Assert.Equal("1 TeV", new Energy(1, EnergyUnit.TeraelectronVolt).ToString(swedishCulture)); - Assert.Equal("1 TJ", new Energy(1, EnergyUnit.Terajoule).ToString(swedishCulture)); - Assert.Equal("1 TWd", new Energy(1, EnergyUnit.TerawattDay).ToString(swedishCulture)); - Assert.Equal("1 TWh", new Energy(1, EnergyUnit.TerawattHour).ToString(swedishCulture)); - Assert.Equal("1 th (E.C.)", new Energy(1, EnergyUnit.ThermEc).ToString(swedishCulture)); - Assert.Equal("1 th (imp.)", new Energy(1, EnergyUnit.ThermImperial).ToString(swedishCulture)); - Assert.Equal("1 th (U.S.)", new Energy(1, EnergyUnit.ThermUs).ToString(swedishCulture)); - Assert.Equal("1 Wd", new Energy(1, EnergyUnit.WattDay).ToString(swedishCulture)); - Assert.Equal("1 Wh", new Energy(1, EnergyUnit.WattHour).ToString(swedishCulture)); + Assert.Equal("1 BTU", new Energy(1, EnergyUnit.BritishThermalUnit).ToString(null, swedishCulture)); + Assert.Equal("1 cal", new Energy(1, EnergyUnit.Calorie).ToString(null, swedishCulture)); + Assert.Equal("1 Dth (E.C.)", new Energy(1, EnergyUnit.DecathermEc).ToString(null, swedishCulture)); + Assert.Equal("1 Dth (imp.)", new Energy(1, EnergyUnit.DecathermImperial).ToString(null, swedishCulture)); + Assert.Equal("1 Dth (U.S.)", new Energy(1, EnergyUnit.DecathermUs).ToString(null, swedishCulture)); + Assert.Equal("1 eV", new Energy(1, EnergyUnit.ElectronVolt).ToString(null, swedishCulture)); + Assert.Equal("1 erg", new Energy(1, EnergyUnit.Erg).ToString(null, swedishCulture)); + Assert.Equal("1 ft·lb", new Energy(1, EnergyUnit.FootPound).ToString(null, swedishCulture)); + Assert.Equal("1 GBTU", new Energy(1, EnergyUnit.GigabritishThermalUnit).ToString(null, swedishCulture)); + Assert.Equal("1 GeV", new Energy(1, EnergyUnit.GigaelectronVolt).ToString(null, swedishCulture)); + Assert.Equal("1 GJ", new Energy(1, EnergyUnit.Gigajoule).ToString(null, swedishCulture)); + Assert.Equal("1 GWd", new Energy(1, EnergyUnit.GigawattDay).ToString(null, swedishCulture)); + Assert.Equal("1 GWh", new Energy(1, EnergyUnit.GigawattHour).ToString(null, swedishCulture)); + Assert.Equal("1 hp·h", new Energy(1, EnergyUnit.HorsepowerHour).ToString(null, swedishCulture)); + Assert.Equal("1 J", new Energy(1, EnergyUnit.Joule).ToString(null, swedishCulture)); + Assert.Equal("1 kBTU", new Energy(1, EnergyUnit.KilobritishThermalUnit).ToString(null, swedishCulture)); + Assert.Equal("1 kcal", new Energy(1, EnergyUnit.Kilocalorie).ToString(null, swedishCulture)); + Assert.Equal("1 keV", new Energy(1, EnergyUnit.KiloelectronVolt).ToString(null, swedishCulture)); + Assert.Equal("1 kJ", new Energy(1, EnergyUnit.Kilojoule).ToString(null, swedishCulture)); + Assert.Equal("1 kWd", new Energy(1, EnergyUnit.KilowattDay).ToString(null, swedishCulture)); + Assert.Equal("1 kWh", new Energy(1, EnergyUnit.KilowattHour).ToString(null, swedishCulture)); + Assert.Equal("1 MBTU", new Energy(1, EnergyUnit.MegabritishThermalUnit).ToString(null, swedishCulture)); + Assert.Equal("1 Mcal", new Energy(1, EnergyUnit.Megacalorie).ToString(null, swedishCulture)); + Assert.Equal("1 MeV", new Energy(1, EnergyUnit.MegaelectronVolt).ToString(null, swedishCulture)); + Assert.Equal("1 MJ", new Energy(1, EnergyUnit.Megajoule).ToString(null, swedishCulture)); + Assert.Equal("1 MWd", new Energy(1, EnergyUnit.MegawattDay).ToString(null, swedishCulture)); + Assert.Equal("1 MWh", new Energy(1, EnergyUnit.MegawattHour).ToString(null, swedishCulture)); + Assert.Equal("1 µJ", new Energy(1, EnergyUnit.Microjoule).ToString(null, swedishCulture)); + Assert.Equal("1 mJ", new Energy(1, EnergyUnit.Millijoule).ToString(null, swedishCulture)); + Assert.Equal("1 nJ", new Energy(1, EnergyUnit.Nanojoule).ToString(null, swedishCulture)); + Assert.Equal("1 PJ", new Energy(1, EnergyUnit.Petajoule).ToString(null, swedishCulture)); + Assert.Equal("1 TeV", new Energy(1, EnergyUnit.TeraelectronVolt).ToString(null, swedishCulture)); + Assert.Equal("1 TJ", new Energy(1, EnergyUnit.Terajoule).ToString(null, swedishCulture)); + Assert.Equal("1 TWd", new Energy(1, EnergyUnit.TerawattDay).ToString(null, swedishCulture)); + Assert.Equal("1 TWh", new Energy(1, EnergyUnit.TerawattHour).ToString(null, swedishCulture)); + Assert.Equal("1 th (E.C.)", new Energy(1, EnergyUnit.ThermEc).ToString(null, swedishCulture)); + Assert.Equal("1 th (imp.)", new Energy(1, EnergyUnit.ThermImperial).ToString(null, swedishCulture)); + Assert.Equal("1 th (U.S.)", new Energy(1, EnergyUnit.ThermUs).ToString(null, swedishCulture)); + Assert.Equal("1 Wd", new Energy(1, EnergyUnit.WattDay).ToString(null, swedishCulture)); + Assert.Equal("1 Wh", new Energy(1, EnergyUnit.WattHour).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs index 942c3472f0..f49420da3f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/EntropyTestsBase.g.cs @@ -784,13 +784,13 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cal/K", new Entropy(1, EntropyUnit.CaloriePerKelvin).ToString(swedishCulture)); - Assert.Equal("1 J/°C", new Entropy(1, EntropyUnit.JoulePerDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 J/K", new Entropy(1, EntropyUnit.JoulePerKelvin).ToString(swedishCulture)); - Assert.Equal("1 kcal/K", new Entropy(1, EntropyUnit.KilocaloriePerKelvin).ToString(swedishCulture)); - Assert.Equal("1 kJ/°C", new Entropy(1, EntropyUnit.KilojoulePerDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 kJ/K", new Entropy(1, EntropyUnit.KilojoulePerKelvin).ToString(swedishCulture)); - Assert.Equal("1 MJ/K", new Entropy(1, EntropyUnit.MegajoulePerKelvin).ToString(swedishCulture)); + Assert.Equal("1 cal/K", new Entropy(1, EntropyUnit.CaloriePerKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 J/°C", new Entropy(1, EntropyUnit.JoulePerDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 J/K", new Entropy(1, EntropyUnit.JoulePerKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/K", new Entropy(1, EntropyUnit.KilocaloriePerKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/°C", new Entropy(1, EntropyUnit.KilojoulePerDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/K", new Entropy(1, EntropyUnit.KilojoulePerKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/K", new Entropy(1, EntropyUnit.MegajoulePerKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs index 6fc493ffa0..d549aa0fe6 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FluidResistanceTestsBase.g.cs @@ -1579,25 +1579,25 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 dyn·s/cm⁵", new FluidResistance(1, FluidResistanceUnit.DyneSecondPerCentimeterToTheFifth).ToString(swedishCulture)); - Assert.Equal("1 MPa·s/m³", new FluidResistance(1, FluidResistanceUnit.MegapascalSecondPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·min/cm³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·min/m³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·min/l", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerLiter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·min/ml", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·s/cm³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·s/m³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·s/l", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerLiter).ToString(swedishCulture)); - Assert.Equal("1 mmHg·s/ml", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 Pa·min/cm³", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 Pa·min/m³", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 Pa·min/l", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerLiter).ToString(swedishCulture)); - Assert.Equal("1 Pa·min/ml", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 Pa·s/cm³", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 Pa·s/m³", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 Pa·s/l", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerLiter).ToString(swedishCulture)); - Assert.Equal("1 Pa·s/ml", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 WU", new FluidResistance(1, FluidResistanceUnit.WoodUnit).ToString(swedishCulture)); + Assert.Equal("1 dyn·s/cm⁵", new FluidResistance(1, FluidResistanceUnit.DyneSecondPerCentimeterToTheFifth).ToString(null, swedishCulture)); + Assert.Equal("1 MPa·s/m³", new FluidResistance(1, FluidResistanceUnit.MegapascalSecondPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·min/cm³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·min/m³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·min/l", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·min/ml", new FluidResistance(1, FluidResistanceUnit.MillimeterMercuryMinutePerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·s/cm³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·s/m³", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·s/l", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg·s/ml", new FluidResistance(1, FluidResistanceUnit.MillimeterMercurySecondPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·min/cm³", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·min/m³", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·min/l", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·min/ml", new FluidResistance(1, FluidResistanceUnit.PascalMinutePerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·s/cm³", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·s/m³", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·s/l", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·s/ml", new FluidResistance(1, FluidResistanceUnit.PascalSecondPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 WU", new FluidResistance(1, FluidResistanceUnit.WoodUnit).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs index 620e8e5c2b..69649619c8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceChangeRateTestsBase.g.cs @@ -1132,21 +1132,21 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cN/s", new ForceChangeRate(1, ForceChangeRateUnit.CentinewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 daN/min", new ForceChangeRate(1, ForceChangeRateUnit.DecanewtonPerMinute).ToString(swedishCulture)); - Assert.Equal("1 daN/s", new ForceChangeRate(1, ForceChangeRateUnit.DecanewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 dN/s", new ForceChangeRate(1, ForceChangeRateUnit.DecinewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kN/min", new ForceChangeRate(1, ForceChangeRateUnit.KilonewtonPerMinute).ToString(swedishCulture)); - Assert.Equal("1 kN/s", new ForceChangeRate(1, ForceChangeRateUnit.KilonewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kipf/min", new ForceChangeRate(1, ForceChangeRateUnit.KilopoundForcePerMinute).ToString(swedishCulture)); - Assert.Equal("1 kipf/s", new ForceChangeRate(1, ForceChangeRateUnit.KilopoundForcePerSecond).ToString(swedishCulture)); - Assert.Equal("1 µN/s", new ForceChangeRate(1, ForceChangeRateUnit.MicronewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mN/s", new ForceChangeRate(1, ForceChangeRateUnit.MillinewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 nN/s", new ForceChangeRate(1, ForceChangeRateUnit.NanonewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 N/min", new ForceChangeRate(1, ForceChangeRateUnit.NewtonPerMinute).ToString(swedishCulture)); - Assert.Equal("1 N/s", new ForceChangeRate(1, ForceChangeRateUnit.NewtonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 lbf/min", new ForceChangeRate(1, ForceChangeRateUnit.PoundForcePerMinute).ToString(swedishCulture)); - Assert.Equal("1 lbf/s", new ForceChangeRate(1, ForceChangeRateUnit.PoundForcePerSecond).ToString(swedishCulture)); + Assert.Equal("1 cN/s", new ForceChangeRate(1, ForceChangeRateUnit.CentinewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 daN/min", new ForceChangeRate(1, ForceChangeRateUnit.DecanewtonPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 daN/s", new ForceChangeRate(1, ForceChangeRateUnit.DecanewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dN/s", new ForceChangeRate(1, ForceChangeRateUnit.DecinewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kN/min", new ForceChangeRate(1, ForceChangeRateUnit.KilonewtonPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kN/s", new ForceChangeRate(1, ForceChangeRateUnit.KilonewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/min", new ForceChangeRate(1, ForceChangeRateUnit.KilopoundForcePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/s", new ForceChangeRate(1, ForceChangeRateUnit.KilopoundForcePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µN/s", new ForceChangeRate(1, ForceChangeRateUnit.MicronewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mN/s", new ForceChangeRate(1, ForceChangeRateUnit.MillinewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 nN/s", new ForceChangeRate(1, ForceChangeRateUnit.NanonewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 N/min", new ForceChangeRate(1, ForceChangeRateUnit.NewtonPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 N/s", new ForceChangeRate(1, ForceChangeRateUnit.NewtonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/min", new ForceChangeRate(1, ForceChangeRateUnit.PoundForcePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/s", new ForceChangeRate(1, ForceChangeRateUnit.PoundForcePerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs index f3f3ace69a..b6d737dc77 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForcePerLengthTestsBase.g.cs @@ -1957,44 +1957,44 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cN/cm", new ForcePerLength(1, ForcePerLengthUnit.CentinewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 cN/m", new ForcePerLength(1, ForcePerLengthUnit.CentinewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 cN/mm", new ForcePerLength(1, ForcePerLengthUnit.CentinewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 daN/cm", new ForcePerLength(1, ForcePerLengthUnit.DecanewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 daN/m", new ForcePerLength(1, ForcePerLengthUnit.DecanewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 daN/mm", new ForcePerLength(1, ForcePerLengthUnit.DecanewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 dN/cm", new ForcePerLength(1, ForcePerLengthUnit.DecinewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 dN/m", new ForcePerLength(1, ForcePerLengthUnit.DecinewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 dN/mm", new ForcePerLength(1, ForcePerLengthUnit.DecinewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/cm", new ForcePerLength(1, ForcePerLengthUnit.KilogramForcePerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/m", new ForcePerLength(1, ForcePerLengthUnit.KilogramForcePerMeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/mm", new ForcePerLength(1, ForcePerLengthUnit.KilogramForcePerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kN/cm", new ForcePerLength(1, ForcePerLengthUnit.KilonewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kN/m", new ForcePerLength(1, ForcePerLengthUnit.KilonewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 kN/mm", new ForcePerLength(1, ForcePerLengthUnit.KilonewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kipf/ft", new ForcePerLength(1, ForcePerLengthUnit.KilopoundForcePerFoot).ToString(swedishCulture)); - Assert.Equal("1 kipf/in", new ForcePerLength(1, ForcePerLengthUnit.KilopoundForcePerInch).ToString(swedishCulture)); - Assert.Equal("1 MN/cm", new ForcePerLength(1, ForcePerLengthUnit.MeganewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 MN/m", new ForcePerLength(1, ForcePerLengthUnit.MeganewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 MN/mm", new ForcePerLength(1, ForcePerLengthUnit.MeganewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 µN/cm", new ForcePerLength(1, ForcePerLengthUnit.MicronewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 µN/m", new ForcePerLength(1, ForcePerLengthUnit.MicronewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 µN/mm", new ForcePerLength(1, ForcePerLengthUnit.MicronewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 mN/cm", new ForcePerLength(1, ForcePerLengthUnit.MillinewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mN/m", new ForcePerLength(1, ForcePerLengthUnit.MillinewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 mN/mm", new ForcePerLength(1, ForcePerLengthUnit.MillinewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 nN/cm", new ForcePerLength(1, ForcePerLengthUnit.NanonewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 nN/m", new ForcePerLength(1, ForcePerLengthUnit.NanonewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 nN/mm", new ForcePerLength(1, ForcePerLengthUnit.NanonewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 N/cm", new ForcePerLength(1, ForcePerLengthUnit.NewtonPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 N/m", new ForcePerLength(1, ForcePerLengthUnit.NewtonPerMeter).ToString(swedishCulture)); - Assert.Equal("1 N/mm", new ForcePerLength(1, ForcePerLengthUnit.NewtonPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 lbf/ft", new ForcePerLength(1, ForcePerLengthUnit.PoundForcePerFoot).ToString(swedishCulture)); - Assert.Equal("1 lbf/in", new ForcePerLength(1, ForcePerLengthUnit.PoundForcePerInch).ToString(swedishCulture)); - Assert.Equal("1 lbf/yd", new ForcePerLength(1, ForcePerLengthUnit.PoundForcePerYard).ToString(swedishCulture)); - Assert.Equal("1 tf/cm", new ForcePerLength(1, ForcePerLengthUnit.TonneForcePerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 tf/m", new ForcePerLength(1, ForcePerLengthUnit.TonneForcePerMeter).ToString(swedishCulture)); - Assert.Equal("1 tf/mm", new ForcePerLength(1, ForcePerLengthUnit.TonneForcePerMillimeter).ToString(swedishCulture)); + Assert.Equal("1 cN/cm", new ForcePerLength(1, ForcePerLengthUnit.CentinewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 cN/m", new ForcePerLength(1, ForcePerLengthUnit.CentinewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 cN/mm", new ForcePerLength(1, ForcePerLengthUnit.CentinewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 daN/cm", new ForcePerLength(1, ForcePerLengthUnit.DecanewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 daN/m", new ForcePerLength(1, ForcePerLengthUnit.DecanewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 daN/mm", new ForcePerLength(1, ForcePerLengthUnit.DecanewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dN/cm", new ForcePerLength(1, ForcePerLengthUnit.DecinewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dN/m", new ForcePerLength(1, ForcePerLengthUnit.DecinewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 dN/mm", new ForcePerLength(1, ForcePerLengthUnit.DecinewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/cm", new ForcePerLength(1, ForcePerLengthUnit.KilogramForcePerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/m", new ForcePerLength(1, ForcePerLengthUnit.KilogramForcePerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/mm", new ForcePerLength(1, ForcePerLengthUnit.KilogramForcePerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/cm", new ForcePerLength(1, ForcePerLengthUnit.KilonewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/m", new ForcePerLength(1, ForcePerLengthUnit.KilonewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/mm", new ForcePerLength(1, ForcePerLengthUnit.KilonewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/ft", new ForcePerLength(1, ForcePerLengthUnit.KilopoundForcePerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/in", new ForcePerLength(1, ForcePerLengthUnit.KilopoundForcePerInch).ToString(null, swedishCulture)); + Assert.Equal("1 MN/cm", new ForcePerLength(1, ForcePerLengthUnit.MeganewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 MN/m", new ForcePerLength(1, ForcePerLengthUnit.MeganewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MN/mm", new ForcePerLength(1, ForcePerLengthUnit.MeganewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µN/cm", new ForcePerLength(1, ForcePerLengthUnit.MicronewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µN/m", new ForcePerLength(1, ForcePerLengthUnit.MicronewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µN/mm", new ForcePerLength(1, ForcePerLengthUnit.MicronewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mN/cm", new ForcePerLength(1, ForcePerLengthUnit.MillinewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mN/m", new ForcePerLength(1, ForcePerLengthUnit.MillinewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mN/mm", new ForcePerLength(1, ForcePerLengthUnit.MillinewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 nN/cm", new ForcePerLength(1, ForcePerLengthUnit.NanonewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 nN/m", new ForcePerLength(1, ForcePerLengthUnit.NanonewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nN/mm", new ForcePerLength(1, ForcePerLengthUnit.NanonewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/cm", new ForcePerLength(1, ForcePerLengthUnit.NewtonPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/m", new ForcePerLength(1, ForcePerLengthUnit.NewtonPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/mm", new ForcePerLength(1, ForcePerLengthUnit.NewtonPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/ft", new ForcePerLength(1, ForcePerLengthUnit.PoundForcePerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/in", new ForcePerLength(1, ForcePerLengthUnit.PoundForcePerInch).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/yd", new ForcePerLength(1, ForcePerLengthUnit.PoundForcePerYard).ToString(null, swedishCulture)); + Assert.Equal("1 tf/cm", new ForcePerLength(1, ForcePerLengthUnit.TonneForcePerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf/m", new ForcePerLength(1, ForcePerLengthUnit.TonneForcePerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf/mm", new ForcePerLength(1, ForcePerLengthUnit.TonneForcePerMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs index 1b851903be..cfaf48006d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ForceTestsBase.g.cs @@ -1378,21 +1378,21 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 daN", new Force(1, ForceUnit.Decanewton).ToString(swedishCulture)); - Assert.Equal("1 dyn", new Force(1, ForceUnit.Dyn).ToString(swedishCulture)); - Assert.Equal("1 kgf", new Force(1, ForceUnit.KilogramForce).ToString(swedishCulture)); - Assert.Equal("1 kN", new Force(1, ForceUnit.Kilonewton).ToString(swedishCulture)); - Assert.Equal("1 kp", new Force(1, ForceUnit.KiloPond).ToString(swedishCulture)); - Assert.Equal("1 kipf", new Force(1, ForceUnit.KilopoundForce).ToString(swedishCulture)); - Assert.Equal("1 MN", new Force(1, ForceUnit.Meganewton).ToString(swedishCulture)); - Assert.Equal("1 µN", new Force(1, ForceUnit.Micronewton).ToString(swedishCulture)); - Assert.Equal("1 mN", new Force(1, ForceUnit.Millinewton).ToString(swedishCulture)); - Assert.Equal("1 N", new Force(1, ForceUnit.Newton).ToString(swedishCulture)); - Assert.Equal("1 ozf", new Force(1, ForceUnit.OunceForce).ToString(swedishCulture)); - Assert.Equal("1 pdl", new Force(1, ForceUnit.Poundal).ToString(swedishCulture)); - Assert.Equal("1 lbf", new Force(1, ForceUnit.PoundForce).ToString(swedishCulture)); - Assert.Equal("1 tf (short)", new Force(1, ForceUnit.ShortTonForce).ToString(swedishCulture)); - Assert.Equal("1 tf", new Force(1, ForceUnit.TonneForce).ToString(swedishCulture)); + Assert.Equal("1 daN", new Force(1, ForceUnit.Decanewton).ToString(null, swedishCulture)); + Assert.Equal("1 dyn", new Force(1, ForceUnit.Dyn).ToString(null, swedishCulture)); + Assert.Equal("1 kgf", new Force(1, ForceUnit.KilogramForce).ToString(null, swedishCulture)); + Assert.Equal("1 kN", new Force(1, ForceUnit.Kilonewton).ToString(null, swedishCulture)); + Assert.Equal("1 kp", new Force(1, ForceUnit.KiloPond).ToString(null, swedishCulture)); + Assert.Equal("1 kipf", new Force(1, ForceUnit.KilopoundForce).ToString(null, swedishCulture)); + Assert.Equal("1 MN", new Force(1, ForceUnit.Meganewton).ToString(null, swedishCulture)); + Assert.Equal("1 µN", new Force(1, ForceUnit.Micronewton).ToString(null, swedishCulture)); + Assert.Equal("1 mN", new Force(1, ForceUnit.Millinewton).ToString(null, swedishCulture)); + Assert.Equal("1 N", new Force(1, ForceUnit.Newton).ToString(null, swedishCulture)); + Assert.Equal("1 ozf", new Force(1, ForceUnit.OunceForce).ToString(null, swedishCulture)); + Assert.Equal("1 pdl", new Force(1, ForceUnit.Poundal).ToString(null, swedishCulture)); + Assert.Equal("1 lbf", new Force(1, ForceUnit.PoundForce).ToString(null, swedishCulture)); + Assert.Equal("1 tf (short)", new Force(1, ForceUnit.ShortTonForce).ToString(null, swedishCulture)); + Assert.Equal("1 tf", new Force(1, ForceUnit.TonneForce).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs index c29c0bc8f4..efbbfb7a17 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FrequencyTestsBase.g.cs @@ -1078,18 +1078,18 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 bpm", new Frequency(1, FrequencyUnit.BeatPerMinute).ToString(swedishCulture)); - Assert.Equal("1 cph", new Frequency(1, FrequencyUnit.CyclePerHour).ToString(swedishCulture)); - Assert.Equal("1 cpm", new Frequency(1, FrequencyUnit.CyclePerMinute).ToString(swedishCulture)); - Assert.Equal("1 GHz", new Frequency(1, FrequencyUnit.Gigahertz).ToString(swedishCulture)); - Assert.Equal("1 Hz", new Frequency(1, FrequencyUnit.Hertz).ToString(swedishCulture)); - Assert.Equal("1 kHz", new Frequency(1, FrequencyUnit.Kilohertz).ToString(swedishCulture)); - Assert.Equal("1 MHz", new Frequency(1, FrequencyUnit.Megahertz).ToString(swedishCulture)); - Assert.Equal("1 µHz", new Frequency(1, FrequencyUnit.Microhertz).ToString(swedishCulture)); - Assert.Equal("1 mHz", new Frequency(1, FrequencyUnit.Millihertz).ToString(swedishCulture)); - Assert.Equal("1 s⁻¹", new Frequency(1, FrequencyUnit.PerSecond).ToString(swedishCulture)); - Assert.Equal("1 rad/s", new Frequency(1, FrequencyUnit.RadianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 THz", new Frequency(1, FrequencyUnit.Terahertz).ToString(swedishCulture)); + Assert.Equal("1 bpm", new Frequency(1, FrequencyUnit.BeatPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 cph", new Frequency(1, FrequencyUnit.CyclePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 cpm", new Frequency(1, FrequencyUnit.CyclePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 GHz", new Frequency(1, FrequencyUnit.Gigahertz).ToString(null, swedishCulture)); + Assert.Equal("1 Hz", new Frequency(1, FrequencyUnit.Hertz).ToString(null, swedishCulture)); + Assert.Equal("1 kHz", new Frequency(1, FrequencyUnit.Kilohertz).ToString(null, swedishCulture)); + Assert.Equal("1 MHz", new Frequency(1, FrequencyUnit.Megahertz).ToString(null, swedishCulture)); + Assert.Equal("1 µHz", new Frequency(1, FrequencyUnit.Microhertz).ToString(null, swedishCulture)); + Assert.Equal("1 mHz", new Frequency(1, FrequencyUnit.Millihertz).ToString(null, swedishCulture)); + Assert.Equal("1 s⁻¹", new Frequency(1, FrequencyUnit.PerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 rad/s", new Frequency(1, FrequencyUnit.RadianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 THz", new Frequency(1, FrequencyUnit.Terahertz).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs index 674b348b4d..cecf35ae9c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/FuelEfficiencyTestsBase.g.cs @@ -685,10 +685,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 km/l", new FuelEfficiency(1, FuelEfficiencyUnit.KilometerPerLiter).ToString(swedishCulture)); - Assert.Equal("1 l/100km", new FuelEfficiency(1, FuelEfficiencyUnit.LiterPer100Kilometers).ToString(swedishCulture)); - Assert.Equal("1 mpg (imp.)", new FuelEfficiency(1, FuelEfficiencyUnit.MilePerUkGallon).ToString(swedishCulture)); - Assert.Equal("1 mpg (U.S.)", new FuelEfficiency(1, FuelEfficiencyUnit.MilePerUsGallon).ToString(swedishCulture)); + Assert.Equal("1 km/l", new FuelEfficiency(1, FuelEfficiencyUnit.KilometerPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 l/100km", new FuelEfficiency(1, FuelEfficiencyUnit.LiterPer100Kilometers).ToString(null, swedishCulture)); + Assert.Equal("1 mpg (imp.)", new FuelEfficiency(1, FuelEfficiencyUnit.MilePerUkGallon).ToString(null, swedishCulture)); + Assert.Equal("1 mpg (U.S.)", new FuelEfficiency(1, FuelEfficiencyUnit.MilePerUsGallon).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs index 19644db7e1..055ee3f714 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatFluxTestsBase.g.cs @@ -1168,24 +1168,24 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 BTU/(h·ft²)", new HeatFlux(1, HeatFluxUnit.BtuPerHourSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 BTU/(min·ft²)", new HeatFlux(1, HeatFluxUnit.BtuPerMinuteSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 BTU/(s·ft²)", new HeatFlux(1, HeatFluxUnit.BtuPerSecondSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 BTU/(s·in²)", new HeatFlux(1, HeatFluxUnit.BtuPerSecondSquareInch).ToString(swedishCulture)); - Assert.Equal("1 cal/(s·cm²)", new HeatFlux(1, HeatFluxUnit.CaloriePerSecondSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 cW/m²", new HeatFlux(1, HeatFluxUnit.CentiwattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 dW/m²", new HeatFlux(1, HeatFluxUnit.DeciwattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kcal/(h·m²)", new HeatFlux(1, HeatFluxUnit.KilocaloriePerHourSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kcal/(s·cm²)", new HeatFlux(1, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kW/m²", new HeatFlux(1, HeatFluxUnit.KilowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 µW/m²", new HeatFlux(1, HeatFluxUnit.MicrowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mW/m²", new HeatFlux(1, HeatFluxUnit.MilliwattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 nW/m²", new HeatFlux(1, HeatFluxUnit.NanowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 lbf/(ft·s)", new HeatFlux(1, HeatFluxUnit.PoundForcePerFootSecond).ToString(swedishCulture)); - Assert.Equal("1 lb/s³", new HeatFlux(1, HeatFluxUnit.PoundPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 W/ft²", new HeatFlux(1, HeatFluxUnit.WattPerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 W/in²", new HeatFlux(1, HeatFluxUnit.WattPerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 W/m²", new HeatFlux(1, HeatFluxUnit.WattPerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 BTU/(h·ft²)", new HeatFlux(1, HeatFluxUnit.BtuPerHourSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 BTU/(min·ft²)", new HeatFlux(1, HeatFluxUnit.BtuPerMinuteSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 BTU/(s·ft²)", new HeatFlux(1, HeatFluxUnit.BtuPerSecondSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 BTU/(s·in²)", new HeatFlux(1, HeatFluxUnit.BtuPerSecondSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 cal/(s·cm²)", new HeatFlux(1, HeatFluxUnit.CaloriePerSecondSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 cW/m²", new HeatFlux(1, HeatFluxUnit.CentiwattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 dW/m²", new HeatFlux(1, HeatFluxUnit.DeciwattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/(h·m²)", new HeatFlux(1, HeatFluxUnit.KilocaloriePerHourSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/(s·cm²)", new HeatFlux(1, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/m²", new HeatFlux(1, HeatFluxUnit.KilowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µW/m²", new HeatFlux(1, HeatFluxUnit.MicrowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/m²", new HeatFlux(1, HeatFluxUnit.MilliwattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nW/m²", new HeatFlux(1, HeatFluxUnit.NanowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/(ft·s)", new HeatFlux(1, HeatFluxUnit.PoundForcePerFootSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lb/s³", new HeatFlux(1, HeatFluxUnit.PoundPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 W/ft²", new HeatFlux(1, HeatFluxUnit.WattPerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 W/in²", new HeatFlux(1, HeatFluxUnit.WattPerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 W/m²", new HeatFlux(1, HeatFluxUnit.WattPerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs index ec830a89cb..5614426900 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/HeatTransferCoefficientTestsBase.g.cs @@ -907,11 +907,11 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Btu/(h·ft²·°F)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 kcal/(h·m²·°C)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 kkcal/(h·m²·°C)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 W/(m²·°C)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius).ToString(swedishCulture)); - Assert.Equal("1 W/(m²·K)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin).ToString(swedishCulture)); + Assert.Equal("1 Btu/(h·ft²·°F)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/(h·m²·°C)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 kkcal/(h·m²·°C)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 W/(m²·°C)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 W/(m²·K)", new HeatTransferCoefficient(1, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs index 4c48288af0..7c54f83929 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IlluminanceTestsBase.g.cs @@ -673,10 +673,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 klx", new Illuminance(1, IlluminanceUnit.Kilolux).ToString(swedishCulture)); - Assert.Equal("1 lx", new Illuminance(1, IlluminanceUnit.Lux).ToString(swedishCulture)); - Assert.Equal("1 Mlx", new Illuminance(1, IlluminanceUnit.Megalux).ToString(swedishCulture)); - Assert.Equal("1 mlx", new Illuminance(1, IlluminanceUnit.Millilux).ToString(swedishCulture)); + Assert.Equal("1 klx", new Illuminance(1, IlluminanceUnit.Kilolux).ToString(null, swedishCulture)); + Assert.Equal("1 lx", new Illuminance(1, IlluminanceUnit.Lux).ToString(null, swedishCulture)); + Assert.Equal("1 Mlx", new Illuminance(1, IlluminanceUnit.Megalux).ToString(null, swedishCulture)); + Assert.Equal("1 mlx", new Illuminance(1, IlluminanceUnit.Millilux).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs index c3cb7c0ac0..a26f690c64 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ImpulseTestsBase.g.cs @@ -970,19 +970,19 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cN·s", new Impulse(1, ImpulseUnit.CentinewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 daN·s", new Impulse(1, ImpulseUnit.DecanewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 dN·s", new Impulse(1, ImpulseUnit.DecinewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 kg·m/s", new Impulse(1, ImpulseUnit.KilogramMeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kN·s", new Impulse(1, ImpulseUnit.KilonewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 MN·s", new Impulse(1, ImpulseUnit.MeganewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 µN·s", new Impulse(1, ImpulseUnit.MicronewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 mN·s", new Impulse(1, ImpulseUnit.MillinewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 nN·s", new Impulse(1, ImpulseUnit.NanonewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 N·s", new Impulse(1, ImpulseUnit.NewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 lb·ft/s", new Impulse(1, ImpulseUnit.PoundFootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 lbf·s", new Impulse(1, ImpulseUnit.PoundForceSecond).ToString(swedishCulture)); - Assert.Equal("1 slug·ft/s", new Impulse(1, ImpulseUnit.SlugFootPerSecond).ToString(swedishCulture)); + Assert.Equal("1 cN·s", new Impulse(1, ImpulseUnit.CentinewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 daN·s", new Impulse(1, ImpulseUnit.DecanewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dN·s", new Impulse(1, ImpulseUnit.DecinewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kg·m/s", new Impulse(1, ImpulseUnit.KilogramMeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kN·s", new Impulse(1, ImpulseUnit.KilonewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 MN·s", new Impulse(1, ImpulseUnit.MeganewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µN·s", new Impulse(1, ImpulseUnit.MicronewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mN·s", new Impulse(1, ImpulseUnit.MillinewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 nN·s", new Impulse(1, ImpulseUnit.NanonewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 N·s", new Impulse(1, ImpulseUnit.NewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lb·ft/s", new Impulse(1, ImpulseUnit.PoundFootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·s", new Impulse(1, ImpulseUnit.PoundForceSecond).ToString(null, swedishCulture)); + Assert.Equal("1 slug·ft/s", new Impulse(1, ImpulseUnit.SlugFootPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs index b9d4033225..d3553c54fc 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/InformationTestsBase.g.cs @@ -1624,45 +1624,45 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 b", new Information(1, InformationUnit.Bit).ToString(swedishCulture)); - Assert.Equal("1 B", new Information(1, InformationUnit.Byte).ToString(swedishCulture)); - Assert.Equal("1 Eb", new Information(1, InformationUnit.Exabit).ToString(swedishCulture)); - Assert.Equal("1 EB", new Information(1, InformationUnit.Exabyte).ToString(swedishCulture)); - Assert.Equal("1 Eo", new Information(1, InformationUnit.Exaoctet).ToString(swedishCulture)); - Assert.Equal("1 Eib", new Information(1, InformationUnit.Exbibit).ToString(swedishCulture)); - Assert.Equal("1 EiB", new Information(1, InformationUnit.Exbibyte).ToString(swedishCulture)); - Assert.Equal("1 Eio", new Information(1, InformationUnit.Exbioctet).ToString(swedishCulture)); - Assert.Equal("1 Gib", new Information(1, InformationUnit.Gibibit).ToString(swedishCulture)); - Assert.Equal("1 GiB", new Information(1, InformationUnit.Gibibyte).ToString(swedishCulture)); - Assert.Equal("1 Gio", new Information(1, InformationUnit.Gibioctet).ToString(swedishCulture)); - Assert.Equal("1 Gb", new Information(1, InformationUnit.Gigabit).ToString(swedishCulture)); - Assert.Equal("1 GB", new Information(1, InformationUnit.Gigabyte).ToString(swedishCulture)); - Assert.Equal("1 Go", new Information(1, InformationUnit.Gigaoctet).ToString(swedishCulture)); - Assert.Equal("1 Kib", new Information(1, InformationUnit.Kibibit).ToString(swedishCulture)); - Assert.Equal("1 KiB", new Information(1, InformationUnit.Kibibyte).ToString(swedishCulture)); - Assert.Equal("1 Kio", new Information(1, InformationUnit.Kibioctet).ToString(swedishCulture)); - Assert.Equal("1 kb", new Information(1, InformationUnit.Kilobit).ToString(swedishCulture)); - Assert.Equal("1 kB", new Information(1, InformationUnit.Kilobyte).ToString(swedishCulture)); - Assert.Equal("1 ko", new Information(1, InformationUnit.Kilooctet).ToString(swedishCulture)); - Assert.Equal("1 Mib", new Information(1, InformationUnit.Mebibit).ToString(swedishCulture)); - Assert.Equal("1 MiB", new Information(1, InformationUnit.Mebibyte).ToString(swedishCulture)); - Assert.Equal("1 Mio", new Information(1, InformationUnit.Mebioctet).ToString(swedishCulture)); - Assert.Equal("1 Mb", new Information(1, InformationUnit.Megabit).ToString(swedishCulture)); - Assert.Equal("1 MB", new Information(1, InformationUnit.Megabyte).ToString(swedishCulture)); - Assert.Equal("1 Mo", new Information(1, InformationUnit.Megaoctet).ToString(swedishCulture)); - Assert.Equal("1 o", new Information(1, InformationUnit.Octet).ToString(swedishCulture)); - Assert.Equal("1 Pib", new Information(1, InformationUnit.Pebibit).ToString(swedishCulture)); - Assert.Equal("1 PiB", new Information(1, InformationUnit.Pebibyte).ToString(swedishCulture)); - Assert.Equal("1 Pio", new Information(1, InformationUnit.Pebioctet).ToString(swedishCulture)); - Assert.Equal("1 Pb", new Information(1, InformationUnit.Petabit).ToString(swedishCulture)); - Assert.Equal("1 PB", new Information(1, InformationUnit.Petabyte).ToString(swedishCulture)); - Assert.Equal("1 Po", new Information(1, InformationUnit.Petaoctet).ToString(swedishCulture)); - Assert.Equal("1 Tib", new Information(1, InformationUnit.Tebibit).ToString(swedishCulture)); - Assert.Equal("1 TiB", new Information(1, InformationUnit.Tebibyte).ToString(swedishCulture)); - Assert.Equal("1 Tio", new Information(1, InformationUnit.Tebioctet).ToString(swedishCulture)); - Assert.Equal("1 Tb", new Information(1, InformationUnit.Terabit).ToString(swedishCulture)); - Assert.Equal("1 TB", new Information(1, InformationUnit.Terabyte).ToString(swedishCulture)); - Assert.Equal("1 To", new Information(1, InformationUnit.Teraoctet).ToString(swedishCulture)); + Assert.Equal("1 b", new Information(1, InformationUnit.Bit).ToString(null, swedishCulture)); + Assert.Equal("1 B", new Information(1, InformationUnit.Byte).ToString(null, swedishCulture)); + Assert.Equal("1 Eb", new Information(1, InformationUnit.Exabit).ToString(null, swedishCulture)); + Assert.Equal("1 EB", new Information(1, InformationUnit.Exabyte).ToString(null, swedishCulture)); + Assert.Equal("1 Eo", new Information(1, InformationUnit.Exaoctet).ToString(null, swedishCulture)); + Assert.Equal("1 Eib", new Information(1, InformationUnit.Exbibit).ToString(null, swedishCulture)); + Assert.Equal("1 EiB", new Information(1, InformationUnit.Exbibyte).ToString(null, swedishCulture)); + Assert.Equal("1 Eio", new Information(1, InformationUnit.Exbioctet).ToString(null, swedishCulture)); + Assert.Equal("1 Gib", new Information(1, InformationUnit.Gibibit).ToString(null, swedishCulture)); + Assert.Equal("1 GiB", new Information(1, InformationUnit.Gibibyte).ToString(null, swedishCulture)); + Assert.Equal("1 Gio", new Information(1, InformationUnit.Gibioctet).ToString(null, swedishCulture)); + Assert.Equal("1 Gb", new Information(1, InformationUnit.Gigabit).ToString(null, swedishCulture)); + Assert.Equal("1 GB", new Information(1, InformationUnit.Gigabyte).ToString(null, swedishCulture)); + Assert.Equal("1 Go", new Information(1, InformationUnit.Gigaoctet).ToString(null, swedishCulture)); + Assert.Equal("1 Kib", new Information(1, InformationUnit.Kibibit).ToString(null, swedishCulture)); + Assert.Equal("1 KiB", new Information(1, InformationUnit.Kibibyte).ToString(null, swedishCulture)); + Assert.Equal("1 Kio", new Information(1, InformationUnit.Kibioctet).ToString(null, swedishCulture)); + Assert.Equal("1 kb", new Information(1, InformationUnit.Kilobit).ToString(null, swedishCulture)); + Assert.Equal("1 kB", new Information(1, InformationUnit.Kilobyte).ToString(null, swedishCulture)); + Assert.Equal("1 ko", new Information(1, InformationUnit.Kilooctet).ToString(null, swedishCulture)); + Assert.Equal("1 Mib", new Information(1, InformationUnit.Mebibit).ToString(null, swedishCulture)); + Assert.Equal("1 MiB", new Information(1, InformationUnit.Mebibyte).ToString(null, swedishCulture)); + Assert.Equal("1 Mio", new Information(1, InformationUnit.Mebioctet).ToString(null, swedishCulture)); + Assert.Equal("1 Mb", new Information(1, InformationUnit.Megabit).ToString(null, swedishCulture)); + Assert.Equal("1 MB", new Information(1, InformationUnit.Megabyte).ToString(null, swedishCulture)); + Assert.Equal("1 Mo", new Information(1, InformationUnit.Megaoctet).ToString(null, swedishCulture)); + Assert.Equal("1 o", new Information(1, InformationUnit.Octet).ToString(null, swedishCulture)); + Assert.Equal("1 Pib", new Information(1, InformationUnit.Pebibit).ToString(null, swedishCulture)); + Assert.Equal("1 PiB", new Information(1, InformationUnit.Pebibyte).ToString(null, swedishCulture)); + Assert.Equal("1 Pio", new Information(1, InformationUnit.Pebioctet).ToString(null, swedishCulture)); + Assert.Equal("1 Pb", new Information(1, InformationUnit.Petabit).ToString(null, swedishCulture)); + Assert.Equal("1 PB", new Information(1, InformationUnit.Petabyte).ToString(null, swedishCulture)); + Assert.Equal("1 Po", new Information(1, InformationUnit.Petaoctet).ToString(null, swedishCulture)); + Assert.Equal("1 Tib", new Information(1, InformationUnit.Tebibit).ToString(null, swedishCulture)); + Assert.Equal("1 TiB", new Information(1, InformationUnit.Tebibyte).ToString(null, swedishCulture)); + Assert.Equal("1 Tio", new Information(1, InformationUnit.Tebioctet).ToString(null, swedishCulture)); + Assert.Equal("1 Tb", new Information(1, InformationUnit.Terabit).ToString(null, swedishCulture)); + Assert.Equal("1 TB", new Information(1, InformationUnit.Terabyte).ToString(null, swedishCulture)); + Assert.Equal("1 To", new Information(1, InformationUnit.Teraoctet).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs index 4d83f72100..9a84ca750f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradianceTestsBase.g.cs @@ -991,20 +991,20 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kW/cm²", new Irradiance(1, IrradianceUnit.KilowattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kW/m²", new Irradiance(1, IrradianceUnit.KilowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 MW/cm²", new Irradiance(1, IrradianceUnit.MegawattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 MW/m²", new Irradiance(1, IrradianceUnit.MegawattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 µW/cm²", new Irradiance(1, IrradianceUnit.MicrowattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 µW/m²", new Irradiance(1, IrradianceUnit.MicrowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mW/cm²", new Irradiance(1, IrradianceUnit.MilliwattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mW/m²", new Irradiance(1, IrradianceUnit.MilliwattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 nW/cm²", new Irradiance(1, IrradianceUnit.NanowattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 nW/m²", new Irradiance(1, IrradianceUnit.NanowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 pW/cm²", new Irradiance(1, IrradianceUnit.PicowattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 pW/m²", new Irradiance(1, IrradianceUnit.PicowattPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 W/cm²", new Irradiance(1, IrradianceUnit.WattPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 W/m²", new Irradiance(1, IrradianceUnit.WattPerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 kW/cm²", new Irradiance(1, IrradianceUnit.KilowattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/m²", new Irradiance(1, IrradianceUnit.KilowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/cm²", new Irradiance(1, IrradianceUnit.MegawattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/m²", new Irradiance(1, IrradianceUnit.MegawattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µW/cm²", new Irradiance(1, IrradianceUnit.MicrowattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µW/m²", new Irradiance(1, IrradianceUnit.MicrowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/cm²", new Irradiance(1, IrradianceUnit.MilliwattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/m²", new Irradiance(1, IrradianceUnit.MilliwattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nW/cm²", new Irradiance(1, IrradianceUnit.NanowattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 nW/m²", new Irradiance(1, IrradianceUnit.NanowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 pW/cm²", new Irradiance(1, IrradianceUnit.PicowattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 pW/m²", new Irradiance(1, IrradianceUnit.PicowattPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 W/cm²", new Irradiance(1, IrradianceUnit.WattPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 W/m²", new Irradiance(1, IrradianceUnit.WattPerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs index edb74a3ab9..ce5e6225c3 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/IrradiationTestsBase.g.cs @@ -850,15 +850,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Btu/ft²", new Irradiation(1, IrradiationUnit.BtuPerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 J/cm²", new Irradiation(1, IrradiationUnit.JoulePerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 J/m²", new Irradiation(1, IrradiationUnit.JoulePerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 J/mm²", new Irradiation(1, IrradiationUnit.JoulePerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kBtu/ft²", new Irradiation(1, IrradiationUnit.KilobtuPerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 kJ/m²", new Irradiation(1, IrradiationUnit.KilojoulePerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kWh/m²", new Irradiation(1, IrradiationUnit.KilowattHourPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mJ/cm²", new Irradiation(1, IrradiationUnit.MillijoulePerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 Wh/m²", new Irradiation(1, IrradiationUnit.WattHourPerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 Btu/ft²", new Irradiation(1, IrradiationUnit.BtuPerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 J/cm²", new Irradiation(1, IrradiationUnit.JoulePerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 J/m²", new Irradiation(1, IrradiationUnit.JoulePerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 J/mm²", new Irradiation(1, IrradiationUnit.JoulePerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kBtu/ft²", new Irradiation(1, IrradiationUnit.KilobtuPerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/m²", new Irradiation(1, IrradiationUnit.KilojoulePerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kWh/m²", new Irradiation(1, IrradiationUnit.KilowattHourPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mJ/cm²", new Irradiation(1, IrradiationUnit.MillijoulePerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Wh/m²", new Irradiation(1, IrradiationUnit.WattHourPerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs index 96692af73c..d01cc6d025 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/JerkTestsBase.g.cs @@ -1103,17 +1103,17 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm/s³", new Jerk(1, JerkUnit.CentimeterPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 dm/s³", new Jerk(1, JerkUnit.DecimeterPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 ft/s³", new Jerk(1, JerkUnit.FootPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 in/s³", new Jerk(1, JerkUnit.InchPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 km/s³", new Jerk(1, JerkUnit.KilometerPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 m/s³", new Jerk(1, JerkUnit.MeterPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 µm/s³", new Jerk(1, JerkUnit.MicrometerPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 mm/s³", new Jerk(1, JerkUnit.MillimeterPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 mg/s", new Jerk(1, JerkUnit.MillistandardGravitiesPerSecond).ToString(swedishCulture)); - Assert.Equal("1 nm/s³", new Jerk(1, JerkUnit.NanometerPerSecondCubed).ToString(swedishCulture)); - Assert.Equal("1 g/s", new Jerk(1, JerkUnit.StandardGravitiesPerSecond).ToString(swedishCulture)); + Assert.Equal("1 cm/s³", new Jerk(1, JerkUnit.CentimeterPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 dm/s³", new Jerk(1, JerkUnit.DecimeterPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 ft/s³", new Jerk(1, JerkUnit.FootPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 in/s³", new Jerk(1, JerkUnit.InchPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 km/s³", new Jerk(1, JerkUnit.KilometerPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 m/s³", new Jerk(1, JerkUnit.MeterPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 µm/s³", new Jerk(1, JerkUnit.MicrometerPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 mm/s³", new Jerk(1, JerkUnit.MillimeterPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 mg/s", new Jerk(1, JerkUnit.MillistandardGravitiesPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 nm/s³", new Jerk(1, JerkUnit.NanometerPerSecondCubed).ToString(null, swedishCulture)); + Assert.Equal("1 g/s", new Jerk(1, JerkUnit.StandardGravitiesPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs index 00c7b1eb0e..c6964ee7f1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/KinematicViscosityTestsBase.g.cs @@ -986,15 +986,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cSt", new KinematicViscosity(1, KinematicViscosityUnit.Centistokes).ToString(swedishCulture)); - Assert.Equal("1 dSt", new KinematicViscosity(1, KinematicViscosityUnit.Decistokes).ToString(swedishCulture)); - Assert.Equal("1 kSt", new KinematicViscosity(1, KinematicViscosityUnit.Kilostokes).ToString(swedishCulture)); - Assert.Equal("1 µSt", new KinematicViscosity(1, KinematicViscosityUnit.Microstokes).ToString(swedishCulture)); - Assert.Equal("1 mSt", new KinematicViscosity(1, KinematicViscosityUnit.Millistokes).ToString(swedishCulture)); - Assert.Equal("1 nSt", new KinematicViscosity(1, KinematicViscosityUnit.Nanostokes).ToString(swedishCulture)); - Assert.Equal("1 ft²/s", new KinematicViscosity(1, KinematicViscosityUnit.SquareFootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 m²/s", new KinematicViscosity(1, KinematicViscosityUnit.SquareMeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 St", new KinematicViscosity(1, KinematicViscosityUnit.Stokes).ToString(swedishCulture)); + Assert.Equal("1 cSt", new KinematicViscosity(1, KinematicViscosityUnit.Centistokes).ToString(null, swedishCulture)); + Assert.Equal("1 dSt", new KinematicViscosity(1, KinematicViscosityUnit.Decistokes).ToString(null, swedishCulture)); + Assert.Equal("1 kSt", new KinematicViscosity(1, KinematicViscosityUnit.Kilostokes).ToString(null, swedishCulture)); + Assert.Equal("1 µSt", new KinematicViscosity(1, KinematicViscosityUnit.Microstokes).ToString(null, swedishCulture)); + Assert.Equal("1 mSt", new KinematicViscosity(1, KinematicViscosityUnit.Millistokes).ToString(null, swedishCulture)); + Assert.Equal("1 nSt", new KinematicViscosity(1, KinematicViscosityUnit.Nanostokes).ToString(null, swedishCulture)); + Assert.Equal("1 ft²/s", new KinematicViscosity(1, KinematicViscosityUnit.SquareFootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 m²/s", new KinematicViscosity(1, KinematicViscosityUnit.SquareMeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 St", new KinematicViscosity(1, KinematicViscosityUnit.Stokes).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs index 637fe4e754..580d06e712 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LeakRateTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 mbar·l/s", new LeakRate(1, LeakRateUnit.MillibarLiterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Pa·m³/s", new LeakRate(1, LeakRateUnit.PascalCubicMeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Torr·l/s", new LeakRate(1, LeakRateUnit.TorrLiterPerSecond).ToString(swedishCulture)); + Assert.Equal("1 mbar·l/s", new LeakRate(1, LeakRateUnit.MillibarLiterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Pa·m³/s", new LeakRate(1, LeakRateUnit.PascalCubicMeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Torr·l/s", new LeakRate(1, LeakRateUnit.TorrLiterPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs index 3421251e86..86d8be95af 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LengthTestsBase.g.cs @@ -2761,48 +2761,48 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Å", new Length(1, LengthUnit.Angstrom).ToString(swedishCulture)); - Assert.Equal("1 au", new Length(1, LengthUnit.AstronomicalUnit).ToString(swedishCulture)); - Assert.Equal("1 cm", new Length(1, LengthUnit.Centimeter).ToString(swedishCulture)); - Assert.Equal("1 ch", new Length(1, LengthUnit.Chain).ToString(swedishCulture)); - Assert.Equal("1 DM", new Length(1, LengthUnit.DataMile).ToString(swedishCulture)); - Assert.Equal("1 dam", new Length(1, LengthUnit.Decameter).ToString(swedishCulture)); - Assert.Equal("1 dm", new Length(1, LengthUnit.Decimeter).ToString(swedishCulture)); - Assert.Equal("1 pica", new Length(1, LengthUnit.DtpPica).ToString(swedishCulture)); - Assert.Equal("1 pt", new Length(1, LengthUnit.DtpPoint).ToString(swedishCulture)); - Assert.Equal("1 fathom", new Length(1, LengthUnit.Fathom).ToString(swedishCulture)); - Assert.Equal("1 fm", new Length(1, LengthUnit.Femtometer).ToString(swedishCulture)); - Assert.Equal("1 ft", new Length(1, LengthUnit.Foot).ToString(swedishCulture)); - Assert.Equal("1 Gm", new Length(1, LengthUnit.Gigameter).ToString(swedishCulture)); - Assert.Equal("1 h", new Length(1, LengthUnit.Hand).ToString(swedishCulture)); - Assert.Equal("1 hm", new Length(1, LengthUnit.Hectometer).ToString(swedishCulture)); - Assert.Equal("1 in", new Length(1, LengthUnit.Inch).ToString(swedishCulture)); - Assert.Equal("1 kft", new Length(1, LengthUnit.Kilofoot).ToString(swedishCulture)); - Assert.Equal("1 kly", new Length(1, LengthUnit.KilolightYear).ToString(swedishCulture)); - Assert.Equal("1 km", new Length(1, LengthUnit.Kilometer).ToString(swedishCulture)); - Assert.Equal("1 kpc", new Length(1, LengthUnit.Kiloparsec).ToString(swedishCulture)); - Assert.Equal("1 kyd", new Length(1, LengthUnit.Kiloyard).ToString(swedishCulture)); - Assert.Equal("1 ly", new Length(1, LengthUnit.LightYear).ToString(swedishCulture)); - Assert.Equal("1 Mly", new Length(1, LengthUnit.MegalightYear).ToString(swedishCulture)); - Assert.Equal("1 Mm", new Length(1, LengthUnit.Megameter).ToString(swedishCulture)); - Assert.Equal("1 Mpc", new Length(1, LengthUnit.Megaparsec).ToString(swedishCulture)); - Assert.Equal("1 m", new Length(1, LengthUnit.Meter).ToString(swedishCulture)); - Assert.Equal("1 µin", new Length(1, LengthUnit.Microinch).ToString(swedishCulture)); - Assert.Equal("1 µm", new Length(1, LengthUnit.Micrometer).ToString(swedishCulture)); - Assert.Equal("1 mil", new Length(1, LengthUnit.Mil).ToString(swedishCulture)); - Assert.Equal("1 mi", new Length(1, LengthUnit.Mile).ToString(swedishCulture)); - Assert.Equal("1 mm", new Length(1, LengthUnit.Millimeter).ToString(swedishCulture)); - Assert.Equal("1 nm", new Length(1, LengthUnit.Nanometer).ToString(swedishCulture)); - Assert.Equal("1 NM", new Length(1, LengthUnit.NauticalMile).ToString(swedishCulture)); - Assert.Equal("1 pc", new Length(1, LengthUnit.Parsec).ToString(swedishCulture)); - Assert.Equal("1 pm", new Length(1, LengthUnit.Picometer).ToString(swedishCulture)); - Assert.Equal("1 pica", new Length(1, LengthUnit.PrinterPica).ToString(swedishCulture)); - Assert.Equal("1 pt", new Length(1, LengthUnit.PrinterPoint).ToString(swedishCulture)); - Assert.Equal("1 shackle", new Length(1, LengthUnit.Shackle).ToString(swedishCulture)); - Assert.Equal("1 R⊙", new Length(1, LengthUnit.SolarRadius).ToString(swedishCulture)); - Assert.Equal("1 twip", new Length(1, LengthUnit.Twip).ToString(swedishCulture)); - Assert.Equal("1 ftUS", new Length(1, LengthUnit.UsSurveyFoot).ToString(swedishCulture)); - Assert.Equal("1 yd", new Length(1, LengthUnit.Yard).ToString(swedishCulture)); + Assert.Equal("1 Å", new Length(1, LengthUnit.Angstrom).ToString(null, swedishCulture)); + Assert.Equal("1 au", new Length(1, LengthUnit.AstronomicalUnit).ToString(null, swedishCulture)); + Assert.Equal("1 cm", new Length(1, LengthUnit.Centimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ch", new Length(1, LengthUnit.Chain).ToString(null, swedishCulture)); + Assert.Equal("1 DM", new Length(1, LengthUnit.DataMile).ToString(null, swedishCulture)); + Assert.Equal("1 dam", new Length(1, LengthUnit.Decameter).ToString(null, swedishCulture)); + Assert.Equal("1 dm", new Length(1, LengthUnit.Decimeter).ToString(null, swedishCulture)); + Assert.Equal("1 pica", new Length(1, LengthUnit.DtpPica).ToString(null, swedishCulture)); + Assert.Equal("1 pt", new Length(1, LengthUnit.DtpPoint).ToString(null, swedishCulture)); + Assert.Equal("1 fathom", new Length(1, LengthUnit.Fathom).ToString(null, swedishCulture)); + Assert.Equal("1 fm", new Length(1, LengthUnit.Femtometer).ToString(null, swedishCulture)); + Assert.Equal("1 ft", new Length(1, LengthUnit.Foot).ToString(null, swedishCulture)); + Assert.Equal("1 Gm", new Length(1, LengthUnit.Gigameter).ToString(null, swedishCulture)); + Assert.Equal("1 h", new Length(1, LengthUnit.Hand).ToString(null, swedishCulture)); + Assert.Equal("1 hm", new Length(1, LengthUnit.Hectometer).ToString(null, swedishCulture)); + Assert.Equal("1 in", new Length(1, LengthUnit.Inch).ToString(null, swedishCulture)); + Assert.Equal("1 kft", new Length(1, LengthUnit.Kilofoot).ToString(null, swedishCulture)); + Assert.Equal("1 kly", new Length(1, LengthUnit.KilolightYear).ToString(null, swedishCulture)); + Assert.Equal("1 km", new Length(1, LengthUnit.Kilometer).ToString(null, swedishCulture)); + Assert.Equal("1 kpc", new Length(1, LengthUnit.Kiloparsec).ToString(null, swedishCulture)); + Assert.Equal("1 kyd", new Length(1, LengthUnit.Kiloyard).ToString(null, swedishCulture)); + Assert.Equal("1 ly", new Length(1, LengthUnit.LightYear).ToString(null, swedishCulture)); + Assert.Equal("1 Mly", new Length(1, LengthUnit.MegalightYear).ToString(null, swedishCulture)); + Assert.Equal("1 Mm", new Length(1, LengthUnit.Megameter).ToString(null, swedishCulture)); + Assert.Equal("1 Mpc", new Length(1, LengthUnit.Megaparsec).ToString(null, swedishCulture)); + Assert.Equal("1 m", new Length(1, LengthUnit.Meter).ToString(null, swedishCulture)); + Assert.Equal("1 µin", new Length(1, LengthUnit.Microinch).ToString(null, swedishCulture)); + Assert.Equal("1 µm", new Length(1, LengthUnit.Micrometer).ToString(null, swedishCulture)); + Assert.Equal("1 mil", new Length(1, LengthUnit.Mil).ToString(null, swedishCulture)); + Assert.Equal("1 mi", new Length(1, LengthUnit.Mile).ToString(null, swedishCulture)); + Assert.Equal("1 mm", new Length(1, LengthUnit.Millimeter).ToString(null, swedishCulture)); + Assert.Equal("1 nm", new Length(1, LengthUnit.Nanometer).ToString(null, swedishCulture)); + Assert.Equal("1 NM", new Length(1, LengthUnit.NauticalMile).ToString(null, swedishCulture)); + Assert.Equal("1 pc", new Length(1, LengthUnit.Parsec).ToString(null, swedishCulture)); + Assert.Equal("1 pm", new Length(1, LengthUnit.Picometer).ToString(null, swedishCulture)); + Assert.Equal("1 pica", new Length(1, LengthUnit.PrinterPica).ToString(null, swedishCulture)); + Assert.Equal("1 pt", new Length(1, LengthUnit.PrinterPoint).ToString(null, swedishCulture)); + Assert.Equal("1 shackle", new Length(1, LengthUnit.Shackle).ToString(null, swedishCulture)); + Assert.Equal("1 R⊙", new Length(1, LengthUnit.SolarRadius).ToString(null, swedishCulture)); + Assert.Equal("1 twip", new Length(1, LengthUnit.Twip).ToString(null, swedishCulture)); + Assert.Equal("1 ftUS", new Length(1, LengthUnit.UsSurveyFoot).ToString(null, swedishCulture)); + Assert.Equal("1 yd", new Length(1, LengthUnit.Yard).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs index 2fdb75ab65..8321d9e7c0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LevelTestsBase.g.cs @@ -563,8 +563,8 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 dB", new Level(1, LevelUnit.Decibel).ToString(swedishCulture)); - Assert.Equal("1 Np", new Level(1, LevelUnit.Neper).ToString(swedishCulture)); + Assert.Equal("1 dB", new Level(1, LevelUnit.Decibel).ToString(null, swedishCulture)); + Assert.Equal("1 Np", new Level(1, LevelUnit.Neper).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs index ba684bfcad..55f9242067 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearDensityTestsBase.g.cs @@ -1147,24 +1147,24 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 g/cm", new LinearDensity(1, LinearDensityUnit.GramPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 g/ft", new LinearDensity(1, LinearDensityUnit.GramPerFoot).ToString(swedishCulture)); - Assert.Equal("1 g/m", new LinearDensity(1, LinearDensityUnit.GramPerMeter).ToString(swedishCulture)); - Assert.Equal("1 g/mm", new LinearDensity(1, LinearDensityUnit.GramPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kg/cm", new LinearDensity(1, LinearDensityUnit.KilogramPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kg/ft", new LinearDensity(1, LinearDensityUnit.KilogramPerFoot).ToString(swedishCulture)); - Assert.Equal("1 kg/m", new LinearDensity(1, LinearDensityUnit.KilogramPerMeter).ToString(swedishCulture)); - Assert.Equal("1 kg/mm", new LinearDensity(1, LinearDensityUnit.KilogramPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 µg/cm", new LinearDensity(1, LinearDensityUnit.MicrogramPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 µg/ft", new LinearDensity(1, LinearDensityUnit.MicrogramPerFoot).ToString(swedishCulture)); - Assert.Equal("1 µg/m", new LinearDensity(1, LinearDensityUnit.MicrogramPerMeter).ToString(swedishCulture)); - Assert.Equal("1 µg/mm", new LinearDensity(1, LinearDensityUnit.MicrogramPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 mg/cm", new LinearDensity(1, LinearDensityUnit.MilligramPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mg/ft", new LinearDensity(1, LinearDensityUnit.MilligramPerFoot).ToString(swedishCulture)); - Assert.Equal("1 mg/m", new LinearDensity(1, LinearDensityUnit.MilligramPerMeter).ToString(swedishCulture)); - Assert.Equal("1 mg/mm", new LinearDensity(1, LinearDensityUnit.MilligramPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 lb/ft", new LinearDensity(1, LinearDensityUnit.PoundPerFoot).ToString(swedishCulture)); - Assert.Equal("1 lb/in", new LinearDensity(1, LinearDensityUnit.PoundPerInch).ToString(swedishCulture)); + Assert.Equal("1 g/cm", new LinearDensity(1, LinearDensityUnit.GramPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/ft", new LinearDensity(1, LinearDensityUnit.GramPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 g/m", new LinearDensity(1, LinearDensityUnit.GramPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/mm", new LinearDensity(1, LinearDensityUnit.GramPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/cm", new LinearDensity(1, LinearDensityUnit.KilogramPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/ft", new LinearDensity(1, LinearDensityUnit.KilogramPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kg/m", new LinearDensity(1, LinearDensityUnit.KilogramPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/mm", new LinearDensity(1, LinearDensityUnit.KilogramPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/cm", new LinearDensity(1, LinearDensityUnit.MicrogramPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/ft", new LinearDensity(1, LinearDensityUnit.MicrogramPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 µg/m", new LinearDensity(1, LinearDensityUnit.MicrogramPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/mm", new LinearDensity(1, LinearDensityUnit.MicrogramPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/cm", new LinearDensity(1, LinearDensityUnit.MilligramPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/ft", new LinearDensity(1, LinearDensityUnit.MilligramPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 mg/m", new LinearDensity(1, LinearDensityUnit.MilligramPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/mm", new LinearDensity(1, LinearDensityUnit.MilligramPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 lb/ft", new LinearDensity(1, LinearDensityUnit.PoundPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lb/in", new LinearDensity(1, LinearDensityUnit.PoundPerInch).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs index 9f8d726645..a4b4c0f310 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LinearPowerDensityTestsBase.g.cs @@ -1318,31 +1318,31 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 GW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 GW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerFoot).ToString(swedishCulture)); - Assert.Equal("1 GW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerInch).ToString(swedishCulture)); - Assert.Equal("1 GW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerMeter).ToString(swedishCulture)); - Assert.Equal("1 GW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerFoot).ToString(swedishCulture)); - Assert.Equal("1 kW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerInch).ToString(swedishCulture)); - Assert.Equal("1 kW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerMeter).ToString(swedishCulture)); - Assert.Equal("1 kW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 MW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 MW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerFoot).ToString(swedishCulture)); - Assert.Equal("1 MW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerInch).ToString(swedishCulture)); - Assert.Equal("1 MW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerMeter).ToString(swedishCulture)); - Assert.Equal("1 MW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 mW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerFoot).ToString(swedishCulture)); - Assert.Equal("1 mW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerInch).ToString(swedishCulture)); - Assert.Equal("1 mW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerMeter).ToString(swedishCulture)); - Assert.Equal("1 mW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 W/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerCentimeter).ToString(swedishCulture)); - Assert.Equal("1 W/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerFoot).ToString(swedishCulture)); - Assert.Equal("1 W/in", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerInch).ToString(swedishCulture)); - Assert.Equal("1 W/m", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerMeter).ToString(swedishCulture)); - Assert.Equal("1 W/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerMillimeter).ToString(swedishCulture)); + Assert.Equal("1 GW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 GW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 GW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerInch).ToString(null, swedishCulture)); + Assert.Equal("1 GW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 GW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.GigawattPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerInch).ToString(null, swedishCulture)); + Assert.Equal("1 kW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.KilowattPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 MW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerInch).ToString(null, swedishCulture)); + Assert.Equal("1 MW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.MegawattPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 mW/in", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerInch).ToString(null, swedishCulture)); + Assert.Equal("1 mW/m", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.MilliwattPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 W/cm", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 W/ft", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 W/in", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerInch).ToString(null, swedishCulture)); + Assert.Equal("1 W/m", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 W/mm", new LinearPowerDensity(1, LinearPowerDensityUnit.WattPerMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs index cbc32fbaa1..341d720403 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminanceTestsBase.g.cs @@ -883,16 +883,16 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Cd/ft²", new Luminance(1, LuminanceUnit.CandelaPerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 Cd/in²", new Luminance(1, LuminanceUnit.CandelaPerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 Cd/m²", new Luminance(1, LuminanceUnit.CandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 cCd/m²", new Luminance(1, LuminanceUnit.CenticandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 dCd/m²", new Luminance(1, LuminanceUnit.DecicandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kCd/m²", new Luminance(1, LuminanceUnit.KilocandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 µCd/m²", new Luminance(1, LuminanceUnit.MicrocandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mCd/m²", new Luminance(1, LuminanceUnit.MillicandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 nCd/m²", new Luminance(1, LuminanceUnit.NanocandelaPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 nt", new Luminance(1, LuminanceUnit.Nit).ToString(swedishCulture)); + Assert.Equal("1 Cd/ft²", new Luminance(1, LuminanceUnit.CandelaPerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 Cd/in²", new Luminance(1, LuminanceUnit.CandelaPerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 Cd/m²", new Luminance(1, LuminanceUnit.CandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 cCd/m²", new Luminance(1, LuminanceUnit.CenticandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 dCd/m²", new Luminance(1, LuminanceUnit.DecicandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kCd/m²", new Luminance(1, LuminanceUnit.KilocandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µCd/m²", new Luminance(1, LuminanceUnit.MicrocandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mCd/m²", new Luminance(1, LuminanceUnit.MillicandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nCd/m²", new Luminance(1, LuminanceUnit.NanocandelaPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nt", new Luminance(1, LuminanceUnit.Nit).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs index 05625e1253..40b61670ff 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminosityTestsBase.g.cs @@ -991,20 +991,20 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 daW", new Luminosity(1, LuminosityUnit.Decawatt).ToString(swedishCulture)); - Assert.Equal("1 dW", new Luminosity(1, LuminosityUnit.Deciwatt).ToString(swedishCulture)); - Assert.Equal("1 fW", new Luminosity(1, LuminosityUnit.Femtowatt).ToString(swedishCulture)); - Assert.Equal("1 GW", new Luminosity(1, LuminosityUnit.Gigawatt).ToString(swedishCulture)); - Assert.Equal("1 kW", new Luminosity(1, LuminosityUnit.Kilowatt).ToString(swedishCulture)); - Assert.Equal("1 MW", new Luminosity(1, LuminosityUnit.Megawatt).ToString(swedishCulture)); - Assert.Equal("1 µW", new Luminosity(1, LuminosityUnit.Microwatt).ToString(swedishCulture)); - Assert.Equal("1 mW", new Luminosity(1, LuminosityUnit.Milliwatt).ToString(swedishCulture)); - Assert.Equal("1 nW", new Luminosity(1, LuminosityUnit.Nanowatt).ToString(swedishCulture)); - Assert.Equal("1 PW", new Luminosity(1, LuminosityUnit.Petawatt).ToString(swedishCulture)); - Assert.Equal("1 pW", new Luminosity(1, LuminosityUnit.Picowatt).ToString(swedishCulture)); - Assert.Equal("1 L⊙", new Luminosity(1, LuminosityUnit.SolarLuminosity).ToString(swedishCulture)); - Assert.Equal("1 TW", new Luminosity(1, LuminosityUnit.Terawatt).ToString(swedishCulture)); - Assert.Equal("1 W", new Luminosity(1, LuminosityUnit.Watt).ToString(swedishCulture)); + Assert.Equal("1 daW", new Luminosity(1, LuminosityUnit.Decawatt).ToString(null, swedishCulture)); + Assert.Equal("1 dW", new Luminosity(1, LuminosityUnit.Deciwatt).ToString(null, swedishCulture)); + Assert.Equal("1 fW", new Luminosity(1, LuminosityUnit.Femtowatt).ToString(null, swedishCulture)); + Assert.Equal("1 GW", new Luminosity(1, LuminosityUnit.Gigawatt).ToString(null, swedishCulture)); + Assert.Equal("1 kW", new Luminosity(1, LuminosityUnit.Kilowatt).ToString(null, swedishCulture)); + Assert.Equal("1 MW", new Luminosity(1, LuminosityUnit.Megawatt).ToString(null, swedishCulture)); + Assert.Equal("1 µW", new Luminosity(1, LuminosityUnit.Microwatt).ToString(null, swedishCulture)); + Assert.Equal("1 mW", new Luminosity(1, LuminosityUnit.Milliwatt).ToString(null, swedishCulture)); + Assert.Equal("1 nW", new Luminosity(1, LuminosityUnit.Nanowatt).ToString(null, swedishCulture)); + Assert.Equal("1 PW", new Luminosity(1, LuminosityUnit.Petawatt).ToString(null, swedishCulture)); + Assert.Equal("1 pW", new Luminosity(1, LuminosityUnit.Picowatt).ToString(null, swedishCulture)); + Assert.Equal("1 L⊙", new Luminosity(1, LuminosityUnit.SolarLuminosity).ToString(null, swedishCulture)); + Assert.Equal("1 TW", new Luminosity(1, LuminosityUnit.Terawatt).ToString(null, swedishCulture)); + Assert.Equal("1 W", new Luminosity(1, LuminosityUnit.Watt).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs index 172fdc443c..c061b73bc6 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousFluxTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 lm", new LuminousFlux(1, LuminousFluxUnit.Lumen).ToString(swedishCulture)); + Assert.Equal("1 lm", new LuminousFlux(1, LuminousFluxUnit.Lumen).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs index 9d467d3e1d..7cde0c974b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/LuminousIntensityTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cd", new LuminousIntensity(1, LuminousIntensityUnit.Candela).ToString(swedishCulture)); + Assert.Equal("1 cd", new LuminousIntensity(1, LuminousIntensityUnit.Candela).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs index 770cc84d20..9fe54e061e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFieldTestsBase.g.cs @@ -751,12 +751,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 G", new MagneticField(1, MagneticFieldUnit.Gauss).ToString(swedishCulture)); - Assert.Equal("1 µT", new MagneticField(1, MagneticFieldUnit.Microtesla).ToString(swedishCulture)); - Assert.Equal("1 mG", new MagneticField(1, MagneticFieldUnit.Milligauss).ToString(swedishCulture)); - Assert.Equal("1 mT", new MagneticField(1, MagneticFieldUnit.Millitesla).ToString(swedishCulture)); - Assert.Equal("1 nT", new MagneticField(1, MagneticFieldUnit.Nanotesla).ToString(swedishCulture)); - Assert.Equal("1 T", new MagneticField(1, MagneticFieldUnit.Tesla).ToString(swedishCulture)); + Assert.Equal("1 G", new MagneticField(1, MagneticFieldUnit.Gauss).ToString(null, swedishCulture)); + Assert.Equal("1 µT", new MagneticField(1, MagneticFieldUnit.Microtesla).ToString(null, swedishCulture)); + Assert.Equal("1 mG", new MagneticField(1, MagneticFieldUnit.Milligauss).ToString(null, swedishCulture)); + Assert.Equal("1 mT", new MagneticField(1, MagneticFieldUnit.Millitesla).ToString(null, swedishCulture)); + Assert.Equal("1 nT", new MagneticField(1, MagneticFieldUnit.Nanotesla).ToString(null, swedishCulture)); + Assert.Equal("1 T", new MagneticField(1, MagneticFieldUnit.Tesla).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs index ad37b7deed..cab32da178 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagneticFluxTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Wb", new MagneticFlux(1, MagneticFluxUnit.Weber).ToString(swedishCulture)); + Assert.Equal("1 Wb", new MagneticFlux(1, MagneticFluxUnit.Weber).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs index 2dfcaa6ac8..f078edc382 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MagnetizationTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 A/m", new Magnetization(1, MagnetizationUnit.AmperePerMeter).ToString(swedishCulture)); + Assert.Equal("1 A/m", new Magnetization(1, MagnetizationUnit.AmperePerMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs index d18c60b18c..4a899e81f3 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassConcentrationTestsBase.g.cs @@ -2238,55 +2238,55 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cg/dl", new MassConcentration(1, MassConcentrationUnit.CentigramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 cg/l", new MassConcentration(1, MassConcentrationUnit.CentigramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 cg/μl", new MassConcentration(1, MassConcentrationUnit.CentigramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 cg/ml", new MassConcentration(1, MassConcentrationUnit.CentigramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 dg/dl", new MassConcentration(1, MassConcentrationUnit.DecigramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 dg/l", new MassConcentration(1, MassConcentrationUnit.DecigramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 dg/μl", new MassConcentration(1, MassConcentrationUnit.DecigramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 dg/ml", new MassConcentration(1, MassConcentrationUnit.DecigramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 g/cm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 g/m³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 g/mm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 g/dl", new MassConcentration(1, MassConcentrationUnit.GramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 g/l", new MassConcentration(1, MassConcentrationUnit.GramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 g/μl", new MassConcentration(1, MassConcentrationUnit.GramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 g/ml", new MassConcentration(1, MassConcentrationUnit.GramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 kg/cm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kg/m³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kg/mm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kg/l", new MassConcentration(1, MassConcentrationUnit.KilogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 kip/ft³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 kip/in³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 µg/m³", new MassConcentration(1, MassConcentrationUnit.MicrogramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 µg/dl", new MassConcentration(1, MassConcentrationUnit.MicrogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 µg/l", new MassConcentration(1, MassConcentrationUnit.MicrogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 µg/μl", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 µg/ml", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 mg/m³", new MassConcentration(1, MassConcentrationUnit.MilligramPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mg/dl", new MassConcentration(1, MassConcentrationUnit.MilligramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 mg/l", new MassConcentration(1, MassConcentrationUnit.MilligramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 mg/μl", new MassConcentration(1, MassConcentrationUnit.MilligramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 mg/ml", new MassConcentration(1, MassConcentrationUnit.MilligramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 ng/dl", new MassConcentration(1, MassConcentrationUnit.NanogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 ng/l", new MassConcentration(1, MassConcentrationUnit.NanogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 ng/μl", new MassConcentration(1, MassConcentrationUnit.NanogramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 ng/ml", new MassConcentration(1, MassConcentrationUnit.NanogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 oz/gal (imp.)", new MassConcentration(1, MassConcentrationUnit.OuncePerImperialGallon).ToString(swedishCulture)); - Assert.Equal("1 oz/gal (U.S.)", new MassConcentration(1, MassConcentrationUnit.OuncePerUSGallon).ToString(swedishCulture)); - Assert.Equal("1 pg/dl", new MassConcentration(1, MassConcentrationUnit.PicogramPerDeciliter).ToString(swedishCulture)); - Assert.Equal("1 pg/l", new MassConcentration(1, MassConcentrationUnit.PicogramPerLiter).ToString(swedishCulture)); - Assert.Equal("1 pg/μl", new MassConcentration(1, MassConcentrationUnit.PicogramPerMicroliter).ToString(swedishCulture)); - Assert.Equal("1 pg/ml", new MassConcentration(1, MassConcentrationUnit.PicogramPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 lb/ft³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 lb/in³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 ppg (imp.)", new MassConcentration(1, MassConcentrationUnit.PoundPerImperialGallon).ToString(swedishCulture)); - Assert.Equal("1 ppg (U.S.)", new MassConcentration(1, MassConcentrationUnit.PoundPerUSGallon).ToString(swedishCulture)); - Assert.Equal("1 slug/ft³", new MassConcentration(1, MassConcentrationUnit.SlugPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 t/cm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 t/m³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 t/mm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMillimeter).ToString(swedishCulture)); + Assert.Equal("1 cg/dl", new MassConcentration(1, MassConcentrationUnit.CentigramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 cg/l", new MassConcentration(1, MassConcentrationUnit.CentigramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 cg/μl", new MassConcentration(1, MassConcentrationUnit.CentigramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 cg/ml", new MassConcentration(1, MassConcentrationUnit.CentigramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/dl", new MassConcentration(1, MassConcentrationUnit.DecigramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/l", new MassConcentration(1, MassConcentrationUnit.DecigramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/μl", new MassConcentration(1, MassConcentrationUnit.DecigramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 dg/ml", new MassConcentration(1, MassConcentrationUnit.DecigramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 g/cm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/m³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/mm³", new MassConcentration(1, MassConcentrationUnit.GramPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g/dl", new MassConcentration(1, MassConcentrationUnit.GramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 g/l", new MassConcentration(1, MassConcentrationUnit.GramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 g/μl", new MassConcentration(1, MassConcentrationUnit.GramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 g/ml", new MassConcentration(1, MassConcentrationUnit.GramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/cm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/m³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/mm³", new MassConcentration(1, MassConcentrationUnit.KilogramPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg/l", new MassConcentration(1, MassConcentrationUnit.KilogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 kip/ft³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kip/in³", new MassConcentration(1, MassConcentrationUnit.KilopoundPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 µg/m³", new MassConcentration(1, MassConcentrationUnit.MicrogramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/dl", new MassConcentration(1, MassConcentrationUnit.MicrogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/l", new MassConcentration(1, MassConcentrationUnit.MicrogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/μl", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 µg/ml", new MassConcentration(1, MassConcentrationUnit.MicrogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/m³", new MassConcentration(1, MassConcentrationUnit.MilligramPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/dl", new MassConcentration(1, MassConcentrationUnit.MilligramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/l", new MassConcentration(1, MassConcentrationUnit.MilligramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/μl", new MassConcentration(1, MassConcentrationUnit.MilligramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 mg/ml", new MassConcentration(1, MassConcentrationUnit.MilligramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/dl", new MassConcentration(1, MassConcentrationUnit.NanogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/l", new MassConcentration(1, MassConcentrationUnit.NanogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/μl", new MassConcentration(1, MassConcentrationUnit.NanogramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 ng/ml", new MassConcentration(1, MassConcentrationUnit.NanogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 oz/gal (imp.)", new MassConcentration(1, MassConcentrationUnit.OuncePerImperialGallon).ToString(null, swedishCulture)); + Assert.Equal("1 oz/gal (U.S.)", new MassConcentration(1, MassConcentrationUnit.OuncePerUSGallon).ToString(null, swedishCulture)); + Assert.Equal("1 pg/dl", new MassConcentration(1, MassConcentrationUnit.PicogramPerDeciliter).ToString(null, swedishCulture)); + Assert.Equal("1 pg/l", new MassConcentration(1, MassConcentrationUnit.PicogramPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 pg/μl", new MassConcentration(1, MassConcentrationUnit.PicogramPerMicroliter).ToString(null, swedishCulture)); + Assert.Equal("1 pg/ml", new MassConcentration(1, MassConcentrationUnit.PicogramPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 lb/ft³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lb/in³", new MassConcentration(1, MassConcentrationUnit.PoundPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 ppg (imp.)", new MassConcentration(1, MassConcentrationUnit.PoundPerImperialGallon).ToString(null, swedishCulture)); + Assert.Equal("1 ppg (U.S.)", new MassConcentration(1, MassConcentrationUnit.PoundPerUSGallon).ToString(null, swedishCulture)); + Assert.Equal("1 slug/ft³", new MassConcentration(1, MassConcentrationUnit.SlugPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 t/cm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 t/m³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 t/mm³", new MassConcentration(1, MassConcentrationUnit.TonnePerCubicMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs index c3c93c16bc..181d6b6c95 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFlowTestsBase.g.cs @@ -1853,39 +1853,39 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cg/d", new MassFlow(1, MassFlowUnit.CentigramPerDay).ToString(swedishCulture)); - Assert.Equal("1 cg/s", new MassFlow(1, MassFlowUnit.CentigramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 dag/d", new MassFlow(1, MassFlowUnit.DecagramPerDay).ToString(swedishCulture)); - Assert.Equal("1 dag/s", new MassFlow(1, MassFlowUnit.DecagramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 dg/d", new MassFlow(1, MassFlowUnit.DecigramPerDay).ToString(swedishCulture)); - Assert.Equal("1 dg/s", new MassFlow(1, MassFlowUnit.DecigramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 g/d", new MassFlow(1, MassFlowUnit.GramPerDay).ToString(swedishCulture)); - Assert.Equal("1 g/h", new MassFlow(1, MassFlowUnit.GramPerHour).ToString(swedishCulture)); - Assert.Equal("1 g/s", new MassFlow(1, MassFlowUnit.GramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 hg/d", new MassFlow(1, MassFlowUnit.HectogramPerDay).ToString(swedishCulture)); - Assert.Equal("1 hg/s", new MassFlow(1, MassFlowUnit.HectogramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kg/d", new MassFlow(1, MassFlowUnit.KilogramPerDay).ToString(swedishCulture)); - Assert.Equal("1 kg/h", new MassFlow(1, MassFlowUnit.KilogramPerHour).ToString(swedishCulture)); - Assert.Equal("1 kg/min", new MassFlow(1, MassFlowUnit.KilogramPerMinute).ToString(swedishCulture)); - Assert.Equal("1 kg/s", new MassFlow(1, MassFlowUnit.KilogramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mg/d", new MassFlow(1, MassFlowUnit.MegagramPerDay).ToString(swedishCulture)); - Assert.Equal("1 Mlb/d", new MassFlow(1, MassFlowUnit.MegapoundPerDay).ToString(swedishCulture)); - Assert.Equal("1 Mlb/h", new MassFlow(1, MassFlowUnit.MegapoundPerHour).ToString(swedishCulture)); - Assert.Equal("1 Mlb/min", new MassFlow(1, MassFlowUnit.MegapoundPerMinute).ToString(swedishCulture)); - Assert.Equal("1 Mlb/s", new MassFlow(1, MassFlowUnit.MegapoundPerSecond).ToString(swedishCulture)); - Assert.Equal("1 µg/d", new MassFlow(1, MassFlowUnit.MicrogramPerDay).ToString(swedishCulture)); - Assert.Equal("1 µg/s", new MassFlow(1, MassFlowUnit.MicrogramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mg/d", new MassFlow(1, MassFlowUnit.MilligramPerDay).ToString(swedishCulture)); - Assert.Equal("1 mg/s", new MassFlow(1, MassFlowUnit.MilligramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 ng/d", new MassFlow(1, MassFlowUnit.NanogramPerDay).ToString(swedishCulture)); - Assert.Equal("1 ng/s", new MassFlow(1, MassFlowUnit.NanogramPerSecond).ToString(swedishCulture)); - Assert.Equal("1 lb/d", new MassFlow(1, MassFlowUnit.PoundPerDay).ToString(swedishCulture)); - Assert.Equal("1 lb/h", new MassFlow(1, MassFlowUnit.PoundPerHour).ToString(swedishCulture)); - Assert.Equal("1 lb/min", new MassFlow(1, MassFlowUnit.PoundPerMinute).ToString(swedishCulture)); - Assert.Equal("1 lb/s", new MassFlow(1, MassFlowUnit.PoundPerSecond).ToString(swedishCulture)); - Assert.Equal("1 short tn/h", new MassFlow(1, MassFlowUnit.ShortTonPerHour).ToString(swedishCulture)); - Assert.Equal("1 t/d", new MassFlow(1, MassFlowUnit.TonnePerDay).ToString(swedishCulture)); - Assert.Equal("1 t/h", new MassFlow(1, MassFlowUnit.TonnePerHour).ToString(swedishCulture)); + Assert.Equal("1 cg/d", new MassFlow(1, MassFlowUnit.CentigramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 cg/s", new MassFlow(1, MassFlowUnit.CentigramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dag/d", new MassFlow(1, MassFlowUnit.DecagramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 dag/s", new MassFlow(1, MassFlowUnit.DecagramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dg/d", new MassFlow(1, MassFlowUnit.DecigramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 dg/s", new MassFlow(1, MassFlowUnit.DecigramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 g/d", new MassFlow(1, MassFlowUnit.GramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 g/h", new MassFlow(1, MassFlowUnit.GramPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 g/s", new MassFlow(1, MassFlowUnit.GramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 hg/d", new MassFlow(1, MassFlowUnit.HectogramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 hg/s", new MassFlow(1, MassFlowUnit.HectogramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kg/d", new MassFlow(1, MassFlowUnit.KilogramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 kg/h", new MassFlow(1, MassFlowUnit.KilogramPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kg/min", new MassFlow(1, MassFlowUnit.KilogramPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kg/s", new MassFlow(1, MassFlowUnit.KilogramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mg/d", new MassFlow(1, MassFlowUnit.MegagramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 Mlb/d", new MassFlow(1, MassFlowUnit.MegapoundPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 Mlb/h", new MassFlow(1, MassFlowUnit.MegapoundPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 Mlb/min", new MassFlow(1, MassFlowUnit.MegapoundPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 Mlb/s", new MassFlow(1, MassFlowUnit.MegapoundPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µg/d", new MassFlow(1, MassFlowUnit.MicrogramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 µg/s", new MassFlow(1, MassFlowUnit.MicrogramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mg/d", new MassFlow(1, MassFlowUnit.MilligramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 mg/s", new MassFlow(1, MassFlowUnit.MilligramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 ng/d", new MassFlow(1, MassFlowUnit.NanogramPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 ng/s", new MassFlow(1, MassFlowUnit.NanogramPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lb/d", new MassFlow(1, MassFlowUnit.PoundPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 lb/h", new MassFlow(1, MassFlowUnit.PoundPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 lb/min", new MassFlow(1, MassFlowUnit.PoundPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 lb/s", new MassFlow(1, MassFlowUnit.PoundPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 short tn/h", new MassFlow(1, MassFlowUnit.ShortTonPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 t/d", new MassFlow(1, MassFlowUnit.TonnePerDay).ToString(null, swedishCulture)); + Assert.Equal("1 t/h", new MassFlow(1, MassFlowUnit.TonnePerHour).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs index c9497e18b8..1defce57cf 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFluxTestsBase.g.cs @@ -949,18 +949,18 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 g·h⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.GramPerHourPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 g·h⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.GramPerHourPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 g·h⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.GramPerHourPerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 g·s⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.GramPerSecondPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 g·s⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.GramPerSecondPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 g·s⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.GramPerSecondPerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·h⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerHourPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·h⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.KilogramPerHourPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kg·h⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerHourPerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·s⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerSecondPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·s⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.KilogramPerSecondPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kg·s⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerSecondPerSquareMillimeter).ToString(swedishCulture)); + Assert.Equal("1 g·h⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.GramPerHourPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·h⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.GramPerHourPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·h⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.GramPerHourPerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·s⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.GramPerSecondPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·s⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.GramPerSecondPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·s⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.GramPerSecondPerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·h⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerHourPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·h⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.KilogramPerHourPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·h⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerHourPerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·s⁻¹·cm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerSecondPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·s⁻¹·m⁻²", new MassFlux(1, MassFluxUnit.KilogramPerSecondPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·s⁻¹·mm⁻²", new MassFlux(1, MassFluxUnit.KilogramPerSecondPerSquareMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs index 59ab4d4b4a..ec2f8ead37 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassFractionTestsBase.g.cs @@ -1306,30 +1306,30 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cg/g", new MassFraction(1, MassFractionUnit.CentigramPerGram).ToString(swedishCulture)); - Assert.Equal("1 cg/kg", new MassFraction(1, MassFractionUnit.CentigramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 dag/g", new MassFraction(1, MassFractionUnit.DecagramPerGram).ToString(swedishCulture)); - Assert.Equal("1 dag/kg", new MassFraction(1, MassFractionUnit.DecagramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 dg/g", new MassFraction(1, MassFractionUnit.DecigramPerGram).ToString(swedishCulture)); - Assert.Equal("1 dg/kg", new MassFraction(1, MassFractionUnit.DecigramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1", new MassFraction(1, MassFractionUnit.DecimalFraction).ToString(swedishCulture)); - Assert.Equal("1 g/g", new MassFraction(1, MassFractionUnit.GramPerGram).ToString(swedishCulture)); - Assert.Equal("1 g/kg", new MassFraction(1, MassFractionUnit.GramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 hg/g", new MassFraction(1, MassFractionUnit.HectogramPerGram).ToString(swedishCulture)); - Assert.Equal("1 hg/kg", new MassFraction(1, MassFractionUnit.HectogramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 kg/g", new MassFraction(1, MassFractionUnit.KilogramPerGram).ToString(swedishCulture)); - Assert.Equal("1 kg/kg", new MassFraction(1, MassFractionUnit.KilogramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 µg/g", new MassFraction(1, MassFractionUnit.MicrogramPerGram).ToString(swedishCulture)); - Assert.Equal("1 µg/kg", new MassFraction(1, MassFractionUnit.MicrogramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 mg/g", new MassFraction(1, MassFractionUnit.MilligramPerGram).ToString(swedishCulture)); - Assert.Equal("1 mg/kg", new MassFraction(1, MassFractionUnit.MilligramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 ng/g", new MassFraction(1, MassFractionUnit.NanogramPerGram).ToString(swedishCulture)); - Assert.Equal("1 ng/kg", new MassFraction(1, MassFractionUnit.NanogramPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 ppb", new MassFraction(1, MassFractionUnit.PartPerBillion).ToString(swedishCulture)); - Assert.Equal("1 ppm", new MassFraction(1, MassFractionUnit.PartPerMillion).ToString(swedishCulture)); - Assert.Equal("1 ‰", new MassFraction(1, MassFractionUnit.PartPerThousand).ToString(swedishCulture)); - Assert.Equal("1 ppt", new MassFraction(1, MassFractionUnit.PartPerTrillion).ToString(swedishCulture)); - Assert.Equal("1 %", new MassFraction(1, MassFractionUnit.Percent).ToString(swedishCulture)); + Assert.Equal("1 cg/g", new MassFraction(1, MassFractionUnit.CentigramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 cg/kg", new MassFraction(1, MassFractionUnit.CentigramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 dag/g", new MassFraction(1, MassFractionUnit.DecagramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 dag/kg", new MassFraction(1, MassFractionUnit.DecagramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 dg/g", new MassFraction(1, MassFractionUnit.DecigramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 dg/kg", new MassFraction(1, MassFractionUnit.DecigramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1", new MassFraction(1, MassFractionUnit.DecimalFraction).ToString(null, swedishCulture)); + Assert.Equal("1 g/g", new MassFraction(1, MassFractionUnit.GramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 g/kg", new MassFraction(1, MassFractionUnit.GramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 hg/g", new MassFraction(1, MassFractionUnit.HectogramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 hg/kg", new MassFraction(1, MassFractionUnit.HectogramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 kg/g", new MassFraction(1, MassFractionUnit.KilogramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 kg/kg", new MassFraction(1, MassFractionUnit.KilogramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 µg/g", new MassFraction(1, MassFractionUnit.MicrogramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 µg/kg", new MassFraction(1, MassFractionUnit.MicrogramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 mg/g", new MassFraction(1, MassFractionUnit.MilligramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 mg/kg", new MassFraction(1, MassFractionUnit.MilligramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 ng/g", new MassFraction(1, MassFractionUnit.NanogramPerGram).ToString(null, swedishCulture)); + Assert.Equal("1 ng/kg", new MassFraction(1, MassFractionUnit.NanogramPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 ppb", new MassFraction(1, MassFractionUnit.PartPerBillion).ToString(null, swedishCulture)); + Assert.Equal("1 ppm", new MassFraction(1, MassFractionUnit.PartPerMillion).ToString(null, swedishCulture)); + Assert.Equal("1 ‰", new MassFraction(1, MassFractionUnit.PartPerThousand).ToString(null, swedishCulture)); + Assert.Equal("1 ppt", new MassFraction(1, MassFractionUnit.PartPerTrillion).ToString(null, swedishCulture)); + Assert.Equal("1 %", new MassFraction(1, MassFractionUnit.Percent).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs index be53743abd..fa74803d7e 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassMomentOfInertiaTestsBase.g.cs @@ -1477,34 +1477,34 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 g·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 g·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 g·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 g·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 kg·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kg·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kt·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kt·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 kt·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kt·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 Mt·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 Mt·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 Mt·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 Mt·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 mg·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 mg·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 mg·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 mg·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 lb·ft²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.PoundSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 lb·in²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.PoundSquareInch).ToString(swedishCulture)); - Assert.Equal("1 slug·ft²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.SlugSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 slug·in²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.SlugSquareInch).ToString(swedishCulture)); - Assert.Equal("1 t·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 t·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 t·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 t·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareMillimeter).ToString(swedishCulture)); + Assert.Equal("1 g·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 g·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.GramSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kg·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilogramSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kt·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kt·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kt·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kt·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.KilotonneSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Mt·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Mt·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Mt·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 Mt·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MegatonneSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mg·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.MilligramSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 lb·ft²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.PoundSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lb·in²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.PoundSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 slug·ft²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.SlugSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 slug·in²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.SlugSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 t·cm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 t·dm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 t·m²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 t·mm²", new MassMomentOfInertia(1, MassMomentOfInertiaUnit.TonneSquareMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs index 657b0a6fa5..67b7eea0c5 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MassTestsBase.g.cs @@ -2270,33 +2270,33 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cg", new Mass(1, MassUnit.Centigram).ToString(swedishCulture)); - Assert.Equal("1 dag", new Mass(1, MassUnit.Decagram).ToString(swedishCulture)); - Assert.Equal("1 dg", new Mass(1, MassUnit.Decigram).ToString(swedishCulture)); - Assert.Equal("1 em", new Mass(1, MassUnit.EarthMass).ToString(swedishCulture)); - Assert.Equal("1 fg", new Mass(1, MassUnit.Femtogram).ToString(swedishCulture)); - Assert.Equal("1 gr", new Mass(1, MassUnit.Grain).ToString(swedishCulture)); - Assert.Equal("1 g", new Mass(1, MassUnit.Gram).ToString(swedishCulture)); - Assert.Equal("1 hg", new Mass(1, MassUnit.Hectogram).ToString(swedishCulture)); - Assert.Equal("1 kg", new Mass(1, MassUnit.Kilogram).ToString(swedishCulture)); - Assert.Equal("1 klb", new Mass(1, MassUnit.Kilopound).ToString(swedishCulture)); - Assert.Equal("1 kt", new Mass(1, MassUnit.Kilotonne).ToString(swedishCulture)); - Assert.Equal("1 cwt", new Mass(1, MassUnit.LongHundredweight).ToString(swedishCulture)); - Assert.Equal("1 long tn", new Mass(1, MassUnit.LongTon).ToString(swedishCulture)); - Assert.Equal("1 Mlb", new Mass(1, MassUnit.Megapound).ToString(swedishCulture)); - Assert.Equal("1 Mt", new Mass(1, MassUnit.Megatonne).ToString(swedishCulture)); - Assert.Equal("1 µg", new Mass(1, MassUnit.Microgram).ToString(swedishCulture)); - Assert.Equal("1 mg", new Mass(1, MassUnit.Milligram).ToString(swedishCulture)); - Assert.Equal("1 ng", new Mass(1, MassUnit.Nanogram).ToString(swedishCulture)); - Assert.Equal("1 oz", new Mass(1, MassUnit.Ounce).ToString(swedishCulture)); - Assert.Equal("1 pg", new Mass(1, MassUnit.Picogram).ToString(swedishCulture)); - Assert.Equal("1 lb", new Mass(1, MassUnit.Pound).ToString(swedishCulture)); - Assert.Equal("1 cwt", new Mass(1, MassUnit.ShortHundredweight).ToString(swedishCulture)); - Assert.Equal("1 t (short)", new Mass(1, MassUnit.ShortTon).ToString(swedishCulture)); - Assert.Equal("1 slug", new Mass(1, MassUnit.Slug).ToString(swedishCulture)); - Assert.Equal("1 M☉", new Mass(1, MassUnit.SolarMass).ToString(swedishCulture)); - Assert.Equal("1 st", new Mass(1, MassUnit.Stone).ToString(swedishCulture)); - Assert.Equal("1 t", new Mass(1, MassUnit.Tonne).ToString(swedishCulture)); + Assert.Equal("1 cg", new Mass(1, MassUnit.Centigram).ToString(null, swedishCulture)); + Assert.Equal("1 dag", new Mass(1, MassUnit.Decagram).ToString(null, swedishCulture)); + Assert.Equal("1 dg", new Mass(1, MassUnit.Decigram).ToString(null, swedishCulture)); + Assert.Equal("1 em", new Mass(1, MassUnit.EarthMass).ToString(null, swedishCulture)); + Assert.Equal("1 fg", new Mass(1, MassUnit.Femtogram).ToString(null, swedishCulture)); + Assert.Equal("1 gr", new Mass(1, MassUnit.Grain).ToString(null, swedishCulture)); + Assert.Equal("1 g", new Mass(1, MassUnit.Gram).ToString(null, swedishCulture)); + Assert.Equal("1 hg", new Mass(1, MassUnit.Hectogram).ToString(null, swedishCulture)); + Assert.Equal("1 kg", new Mass(1, MassUnit.Kilogram).ToString(null, swedishCulture)); + Assert.Equal("1 klb", new Mass(1, MassUnit.Kilopound).ToString(null, swedishCulture)); + Assert.Equal("1 kt", new Mass(1, MassUnit.Kilotonne).ToString(null, swedishCulture)); + Assert.Equal("1 cwt", new Mass(1, MassUnit.LongHundredweight).ToString(null, swedishCulture)); + Assert.Equal("1 long tn", new Mass(1, MassUnit.LongTon).ToString(null, swedishCulture)); + Assert.Equal("1 Mlb", new Mass(1, MassUnit.Megapound).ToString(null, swedishCulture)); + Assert.Equal("1 Mt", new Mass(1, MassUnit.Megatonne).ToString(null, swedishCulture)); + Assert.Equal("1 µg", new Mass(1, MassUnit.Microgram).ToString(null, swedishCulture)); + Assert.Equal("1 mg", new Mass(1, MassUnit.Milligram).ToString(null, swedishCulture)); + Assert.Equal("1 ng", new Mass(1, MassUnit.Nanogram).ToString(null, swedishCulture)); + Assert.Equal("1 oz", new Mass(1, MassUnit.Ounce).ToString(null, swedishCulture)); + Assert.Equal("1 pg", new Mass(1, MassUnit.Picogram).ToString(null, swedishCulture)); + Assert.Equal("1 lb", new Mass(1, MassUnit.Pound).ToString(null, swedishCulture)); + Assert.Equal("1 cwt", new Mass(1, MassUnit.ShortHundredweight).ToString(null, swedishCulture)); + Assert.Equal("1 t (short)", new Mass(1, MassUnit.ShortTon).ToString(null, swedishCulture)); + Assert.Equal("1 slug", new Mass(1, MassUnit.Slug).ToString(null, swedishCulture)); + Assert.Equal("1 M☉", new Mass(1, MassUnit.SolarMass).ToString(null, swedishCulture)); + Assert.Equal("1 st", new Mass(1, MassUnit.Stone).ToString(null, swedishCulture)); + Assert.Equal("1 t", new Mass(1, MassUnit.Tonne).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs index 59671fee5e..bd21f0258a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolalityTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 mmol/kg", new Molality(1, MolalityUnit.MillimolePerKilogram).ToString(swedishCulture)); - Assert.Equal("1 mol/g", new Molality(1, MolalityUnit.MolePerGram).ToString(swedishCulture)); - Assert.Equal("1 mol/kg", new Molality(1, MolalityUnit.MolePerKilogram).ToString(swedishCulture)); + Assert.Equal("1 mmol/kg", new Molality(1, MolalityUnit.MillimolePerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 mol/g", new Molality(1, MolalityUnit.MolePerGram).ToString(null, swedishCulture)); + Assert.Equal("1 mol/kg", new Molality(1, MolalityUnit.MolePerKilogram).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs index ac653e7fef..93323b7bfc 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEnergyTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 J/mol", new MolarEnergy(1, MolarEnergyUnit.JoulePerMole).ToString(swedishCulture)); - Assert.Equal("1 kJ/mol", new MolarEnergy(1, MolarEnergyUnit.KilojoulePerMole).ToString(swedishCulture)); - Assert.Equal("1 MJ/mol", new MolarEnergy(1, MolarEnergyUnit.MegajoulePerMole).ToString(swedishCulture)); + Assert.Equal("1 J/mol", new MolarEnergy(1, MolarEnergyUnit.JoulePerMole).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/mol", new MolarEnergy(1, MolarEnergyUnit.KilojoulePerMole).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/mol", new MolarEnergy(1, MolarEnergyUnit.MegajoulePerMole).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs index 48b48259dd..738f41f547 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarEntropyTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 J/(mol·K)", new MolarEntropy(1, MolarEntropyUnit.JoulePerMoleKelvin).ToString(swedishCulture)); - Assert.Equal("1 kJ/(mol·K)", new MolarEntropy(1, MolarEntropyUnit.KilojoulePerMoleKelvin).ToString(swedishCulture)); - Assert.Equal("1 MJ/(mol·K)", new MolarEntropy(1, MolarEntropyUnit.MegajoulePerMoleKelvin).ToString(swedishCulture)); + Assert.Equal("1 J/(mol·K)", new MolarEntropy(1, MolarEntropyUnit.JoulePerMoleKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/(mol·K)", new MolarEntropy(1, MolarEntropyUnit.KilojoulePerMoleKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/(mol·K)", new MolarEntropy(1, MolarEntropyUnit.MegajoulePerMoleKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs index 57c41a3374..450d7cd854 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarFlowTestsBase.g.cs @@ -850,15 +850,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kkmol/h", new MolarFlow(1, MolarFlowUnit.KilomolePerHour).ToString(swedishCulture)); - Assert.Equal("1 kmol/min", new MolarFlow(1, MolarFlowUnit.KilomolePerMinute).ToString(swedishCulture)); - Assert.Equal("1 kmol/s", new MolarFlow(1, MolarFlowUnit.KilomolePerSecond).ToString(swedishCulture)); - Assert.Equal("1 kmol/h", new MolarFlow(1, MolarFlowUnit.MolePerHour).ToString(swedishCulture)); - Assert.Equal("1 mol/min", new MolarFlow(1, MolarFlowUnit.MolePerMinute).ToString(swedishCulture)); - Assert.Equal("1 mol/s", new MolarFlow(1, MolarFlowUnit.MolePerSecond).ToString(swedishCulture)); - Assert.Equal("1 lbmol/h", new MolarFlow(1, MolarFlowUnit.PoundMolePerHour).ToString(swedishCulture)); - Assert.Equal("1 lbmol/min", new MolarFlow(1, MolarFlowUnit.PoundMolePerMinute).ToString(swedishCulture)); - Assert.Equal("1 lbmol/s", new MolarFlow(1, MolarFlowUnit.PoundMolePerSecond).ToString(swedishCulture)); + Assert.Equal("1 kkmol/h", new MolarFlow(1, MolarFlowUnit.KilomolePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kmol/min", new MolarFlow(1, MolarFlowUnit.KilomolePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kmol/s", new MolarFlow(1, MolarFlowUnit.KilomolePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kmol/h", new MolarFlow(1, MolarFlowUnit.MolePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mol/min", new MolarFlow(1, MolarFlowUnit.MolePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 mol/s", new MolarFlow(1, MolarFlowUnit.MolePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lbmol/h", new MolarFlow(1, MolarFlowUnit.PoundMolePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 lbmol/min", new MolarFlow(1, MolarFlowUnit.PoundMolePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 lbmol/s", new MolarFlow(1, MolarFlowUnit.PoundMolePerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs index 7de8e47db0..512aec0d22 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarMassTestsBase.g.cs @@ -1186,19 +1186,19 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cg/mol", new MolarMass(1, MolarMassUnit.CentigramPerMole).ToString(swedishCulture)); - Assert.Equal("1 dag/mol", new MolarMass(1, MolarMassUnit.DecagramPerMole).ToString(swedishCulture)); - Assert.Equal("1 dg/mol", new MolarMass(1, MolarMassUnit.DecigramPerMole).ToString(swedishCulture)); - Assert.Equal("1 g/mol", new MolarMass(1, MolarMassUnit.GramPerMole).ToString(swedishCulture)); - Assert.Equal("1 hg/mol", new MolarMass(1, MolarMassUnit.HectogramPerMole).ToString(swedishCulture)); - Assert.Equal("1 kg/kmol", new MolarMass(1, MolarMassUnit.KilogramPerKilomole).ToString(swedishCulture)); - Assert.Equal("1 kg/mol", new MolarMass(1, MolarMassUnit.KilogramPerMole).ToString(swedishCulture)); - Assert.Equal("1 klb/mol", new MolarMass(1, MolarMassUnit.KilopoundPerMole).ToString(swedishCulture)); - Assert.Equal("1 Mlb/mol", new MolarMass(1, MolarMassUnit.MegapoundPerMole).ToString(swedishCulture)); - Assert.Equal("1 µg/mol", new MolarMass(1, MolarMassUnit.MicrogramPerMole).ToString(swedishCulture)); - Assert.Equal("1 mg/mol", new MolarMass(1, MolarMassUnit.MilligramPerMole).ToString(swedishCulture)); - Assert.Equal("1 ng/mol", new MolarMass(1, MolarMassUnit.NanogramPerMole).ToString(swedishCulture)); - Assert.Equal("1 lb/mol", new MolarMass(1, MolarMassUnit.PoundPerMole).ToString(swedishCulture)); + Assert.Equal("1 cg/mol", new MolarMass(1, MolarMassUnit.CentigramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 dag/mol", new MolarMass(1, MolarMassUnit.DecagramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 dg/mol", new MolarMass(1, MolarMassUnit.DecigramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 g/mol", new MolarMass(1, MolarMassUnit.GramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 hg/mol", new MolarMass(1, MolarMassUnit.HectogramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 kg/kmol", new MolarMass(1, MolarMassUnit.KilogramPerKilomole).ToString(null, swedishCulture)); + Assert.Equal("1 kg/mol", new MolarMass(1, MolarMassUnit.KilogramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 klb/mol", new MolarMass(1, MolarMassUnit.KilopoundPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 Mlb/mol", new MolarMass(1, MolarMassUnit.MegapoundPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 µg/mol", new MolarMass(1, MolarMassUnit.MicrogramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 mg/mol", new MolarMass(1, MolarMassUnit.MilligramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 ng/mol", new MolarMass(1, MolarMassUnit.NanogramPerMole).ToString(null, swedishCulture)); + Assert.Equal("1 lb/mol", new MolarMass(1, MolarMassUnit.PoundPerMole).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs index 82a953a168..0dd27fe4a2 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/MolarityTestsBase.g.cs @@ -1084,17 +1084,17 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cmol/l", new Molarity(1, MolarityUnit.CentimolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 dmol/l", new Molarity(1, MolarityUnit.DecimolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 fmol/l", new Molarity(1, MolarityUnit.FemtomolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 kmol/m³", new Molarity(1, MolarityUnit.KilomolePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 µmol/l", new Molarity(1, MolarityUnit.MicromolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 mmol/l", new Molarity(1, MolarityUnit.MillimolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 mol/m³", new Molarity(1, MolarityUnit.MolePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mol/l", new Molarity(1, MolarityUnit.MolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 nmol/l", new Molarity(1, MolarityUnit.NanomolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 pmol/l", new Molarity(1, MolarityUnit.PicomolePerLiter).ToString(swedishCulture)); - Assert.Equal("1 lbmol/ft³", new Molarity(1, MolarityUnit.PoundMolePerCubicFoot).ToString(swedishCulture)); + Assert.Equal("1 cmol/l", new Molarity(1, MolarityUnit.CentimolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 dmol/l", new Molarity(1, MolarityUnit.DecimolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 fmol/l", new Molarity(1, MolarityUnit.FemtomolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 kmol/m³", new Molarity(1, MolarityUnit.KilomolePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µmol/l", new Molarity(1, MolarityUnit.MicromolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mmol/l", new Molarity(1, MolarityUnit.MillimolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mol/m³", new Molarity(1, MolarityUnit.MolePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mol/l", new Molarity(1, MolarityUnit.MolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 nmol/l", new Molarity(1, MolarityUnit.NanomolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 pmol/l", new Molarity(1, MolarityUnit.PicomolePerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 lbmol/ft³", new Molarity(1, MolarityUnit.PoundMolePerCubicFoot).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs index cdd4acc75a..0246b4d54d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PermeabilityTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 H/m", new Permeability(1, PermeabilityUnit.HenryPerMeter).ToString(swedishCulture)); + Assert.Equal("1 H/m", new Permeability(1, PermeabilityUnit.HenryPerMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs index 6e4193c403..2dfd83fe16 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PermittivityTestsBase.g.cs @@ -585,7 +585,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 F/m", new Permittivity(1, PermittivityUnit.FaradPerMeter).ToString(swedishCulture)); + Assert.Equal("1 F/m", new Permittivity(1, PermittivityUnit.FaradPerMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs index aef4b444a6..b7567a6805 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PorousMediumPermeabilityTestsBase.g.cs @@ -718,11 +718,11 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 D", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.Darcy).ToString(swedishCulture)); - Assert.Equal("1 µD", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.Microdarcy).ToString(swedishCulture)); - Assert.Equal("1 mD", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.Millidarcy).ToString(swedishCulture)); - Assert.Equal("1 cm²", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.SquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 m²", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.SquareMeter).ToString(swedishCulture)); + Assert.Equal("1 D", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.Darcy).ToString(null, swedishCulture)); + Assert.Equal("1 µD", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.Microdarcy).ToString(null, swedishCulture)); + Assert.Equal("1 mD", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.Millidarcy).ToString(null, swedishCulture)); + Assert.Equal("1 cm²", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.SquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 m²", new PorousMediumPermeability(1, PorousMediumPermeabilityUnit.SquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs index 5922652d9c..b7dc17f901 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerDensityTestsBase.g.cs @@ -1957,50 +1957,50 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 daW/ft³", new PowerDensity(1, PowerDensityUnit.DecawattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 daW/in³", new PowerDensity(1, PowerDensityUnit.DecawattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 daW/m³", new PowerDensity(1, PowerDensityUnit.DecawattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 daW/l", new PowerDensity(1, PowerDensityUnit.DecawattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 dW/ft³", new PowerDensity(1, PowerDensityUnit.DeciwattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 dW/in³", new PowerDensity(1, PowerDensityUnit.DeciwattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 dW/m³", new PowerDensity(1, PowerDensityUnit.DeciwattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 dW/l", new PowerDensity(1, PowerDensityUnit.DeciwattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 GW/ft³", new PowerDensity(1, PowerDensityUnit.GigawattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 GW/in³", new PowerDensity(1, PowerDensityUnit.GigawattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 GW/m³", new PowerDensity(1, PowerDensityUnit.GigawattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 GW/l", new PowerDensity(1, PowerDensityUnit.GigawattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 kW/ft³", new PowerDensity(1, PowerDensityUnit.KilowattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 kW/in³", new PowerDensity(1, PowerDensityUnit.KilowattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 kW/m³", new PowerDensity(1, PowerDensityUnit.KilowattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kW/l", new PowerDensity(1, PowerDensityUnit.KilowattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 MW/ft³", new PowerDensity(1, PowerDensityUnit.MegawattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 MW/in³", new PowerDensity(1, PowerDensityUnit.MegawattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 MW/m³", new PowerDensity(1, PowerDensityUnit.MegawattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 MW/l", new PowerDensity(1, PowerDensityUnit.MegawattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 µW/ft³", new PowerDensity(1, PowerDensityUnit.MicrowattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 µW/in³", new PowerDensity(1, PowerDensityUnit.MicrowattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 µW/m³", new PowerDensity(1, PowerDensityUnit.MicrowattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 µW/l", new PowerDensity(1, PowerDensityUnit.MicrowattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 mW/ft³", new PowerDensity(1, PowerDensityUnit.MilliwattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 mW/in³", new PowerDensity(1, PowerDensityUnit.MilliwattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 mW/m³", new PowerDensity(1, PowerDensityUnit.MilliwattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 mW/l", new PowerDensity(1, PowerDensityUnit.MilliwattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 nW/ft³", new PowerDensity(1, PowerDensityUnit.NanowattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 nW/in³", new PowerDensity(1, PowerDensityUnit.NanowattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 nW/m³", new PowerDensity(1, PowerDensityUnit.NanowattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 nW/l", new PowerDensity(1, PowerDensityUnit.NanowattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 pW/ft³", new PowerDensity(1, PowerDensityUnit.PicowattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 pW/in³", new PowerDensity(1, PowerDensityUnit.PicowattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 pW/m³", new PowerDensity(1, PowerDensityUnit.PicowattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 pW/l", new PowerDensity(1, PowerDensityUnit.PicowattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 TW/ft³", new PowerDensity(1, PowerDensityUnit.TerawattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 TW/in³", new PowerDensity(1, PowerDensityUnit.TerawattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 TW/m³", new PowerDensity(1, PowerDensityUnit.TerawattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 TW/l", new PowerDensity(1, PowerDensityUnit.TerawattPerLiter).ToString(swedishCulture)); - Assert.Equal("1 W/ft³", new PowerDensity(1, PowerDensityUnit.WattPerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 W/in³", new PowerDensity(1, PowerDensityUnit.WattPerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 W/m³", new PowerDensity(1, PowerDensityUnit.WattPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 W/l", new PowerDensity(1, PowerDensityUnit.WattPerLiter).ToString(swedishCulture)); + Assert.Equal("1 daW/ft³", new PowerDensity(1, PowerDensityUnit.DecawattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 daW/in³", new PowerDensity(1, PowerDensityUnit.DecawattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 daW/m³", new PowerDensity(1, PowerDensityUnit.DecawattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 daW/l", new PowerDensity(1, PowerDensityUnit.DecawattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 dW/ft³", new PowerDensity(1, PowerDensityUnit.DeciwattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 dW/in³", new PowerDensity(1, PowerDensityUnit.DeciwattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 dW/m³", new PowerDensity(1, PowerDensityUnit.DeciwattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 dW/l", new PowerDensity(1, PowerDensityUnit.DeciwattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 GW/ft³", new PowerDensity(1, PowerDensityUnit.GigawattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 GW/in³", new PowerDensity(1, PowerDensityUnit.GigawattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 GW/m³", new PowerDensity(1, PowerDensityUnit.GigawattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 GW/l", new PowerDensity(1, PowerDensityUnit.GigawattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/ft³", new PowerDensity(1, PowerDensityUnit.KilowattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kW/in³", new PowerDensity(1, PowerDensityUnit.KilowattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 kW/m³", new PowerDensity(1, PowerDensityUnit.KilowattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kW/l", new PowerDensity(1, PowerDensityUnit.KilowattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/ft³", new PowerDensity(1, PowerDensityUnit.MegawattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 MW/in³", new PowerDensity(1, PowerDensityUnit.MegawattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 MW/m³", new PowerDensity(1, PowerDensityUnit.MegawattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MW/l", new PowerDensity(1, PowerDensityUnit.MegawattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 µW/ft³", new PowerDensity(1, PowerDensityUnit.MicrowattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 µW/in³", new PowerDensity(1, PowerDensityUnit.MicrowattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 µW/m³", new PowerDensity(1, PowerDensityUnit.MicrowattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µW/l", new PowerDensity(1, PowerDensityUnit.MicrowattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/ft³", new PowerDensity(1, PowerDensityUnit.MilliwattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 mW/in³", new PowerDensity(1, PowerDensityUnit.MilliwattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 mW/m³", new PowerDensity(1, PowerDensityUnit.MilliwattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 mW/l", new PowerDensity(1, PowerDensityUnit.MilliwattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 nW/ft³", new PowerDensity(1, PowerDensityUnit.NanowattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 nW/in³", new PowerDensity(1, PowerDensityUnit.NanowattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 nW/m³", new PowerDensity(1, PowerDensityUnit.NanowattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 nW/l", new PowerDensity(1, PowerDensityUnit.NanowattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 pW/ft³", new PowerDensity(1, PowerDensityUnit.PicowattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 pW/in³", new PowerDensity(1, PowerDensityUnit.PicowattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 pW/m³", new PowerDensity(1, PowerDensityUnit.PicowattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 pW/l", new PowerDensity(1, PowerDensityUnit.PicowattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 TW/ft³", new PowerDensity(1, PowerDensityUnit.TerawattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 TW/in³", new PowerDensity(1, PowerDensityUnit.TerawattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 TW/m³", new PowerDensity(1, PowerDensityUnit.TerawattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 TW/l", new PowerDensity(1, PowerDensityUnit.TerawattPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 W/ft³", new PowerDensity(1, PowerDensityUnit.WattPerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 W/in³", new PowerDensity(1, PowerDensityUnit.WattPerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 W/m³", new PowerDensity(1, PowerDensityUnit.WattPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 W/l", new PowerDensity(1, PowerDensityUnit.WattPerLiter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs index 3d574c0d19..1366776b63 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerRatioTestsBase.g.cs @@ -584,8 +584,8 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 dBmW", new PowerRatio(1, PowerRatioUnit.DecibelMilliwatt).ToString(swedishCulture)); - Assert.Equal("1 dBW", new PowerRatio(1, PowerRatioUnit.DecibelWatt).ToString(swedishCulture)); + Assert.Equal("1 dBmW", new PowerRatio(1, PowerRatioUnit.DecibelMilliwatt).ToString(null, swedishCulture)); + Assert.Equal("1 dBW", new PowerRatio(1, PowerRatioUnit.DecibelWatt).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs index b321b30596..c195450ee1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PowerTestsBase.g.cs @@ -1471,33 +1471,33 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 hp(S)", new Power(1, PowerUnit.BoilerHorsepower).ToString(swedishCulture)); - Assert.Equal("1 Btu/h", new Power(1, PowerUnit.BritishThermalUnitPerHour).ToString(swedishCulture)); - Assert.Equal("1 daW", new Power(1, PowerUnit.Decawatt).ToString(swedishCulture)); - Assert.Equal("1 dW", new Power(1, PowerUnit.Deciwatt).ToString(swedishCulture)); - Assert.Equal("1 hp(E)", new Power(1, PowerUnit.ElectricalHorsepower).ToString(swedishCulture)); - Assert.Equal("1 fW", new Power(1, PowerUnit.Femtowatt).ToString(swedishCulture)); - Assert.Equal("1 GJ/h", new Power(1, PowerUnit.GigajoulePerHour).ToString(swedishCulture)); - Assert.Equal("1 GW", new Power(1, PowerUnit.Gigawatt).ToString(swedishCulture)); - Assert.Equal("1 hp(H)", new Power(1, PowerUnit.HydraulicHorsepower).ToString(swedishCulture)); - Assert.Equal("1 J/h", new Power(1, PowerUnit.JoulePerHour).ToString(swedishCulture)); - Assert.Equal("1 kBtu/h", new Power(1, PowerUnit.KilobritishThermalUnitPerHour).ToString(swedishCulture)); - Assert.Equal("1 kJ/h", new Power(1, PowerUnit.KilojoulePerHour).ToString(swedishCulture)); - Assert.Equal("1 kW", new Power(1, PowerUnit.Kilowatt).ToString(swedishCulture)); - Assert.Equal("1 hp(I)", new Power(1, PowerUnit.MechanicalHorsepower).ToString(swedishCulture)); - Assert.Equal("1 MBtu/h", new Power(1, PowerUnit.MegabritishThermalUnitPerHour).ToString(swedishCulture)); - Assert.Equal("1 MJ/h", new Power(1, PowerUnit.MegajoulePerHour).ToString(swedishCulture)); - Assert.Equal("1 MW", new Power(1, PowerUnit.Megawatt).ToString(swedishCulture)); - Assert.Equal("1 hp(M)", new Power(1, PowerUnit.MetricHorsepower).ToString(swedishCulture)); - Assert.Equal("1 µW", new Power(1, PowerUnit.Microwatt).ToString(swedishCulture)); - Assert.Equal("1 mJ/h", new Power(1, PowerUnit.MillijoulePerHour).ToString(swedishCulture)); - Assert.Equal("1 mW", new Power(1, PowerUnit.Milliwatt).ToString(swedishCulture)); - Assert.Equal("1 nW", new Power(1, PowerUnit.Nanowatt).ToString(swedishCulture)); - Assert.Equal("1 PW", new Power(1, PowerUnit.Petawatt).ToString(swedishCulture)); - Assert.Equal("1 pW", new Power(1, PowerUnit.Picowatt).ToString(swedishCulture)); - Assert.Equal("1 TW", new Power(1, PowerUnit.Terawatt).ToString(swedishCulture)); - Assert.Equal("1 TR", new Power(1, PowerUnit.TonOfRefrigeration).ToString(swedishCulture)); - Assert.Equal("1 W", new Power(1, PowerUnit.Watt).ToString(swedishCulture)); + Assert.Equal("1 hp(S)", new Power(1, PowerUnit.BoilerHorsepower).ToString(null, swedishCulture)); + Assert.Equal("1 Btu/h", new Power(1, PowerUnit.BritishThermalUnitPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 daW", new Power(1, PowerUnit.Decawatt).ToString(null, swedishCulture)); + Assert.Equal("1 dW", new Power(1, PowerUnit.Deciwatt).ToString(null, swedishCulture)); + Assert.Equal("1 hp(E)", new Power(1, PowerUnit.ElectricalHorsepower).ToString(null, swedishCulture)); + Assert.Equal("1 fW", new Power(1, PowerUnit.Femtowatt).ToString(null, swedishCulture)); + Assert.Equal("1 GJ/h", new Power(1, PowerUnit.GigajoulePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 GW", new Power(1, PowerUnit.Gigawatt).ToString(null, swedishCulture)); + Assert.Equal("1 hp(H)", new Power(1, PowerUnit.HydraulicHorsepower).ToString(null, swedishCulture)); + Assert.Equal("1 J/h", new Power(1, PowerUnit.JoulePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kBtu/h", new Power(1, PowerUnit.KilobritishThermalUnitPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/h", new Power(1, PowerUnit.KilojoulePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kW", new Power(1, PowerUnit.Kilowatt).ToString(null, swedishCulture)); + Assert.Equal("1 hp(I)", new Power(1, PowerUnit.MechanicalHorsepower).ToString(null, swedishCulture)); + Assert.Equal("1 MBtu/h", new Power(1, PowerUnit.MegabritishThermalUnitPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/h", new Power(1, PowerUnit.MegajoulePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 MW", new Power(1, PowerUnit.Megawatt).ToString(null, swedishCulture)); + Assert.Equal("1 hp(M)", new Power(1, PowerUnit.MetricHorsepower).ToString(null, swedishCulture)); + Assert.Equal("1 µW", new Power(1, PowerUnit.Microwatt).ToString(null, swedishCulture)); + Assert.Equal("1 mJ/h", new Power(1, PowerUnit.MillijoulePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mW", new Power(1, PowerUnit.Milliwatt).ToString(null, swedishCulture)); + Assert.Equal("1 nW", new Power(1, PowerUnit.Nanowatt).ToString(null, swedishCulture)); + Assert.Equal("1 PW", new Power(1, PowerUnit.Petawatt).ToString(null, swedishCulture)); + Assert.Equal("1 pW", new Power(1, PowerUnit.Picowatt).ToString(null, swedishCulture)); + Assert.Equal("1 TW", new Power(1, PowerUnit.Terawatt).ToString(null, swedishCulture)); + Assert.Equal("1 TR", new Power(1, PowerUnit.TonOfRefrigeration).ToString(null, swedishCulture)); + Assert.Equal("1 W", new Power(1, PowerUnit.Watt).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs index f5514ad3b6..9159611964 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureChangeRateTestsBase.g.cs @@ -1681,24 +1681,24 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 atm/s", new PressureChangeRate(1, PressureChangeRateUnit.AtmospherePerSecond).ToString(swedishCulture)); - Assert.Equal("1 bar/min", new PressureChangeRate(1, PressureChangeRateUnit.BarPerMinute).ToString(swedishCulture)); - Assert.Equal("1 bar/s", new PressureChangeRate(1, PressureChangeRateUnit.BarPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kPa/min", new PressureChangeRate(1, PressureChangeRateUnit.KilopascalPerMinute).ToString(swedishCulture)); - Assert.Equal("1 kPa/s", new PressureChangeRate(1, PressureChangeRateUnit.KilopascalPerSecond).ToString(swedishCulture)); - Assert.Equal("1 ksi/min", new PressureChangeRate(1, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute).ToString(swedishCulture)); - Assert.Equal("1 ksi/s", new PressureChangeRate(1, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond).ToString(swedishCulture)); - Assert.Equal("1 MPa/min", new PressureChangeRate(1, PressureChangeRateUnit.MegapascalPerMinute).ToString(swedishCulture)); - Assert.Equal("1 MPa/s", new PressureChangeRate(1, PressureChangeRateUnit.MegapascalPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mpsi/min", new PressureChangeRate(1, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute).ToString(swedishCulture)); - Assert.Equal("1 Mpsi/s", new PressureChangeRate(1, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mbar/min", new PressureChangeRate(1, PressureChangeRateUnit.MillibarPerMinute).ToString(swedishCulture)); - Assert.Equal("1 mbar/s", new PressureChangeRate(1, PressureChangeRateUnit.MillibarPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mmHg/s", new PressureChangeRate(1, PressureChangeRateUnit.MillimeterOfMercuryPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Pa/min", new PressureChangeRate(1, PressureChangeRateUnit.PascalPerMinute).ToString(swedishCulture)); - Assert.Equal("1 Pa/s", new PressureChangeRate(1, PressureChangeRateUnit.PascalPerSecond).ToString(swedishCulture)); - Assert.Equal("1 psi/min", new PressureChangeRate(1, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute).ToString(swedishCulture)); - Assert.Equal("1 psi/s", new PressureChangeRate(1, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond).ToString(swedishCulture)); + Assert.Equal("1 atm/s", new PressureChangeRate(1, PressureChangeRateUnit.AtmospherePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 bar/min", new PressureChangeRate(1, PressureChangeRateUnit.BarPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 bar/s", new PressureChangeRate(1, PressureChangeRateUnit.BarPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kPa/min", new PressureChangeRate(1, PressureChangeRateUnit.KilopascalPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kPa/s", new PressureChangeRate(1, PressureChangeRateUnit.KilopascalPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 ksi/min", new PressureChangeRate(1, PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 ksi/s", new PressureChangeRate(1, PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 MPa/min", new PressureChangeRate(1, PressureChangeRateUnit.MegapascalPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 MPa/s", new PressureChangeRate(1, PressureChangeRateUnit.MegapascalPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mpsi/min", new PressureChangeRate(1, PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 Mpsi/s", new PressureChangeRate(1, PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mbar/min", new PressureChangeRate(1, PressureChangeRateUnit.MillibarPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 mbar/s", new PressureChangeRate(1, PressureChangeRateUnit.MillibarPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg/s", new PressureChangeRate(1, PressureChangeRateUnit.MillimeterOfMercuryPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Pa/min", new PressureChangeRate(1, PressureChangeRateUnit.PascalPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 Pa/s", new PressureChangeRate(1, PressureChangeRateUnit.PascalPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 psi/min", new PressureChangeRate(1, PressureChangeRateUnit.PoundForcePerSquareInchPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 psi/s", new PressureChangeRate(1, PressureChangeRateUnit.PoundForcePerSquareInchPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs index 014bbc3dd5..7a5cadac89 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/PressureTestsBase.g.cs @@ -2920,53 +2920,53 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 atm", new Pressure(1, PressureUnit.Atmosphere).ToString(swedishCulture)); - Assert.Equal("1 bar", new Pressure(1, PressureUnit.Bar).ToString(swedishCulture)); - Assert.Equal("1 cbar", new Pressure(1, PressureUnit.Centibar).ToString(swedishCulture)); - Assert.Equal("1 cmH₂O", new Pressure(1, PressureUnit.CentimeterOfWaterColumn).ToString(swedishCulture)); - Assert.Equal("1 daPa", new Pressure(1, PressureUnit.Decapascal).ToString(swedishCulture)); - Assert.Equal("1 dbar", new Pressure(1, PressureUnit.Decibar).ToString(swedishCulture)); - Assert.Equal("1 dyn/cm²", new Pressure(1, PressureUnit.DynePerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 ft of head", new Pressure(1, PressureUnit.FootOfHead).ToString(swedishCulture)); - Assert.Equal("1 GPa", new Pressure(1, PressureUnit.Gigapascal).ToString(swedishCulture)); - Assert.Equal("1 hPa", new Pressure(1, PressureUnit.Hectopascal).ToString(swedishCulture)); - Assert.Equal("1 inHg", new Pressure(1, PressureUnit.InchOfMercury).ToString(swedishCulture)); - Assert.Equal("1 inH2O", new Pressure(1, PressureUnit.InchOfWaterColumn).ToString(swedishCulture)); - Assert.Equal("1 kbar", new Pressure(1, PressureUnit.Kilobar).ToString(swedishCulture)); - Assert.Equal("1 kgf/cm²", new Pressure(1, PressureUnit.KilogramForcePerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/m²", new Pressure(1, PressureUnit.KilogramForcePerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/mm²", new Pressure(1, PressureUnit.KilogramForcePerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kN/cm²", new Pressure(1, PressureUnit.KilonewtonPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kN/m²", new Pressure(1, PressureUnit.KilonewtonPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 kN/mm²", new Pressure(1, PressureUnit.KilonewtonPerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kPa", new Pressure(1, PressureUnit.Kilopascal).ToString(swedishCulture)); - Assert.Equal("1 kipf/ft²", new Pressure(1, PressureUnit.KilopoundForcePerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 ksi", new Pressure(1, PressureUnit.KilopoundForcePerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 kipf/mil²", new Pressure(1, PressureUnit.KilopoundForcePerSquareMil).ToString(swedishCulture)); - Assert.Equal("1 Mbar", new Pressure(1, PressureUnit.Megabar).ToString(swedishCulture)); - Assert.Equal("1 MN/m²", new Pressure(1, PressureUnit.MeganewtonPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 MPa", new Pressure(1, PressureUnit.Megapascal).ToString(swedishCulture)); - Assert.Equal("1 m of head", new Pressure(1, PressureUnit.MeterOfHead).ToString(swedishCulture)); - Assert.Equal("1 mH₂O", new Pressure(1, PressureUnit.MeterOfWaterColumn).ToString(swedishCulture)); - Assert.Equal("1 µbar", new Pressure(1, PressureUnit.Microbar).ToString(swedishCulture)); - Assert.Equal("1 µPa", new Pressure(1, PressureUnit.Micropascal).ToString(swedishCulture)); - Assert.Equal("1 mbar", new Pressure(1, PressureUnit.Millibar).ToString(swedishCulture)); - Assert.Equal("1 mmHg", new Pressure(1, PressureUnit.MillimeterOfMercury).ToString(swedishCulture)); - Assert.Equal("1 mmH₂O", new Pressure(1, PressureUnit.MillimeterOfWaterColumn).ToString(swedishCulture)); - Assert.Equal("1 mPa", new Pressure(1, PressureUnit.Millipascal).ToString(swedishCulture)); - Assert.Equal("1 N/cm²", new Pressure(1, PressureUnit.NewtonPerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 N/m²", new Pressure(1, PressureUnit.NewtonPerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 N/mm²", new Pressure(1, PressureUnit.NewtonPerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 Pa", new Pressure(1, PressureUnit.Pascal).ToString(swedishCulture)); - Assert.Equal("1 lb/ft²", new Pressure(1, PressureUnit.PoundForcePerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 psi", new Pressure(1, PressureUnit.PoundForcePerSquareInch).ToString(swedishCulture)); - Assert.Equal("1 lb/mil²", new Pressure(1, PressureUnit.PoundForcePerSquareMil).ToString(swedishCulture)); - Assert.Equal("1 lbm/(in·s²)", new Pressure(1, PressureUnit.PoundPerInchSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 at", new Pressure(1, PressureUnit.TechnicalAtmosphere).ToString(swedishCulture)); - Assert.Equal("1 tf/cm²", new Pressure(1, PressureUnit.TonneForcePerSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 tf/m²", new Pressure(1, PressureUnit.TonneForcePerSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 tf/mm²", new Pressure(1, PressureUnit.TonneForcePerSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 torr", new Pressure(1, PressureUnit.Torr).ToString(swedishCulture)); + Assert.Equal("1 atm", new Pressure(1, PressureUnit.Atmosphere).ToString(null, swedishCulture)); + Assert.Equal("1 bar", new Pressure(1, PressureUnit.Bar).ToString(null, swedishCulture)); + Assert.Equal("1 cbar", new Pressure(1, PressureUnit.Centibar).ToString(null, swedishCulture)); + Assert.Equal("1 cmH₂O", new Pressure(1, PressureUnit.CentimeterOfWaterColumn).ToString(null, swedishCulture)); + Assert.Equal("1 daPa", new Pressure(1, PressureUnit.Decapascal).ToString(null, swedishCulture)); + Assert.Equal("1 dbar", new Pressure(1, PressureUnit.Decibar).ToString(null, swedishCulture)); + Assert.Equal("1 dyn/cm²", new Pressure(1, PressureUnit.DynePerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ft of head", new Pressure(1, PressureUnit.FootOfHead).ToString(null, swedishCulture)); + Assert.Equal("1 GPa", new Pressure(1, PressureUnit.Gigapascal).ToString(null, swedishCulture)); + Assert.Equal("1 hPa", new Pressure(1, PressureUnit.Hectopascal).ToString(null, swedishCulture)); + Assert.Equal("1 inHg", new Pressure(1, PressureUnit.InchOfMercury).ToString(null, swedishCulture)); + Assert.Equal("1 inH2O", new Pressure(1, PressureUnit.InchOfWaterColumn).ToString(null, swedishCulture)); + Assert.Equal("1 kbar", new Pressure(1, PressureUnit.Kilobar).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/cm²", new Pressure(1, PressureUnit.KilogramForcePerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/m²", new Pressure(1, PressureUnit.KilogramForcePerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/mm²", new Pressure(1, PressureUnit.KilogramForcePerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/cm²", new Pressure(1, PressureUnit.KilonewtonPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/m²", new Pressure(1, PressureUnit.KilonewtonPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/mm²", new Pressure(1, PressureUnit.KilonewtonPerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kPa", new Pressure(1, PressureUnit.Kilopascal).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/ft²", new Pressure(1, PressureUnit.KilopoundForcePerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 ksi", new Pressure(1, PressureUnit.KilopoundForcePerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/mil²", new Pressure(1, PressureUnit.KilopoundForcePerSquareMil).ToString(null, swedishCulture)); + Assert.Equal("1 Mbar", new Pressure(1, PressureUnit.Megabar).ToString(null, swedishCulture)); + Assert.Equal("1 MN/m²", new Pressure(1, PressureUnit.MeganewtonPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MPa", new Pressure(1, PressureUnit.Megapascal).ToString(null, swedishCulture)); + Assert.Equal("1 m of head", new Pressure(1, PressureUnit.MeterOfHead).ToString(null, swedishCulture)); + Assert.Equal("1 mH₂O", new Pressure(1, PressureUnit.MeterOfWaterColumn).ToString(null, swedishCulture)); + Assert.Equal("1 µbar", new Pressure(1, PressureUnit.Microbar).ToString(null, swedishCulture)); + Assert.Equal("1 µPa", new Pressure(1, PressureUnit.Micropascal).ToString(null, swedishCulture)); + Assert.Equal("1 mbar", new Pressure(1, PressureUnit.Millibar).ToString(null, swedishCulture)); + Assert.Equal("1 mmHg", new Pressure(1, PressureUnit.MillimeterOfMercury).ToString(null, swedishCulture)); + Assert.Equal("1 mmH₂O", new Pressure(1, PressureUnit.MillimeterOfWaterColumn).ToString(null, swedishCulture)); + Assert.Equal("1 mPa", new Pressure(1, PressureUnit.Millipascal).ToString(null, swedishCulture)); + Assert.Equal("1 N/cm²", new Pressure(1, PressureUnit.NewtonPerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/m²", new Pressure(1, PressureUnit.NewtonPerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/mm²", new Pressure(1, PressureUnit.NewtonPerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Pa", new Pressure(1, PressureUnit.Pascal).ToString(null, swedishCulture)); + Assert.Equal("1 lb/ft²", new Pressure(1, PressureUnit.PoundForcePerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 psi", new Pressure(1, PressureUnit.PoundForcePerSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 lb/mil²", new Pressure(1, PressureUnit.PoundForcePerSquareMil).ToString(null, swedishCulture)); + Assert.Equal("1 lbm/(in·s²)", new Pressure(1, PressureUnit.PoundPerInchSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 at", new Pressure(1, PressureUnit.TechnicalAtmosphere).ToString(null, swedishCulture)); + Assert.Equal("1 tf/cm²", new Pressure(1, PressureUnit.TonneForcePerSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf/m²", new Pressure(1, PressureUnit.TonneForcePerSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf/mm²", new Pressure(1, PressureUnit.TonneForcePerSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 torr", new Pressure(1, PressureUnit.Torr).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs index a443f17e54..73073bcb99 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseRateTestsBase.g.cs @@ -1019,16 +1019,16 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 µSv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MicrosievertPerHour).ToString(swedishCulture)); - Assert.Equal("1 µSv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MicrosievertPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mrem/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour).ToString(swedishCulture)); - Assert.Equal("1 mSv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MillisievertPerHour).ToString(swedishCulture)); - Assert.Equal("1 mSv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MillisievertPerSecond).ToString(swedishCulture)); - Assert.Equal("1 nSv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.NanosievertPerHour).ToString(swedishCulture)); - Assert.Equal("1 nSv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.NanosievertPerSecond).ToString(swedishCulture)); - Assert.Equal("1 rem/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour).ToString(swedishCulture)); - Assert.Equal("1 Sv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.SievertPerHour).ToString(swedishCulture)); - Assert.Equal("1 Sv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.SievertPerSecond).ToString(swedishCulture)); + Assert.Equal("1 µSv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MicrosievertPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 µSv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MicrosievertPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mrem/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mSv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MillisievertPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mSv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.MillisievertPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 nSv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.NanosievertPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 nSv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.NanosievertPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 rem/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 Sv/h", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.SievertPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 Sv/s", new RadiationEquivalentDoseRate(1, RadiationEquivalentDoseRateUnit.SievertPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs index 615beeec8d..d91f66857a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationEquivalentDoseTestsBase.g.cs @@ -819,12 +819,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 µSv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Microsievert).ToString(swedishCulture)); - Assert.Equal("1 mrem", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.MilliroentgenEquivalentMan).ToString(swedishCulture)); - Assert.Equal("1 mSv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Millisievert).ToString(swedishCulture)); - Assert.Equal("1 nSv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Nanosievert).ToString(swedishCulture)); - Assert.Equal("1 rem", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.RoentgenEquivalentMan).ToString(swedishCulture)); - Assert.Equal("1 Sv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Sievert).ToString(swedishCulture)); + Assert.Equal("1 µSv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Microsievert).ToString(null, swedishCulture)); + Assert.Equal("1 mrem", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.MilliroentgenEquivalentMan).ToString(null, swedishCulture)); + Assert.Equal("1 mSv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Millisievert).ToString(null, swedishCulture)); + Assert.Equal("1 nSv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Nanosievert).ToString(null, swedishCulture)); + Assert.Equal("1 rem", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.RoentgenEquivalentMan).ToString(null, swedishCulture)); + Assert.Equal("1 Sv", new RadiationEquivalentDose(1, RadiationEquivalentDoseUnit.Sievert).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs index 5960c2b6bf..89a6f5a814 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadiationExposureTestsBase.g.cs @@ -817,14 +817,14 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 C/kg", new RadiationExposure(1, RadiationExposureUnit.CoulombPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 µC/kg", new RadiationExposure(1, RadiationExposureUnit.MicrocoulombPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 µR", new RadiationExposure(1, RadiationExposureUnit.Microroentgen).ToString(swedishCulture)); - Assert.Equal("1 mC/kg", new RadiationExposure(1, RadiationExposureUnit.MillicoulombPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 mR", new RadiationExposure(1, RadiationExposureUnit.Milliroentgen).ToString(swedishCulture)); - Assert.Equal("1 nC/kg", new RadiationExposure(1, RadiationExposureUnit.NanocoulombPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 pC/kg", new RadiationExposure(1, RadiationExposureUnit.PicocoulombPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 R", new RadiationExposure(1, RadiationExposureUnit.Roentgen).ToString(swedishCulture)); + Assert.Equal("1 C/kg", new RadiationExposure(1, RadiationExposureUnit.CoulombPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 µC/kg", new RadiationExposure(1, RadiationExposureUnit.MicrocoulombPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 µR", new RadiationExposure(1, RadiationExposureUnit.Microroentgen).ToString(null, swedishCulture)); + Assert.Equal("1 mC/kg", new RadiationExposure(1, RadiationExposureUnit.MillicoulombPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 mR", new RadiationExposure(1, RadiationExposureUnit.Milliroentgen).ToString(null, swedishCulture)); + Assert.Equal("1 nC/kg", new RadiationExposure(1, RadiationExposureUnit.NanocoulombPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 pC/kg", new RadiationExposure(1, RadiationExposureUnit.PicocoulombPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 R", new RadiationExposure(1, RadiationExposureUnit.Roentgen).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs index cb06b4600f..48c402ce48 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RadioactivityTestsBase.g.cs @@ -1907,35 +1907,35 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Bq", new Radioactivity(1, RadioactivityUnit.Becquerel).ToString(swedishCulture)); - Assert.Equal("1 Ci", new Radioactivity(1, RadioactivityUnit.Curie).ToString(swedishCulture)); - Assert.Equal("1 EBq", new Radioactivity(1, RadioactivityUnit.Exabecquerel).ToString(swedishCulture)); - Assert.Equal("1 GBq", new Radioactivity(1, RadioactivityUnit.Gigabecquerel).ToString(swedishCulture)); - Assert.Equal("1 GCi", new Radioactivity(1, RadioactivityUnit.Gigacurie).ToString(swedishCulture)); - Assert.Equal("1 GRd", new Radioactivity(1, RadioactivityUnit.Gigarutherford).ToString(swedishCulture)); - Assert.Equal("1 kBq", new Radioactivity(1, RadioactivityUnit.Kilobecquerel).ToString(swedishCulture)); - Assert.Equal("1 kCi", new Radioactivity(1, RadioactivityUnit.Kilocurie).ToString(swedishCulture)); - Assert.Equal("1 kRd", new Radioactivity(1, RadioactivityUnit.Kilorutherford).ToString(swedishCulture)); - Assert.Equal("1 MBq", new Radioactivity(1, RadioactivityUnit.Megabecquerel).ToString(swedishCulture)); - Assert.Equal("1 MCi", new Radioactivity(1, RadioactivityUnit.Megacurie).ToString(swedishCulture)); - Assert.Equal("1 MRd", new Radioactivity(1, RadioactivityUnit.Megarutherford).ToString(swedishCulture)); - Assert.Equal("1 µBq", new Radioactivity(1, RadioactivityUnit.Microbecquerel).ToString(swedishCulture)); - Assert.Equal("1 µCi", new Radioactivity(1, RadioactivityUnit.Microcurie).ToString(swedishCulture)); - Assert.Equal("1 µRd", new Radioactivity(1, RadioactivityUnit.Microrutherford).ToString(swedishCulture)); - Assert.Equal("1 mBq", new Radioactivity(1, RadioactivityUnit.Millibecquerel).ToString(swedishCulture)); - Assert.Equal("1 mCi", new Radioactivity(1, RadioactivityUnit.Millicurie).ToString(swedishCulture)); - Assert.Equal("1 mRd", new Radioactivity(1, RadioactivityUnit.Millirutherford).ToString(swedishCulture)); - Assert.Equal("1 nBq", new Radioactivity(1, RadioactivityUnit.Nanobecquerel).ToString(swedishCulture)); - Assert.Equal("1 nCi", new Radioactivity(1, RadioactivityUnit.Nanocurie).ToString(swedishCulture)); - Assert.Equal("1 nRd", new Radioactivity(1, RadioactivityUnit.Nanorutherford).ToString(swedishCulture)); - Assert.Equal("1 PBq", new Radioactivity(1, RadioactivityUnit.Petabecquerel).ToString(swedishCulture)); - Assert.Equal("1 pBq", new Radioactivity(1, RadioactivityUnit.Picobecquerel).ToString(swedishCulture)); - Assert.Equal("1 pCi", new Radioactivity(1, RadioactivityUnit.Picocurie).ToString(swedishCulture)); - Assert.Equal("1 pRd", new Radioactivity(1, RadioactivityUnit.Picorutherford).ToString(swedishCulture)); - Assert.Equal("1 Rd", new Radioactivity(1, RadioactivityUnit.Rutherford).ToString(swedishCulture)); - Assert.Equal("1 TBq", new Radioactivity(1, RadioactivityUnit.Terabecquerel).ToString(swedishCulture)); - Assert.Equal("1 TCi", new Radioactivity(1, RadioactivityUnit.Teracurie).ToString(swedishCulture)); - Assert.Equal("1 TRd", new Radioactivity(1, RadioactivityUnit.Terarutherford).ToString(swedishCulture)); + Assert.Equal("1 Bq", new Radioactivity(1, RadioactivityUnit.Becquerel).ToString(null, swedishCulture)); + Assert.Equal("1 Ci", new Radioactivity(1, RadioactivityUnit.Curie).ToString(null, swedishCulture)); + Assert.Equal("1 EBq", new Radioactivity(1, RadioactivityUnit.Exabecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 GBq", new Radioactivity(1, RadioactivityUnit.Gigabecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 GCi", new Radioactivity(1, RadioactivityUnit.Gigacurie).ToString(null, swedishCulture)); + Assert.Equal("1 GRd", new Radioactivity(1, RadioactivityUnit.Gigarutherford).ToString(null, swedishCulture)); + Assert.Equal("1 kBq", new Radioactivity(1, RadioactivityUnit.Kilobecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 kCi", new Radioactivity(1, RadioactivityUnit.Kilocurie).ToString(null, swedishCulture)); + Assert.Equal("1 kRd", new Radioactivity(1, RadioactivityUnit.Kilorutherford).ToString(null, swedishCulture)); + Assert.Equal("1 MBq", new Radioactivity(1, RadioactivityUnit.Megabecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 MCi", new Radioactivity(1, RadioactivityUnit.Megacurie).ToString(null, swedishCulture)); + Assert.Equal("1 MRd", new Radioactivity(1, RadioactivityUnit.Megarutherford).ToString(null, swedishCulture)); + Assert.Equal("1 µBq", new Radioactivity(1, RadioactivityUnit.Microbecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 µCi", new Radioactivity(1, RadioactivityUnit.Microcurie).ToString(null, swedishCulture)); + Assert.Equal("1 µRd", new Radioactivity(1, RadioactivityUnit.Microrutherford).ToString(null, swedishCulture)); + Assert.Equal("1 mBq", new Radioactivity(1, RadioactivityUnit.Millibecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 mCi", new Radioactivity(1, RadioactivityUnit.Millicurie).ToString(null, swedishCulture)); + Assert.Equal("1 mRd", new Radioactivity(1, RadioactivityUnit.Millirutherford).ToString(null, swedishCulture)); + Assert.Equal("1 nBq", new Radioactivity(1, RadioactivityUnit.Nanobecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 nCi", new Radioactivity(1, RadioactivityUnit.Nanocurie).ToString(null, swedishCulture)); + Assert.Equal("1 nRd", new Radioactivity(1, RadioactivityUnit.Nanorutherford).ToString(null, swedishCulture)); + Assert.Equal("1 PBq", new Radioactivity(1, RadioactivityUnit.Petabecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 pBq", new Radioactivity(1, RadioactivityUnit.Picobecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 pCi", new Radioactivity(1, RadioactivityUnit.Picocurie).ToString(null, swedishCulture)); + Assert.Equal("1 pRd", new Radioactivity(1, RadioactivityUnit.Picorutherford).ToString(null, swedishCulture)); + Assert.Equal("1 Rd", new Radioactivity(1, RadioactivityUnit.Rutherford).ToString(null, swedishCulture)); + Assert.Equal("1 TBq", new Radioactivity(1, RadioactivityUnit.Terabecquerel).ToString(null, swedishCulture)); + Assert.Equal("1 TCi", new Radioactivity(1, RadioactivityUnit.Teracurie).ToString(null, swedishCulture)); + Assert.Equal("1 TRd", new Radioactivity(1, RadioactivityUnit.Terarutherford).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs index bd60bc2d40..5ef84ca6a3 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioChangeRateTestsBase.g.cs @@ -619,8 +619,8 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 /s", new RatioChangeRate(1, RatioChangeRateUnit.DecimalFractionPerSecond).ToString(swedishCulture)); - Assert.Equal("1 %/s", new RatioChangeRate(1, RatioChangeRateUnit.PercentPerSecond).ToString(swedishCulture)); + Assert.Equal("1 /s", new RatioChangeRate(1, RatioChangeRateUnit.DecimalFractionPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 %/s", new RatioChangeRate(1, RatioChangeRateUnit.PercentPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs index 4773fa66e9..728e65e261 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RatioTestsBase.g.cs @@ -691,12 +691,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1", new Ratio(1, RatioUnit.DecimalFraction).ToString(swedishCulture)); - Assert.Equal("1 ppb", new Ratio(1, RatioUnit.PartPerBillion).ToString(swedishCulture)); - Assert.Equal("1 ppm", new Ratio(1, RatioUnit.PartPerMillion).ToString(swedishCulture)); - Assert.Equal("1 ‰", new Ratio(1, RatioUnit.PartPerThousand).ToString(swedishCulture)); - Assert.Equal("1 ppt", new Ratio(1, RatioUnit.PartPerTrillion).ToString(swedishCulture)); - Assert.Equal("1 %", new Ratio(1, RatioUnit.Percent).ToString(swedishCulture)); + Assert.Equal("1", new Ratio(1, RatioUnit.DecimalFraction).ToString(null, swedishCulture)); + Assert.Equal("1 ppb", new Ratio(1, RatioUnit.PartPerBillion).ToString(null, swedishCulture)); + Assert.Equal("1 ppm", new Ratio(1, RatioUnit.PartPerMillion).ToString(null, swedishCulture)); + Assert.Equal("1 ‰", new Ratio(1, RatioUnit.PartPerThousand).ToString(null, swedishCulture)); + Assert.Equal("1 ppt", new Ratio(1, RatioUnit.PartPerTrillion).ToString(null, swedishCulture)); + Assert.Equal("1 %", new Ratio(1, RatioUnit.Percent).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs index e72adb0281..b3b05cd026 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalAreaTestsBase.g.cs @@ -916,17 +916,17 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareCentimeter).ToString(swedishCulture)); - Assert.Equal("1 dm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareDecimeter).ToString(swedishCulture)); - Assert.Equal("1 ft⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 in⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareInch).ToString(swedishCulture)); - Assert.Equal("1 km⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareKilometer).ToString(swedishCulture)); - Assert.Equal("1 m⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMeter).ToString(swedishCulture)); - Assert.Equal("1 µm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMicrometer).ToString(swedishCulture)); - Assert.Equal("1 mi⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMile).ToString(swedishCulture)); - Assert.Equal("1 mm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMillimeter).ToString(swedishCulture)); - Assert.Equal("1 yd⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareYard).ToString(swedishCulture)); - Assert.Equal("1 ft⁻² (US)", new ReciprocalArea(1, ReciprocalAreaUnit.InverseUsSurveySquareFoot).ToString(swedishCulture)); + Assert.Equal("1 cm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ft⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 in⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareInch).ToString(null, swedishCulture)); + Assert.Equal("1 km⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareKilometer).ToString(null, swedishCulture)); + Assert.Equal("1 m⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMicrometer).ToString(null, swedishCulture)); + Assert.Equal("1 mi⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMile).ToString(null, swedishCulture)); + Assert.Equal("1 mm⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 yd⁻²", new ReciprocalArea(1, ReciprocalAreaUnit.InverseSquareYard).ToString(null, swedishCulture)); + Assert.Equal("1 ft⁻² (US)", new ReciprocalArea(1, ReciprocalAreaUnit.InverseUsSurveySquareFoot).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs index 875b3f6163..a00ddde90c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ReciprocalLengthTestsBase.g.cs @@ -1093,16 +1093,16 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseCentimeter).ToString(swedishCulture)); - Assert.Equal("1 ft⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseFoot).ToString(swedishCulture)); - Assert.Equal("1 in⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseInch).ToString(swedishCulture)); - Assert.Equal("1 m⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMeter).ToString(swedishCulture)); - Assert.Equal("1 µin⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMicroinch).ToString(swedishCulture)); - Assert.Equal("1 mil⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMil).ToString(swedishCulture)); - Assert.Equal("1 mi⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMile).ToString(swedishCulture)); - Assert.Equal("1 mm⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMillimeter).ToString(swedishCulture)); - Assert.Equal("1 ftUS⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseUsSurveyFoot).ToString(swedishCulture)); - Assert.Equal("1 yd⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseYard).ToString(swedishCulture)); + Assert.Equal("1 cm⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ft⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseFoot).ToString(null, swedishCulture)); + Assert.Equal("1 in⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseInch).ToString(null, swedishCulture)); + Assert.Equal("1 m⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µin⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMicroinch).ToString(null, swedishCulture)); + Assert.Equal("1 mil⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMil).ToString(null, swedishCulture)); + Assert.Equal("1 mi⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMile).ToString(null, swedishCulture)); + Assert.Equal("1 mm⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ftUS⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseUsSurveyFoot).ToString(null, swedishCulture)); + Assert.Equal("1 yd⁻¹", new ReciprocalLength(1, ReciprocalLengthUnit.InverseYard).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs index 8c7adfd773..bf74b32e21 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RelativeHumidityTestsBase.g.cs @@ -525,7 +525,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 %RH", new RelativeHumidity(1, RelativeHumidityUnit.Percent).ToString(swedishCulture)); + Assert.Equal("1 %RH", new RelativeHumidity(1, RelativeHumidityUnit.Percent).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs index 9b100a9e0a..d2736202f4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalAccelerationTestsBase.g.cs @@ -706,10 +706,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 °/s²", new RotationalAcceleration(1, RotationalAccelerationUnit.DegreePerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 rad/s²", new RotationalAcceleration(1, RotationalAccelerationUnit.RadianPerSecondSquared).ToString(swedishCulture)); - Assert.Equal("1 rpm/s", new RotationalAcceleration(1, RotationalAccelerationUnit.RevolutionPerMinutePerSecond).ToString(swedishCulture)); - Assert.Equal("1 r/s²", new RotationalAcceleration(1, RotationalAccelerationUnit.RevolutionPerSecondSquared).ToString(swedishCulture)); + Assert.Equal("1 °/s²", new RotationalAcceleration(1, RotationalAccelerationUnit.DegreePerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 rad/s²", new RotationalAcceleration(1, RotationalAccelerationUnit.RadianPerSecondSquared).ToString(null, swedishCulture)); + Assert.Equal("1 rpm/s", new RotationalAcceleration(1, RotationalAccelerationUnit.RevolutionPerMinutePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 r/s²", new RotationalAcceleration(1, RotationalAccelerationUnit.RevolutionPerSecondSquared).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs index 53ba7b51ce..c985be0071 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalSpeedTestsBase.g.cs @@ -1312,19 +1312,19 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 crad/s", new RotationalSpeed(1, RotationalSpeedUnit.CentiradianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 drad/s", new RotationalSpeed(1, RotationalSpeedUnit.DeciradianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 °/min", new RotationalSpeed(1, RotationalSpeedUnit.DegreePerMinute).ToString(swedishCulture)); - Assert.Equal("1 °/s", new RotationalSpeed(1, RotationalSpeedUnit.DegreePerSecond).ToString(swedishCulture)); - Assert.Equal("1 µ°/s", new RotationalSpeed(1, RotationalSpeedUnit.MicrodegreePerSecond).ToString(swedishCulture)); - Assert.Equal("1 µrad/s", new RotationalSpeed(1, RotationalSpeedUnit.MicroradianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 m°/s", new RotationalSpeed(1, RotationalSpeedUnit.MillidegreePerSecond).ToString(swedishCulture)); - Assert.Equal("1 mrad/s", new RotationalSpeed(1, RotationalSpeedUnit.MilliradianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 n°/s", new RotationalSpeed(1, RotationalSpeedUnit.NanodegreePerSecond).ToString(swedishCulture)); - Assert.Equal("1 nrad/s", new RotationalSpeed(1, RotationalSpeedUnit.NanoradianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 rad/s", new RotationalSpeed(1, RotationalSpeedUnit.RadianPerSecond).ToString(swedishCulture)); - Assert.Equal("1 rpm", new RotationalSpeed(1, RotationalSpeedUnit.RevolutionPerMinute).ToString(swedishCulture)); - Assert.Equal("1 r/s", new RotationalSpeed(1, RotationalSpeedUnit.RevolutionPerSecond).ToString(swedishCulture)); + Assert.Equal("1 crad/s", new RotationalSpeed(1, RotationalSpeedUnit.CentiradianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 drad/s", new RotationalSpeed(1, RotationalSpeedUnit.DeciradianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 °/min", new RotationalSpeed(1, RotationalSpeedUnit.DegreePerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 °/s", new RotationalSpeed(1, RotationalSpeedUnit.DegreePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µ°/s", new RotationalSpeed(1, RotationalSpeedUnit.MicrodegreePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µrad/s", new RotationalSpeed(1, RotationalSpeedUnit.MicroradianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 m°/s", new RotationalSpeed(1, RotationalSpeedUnit.MillidegreePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mrad/s", new RotationalSpeed(1, RotationalSpeedUnit.MilliradianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 n°/s", new RotationalSpeed(1, RotationalSpeedUnit.NanodegreePerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 nrad/s", new RotationalSpeed(1, RotationalSpeedUnit.NanoradianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 rad/s", new RotationalSpeed(1, RotationalSpeedUnit.RadianPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 rpm", new RotationalSpeed(1, RotationalSpeedUnit.RevolutionPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 r/s", new RotationalSpeed(1, RotationalSpeedUnit.RevolutionPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs index 2967405740..fed2a458b4 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessPerLengthTestsBase.g.cs @@ -886,11 +886,11 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kN·m/rad/m", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter).ToString(swedishCulture)); - Assert.Equal("1 kipf·ft/°/ft", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot).ToString(swedishCulture)); - Assert.Equal("1 MN·m/rad/m", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter).ToString(swedishCulture)); - Assert.Equal("1 N·m/rad/m", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter).ToString(swedishCulture)); - Assert.Equal("1 lbf·ft/deg/ft", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot).ToString(swedishCulture)); + Assert.Equal("1 kN·m/rad/m", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kipf·ft/°/ft", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 MN·m/rad/m", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 N·m/rad/m", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·ft/deg/ft", new RotationalStiffnessPerLength(1, RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs index 122ebdbd8e..f106569f3d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/RotationalStiffnessTestsBase.g.cs @@ -3013,39 +3013,39 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.CentinewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 cN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 cN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 daN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecanewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 daN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 daN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 dN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecinewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 dN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 dN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 kN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 kN·m/rad", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 kN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 kN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 kipf·ft/°", new RotationalStiffness(1, RotationalStiffnessUnit.KilopoundForceFootPerDegrees).ToString(swedishCulture)); - Assert.Equal("1 MN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 MN·m/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 MN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 MN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 µN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MicronewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 µN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 µN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 mN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MillinewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 mN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 mN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 nN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NanonewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 nN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 nN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 N·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 N·m/rad", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 N·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMillimeterPerDegree).ToString(swedishCulture)); - Assert.Equal("1 N·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMillimeterPerRadian).ToString(swedishCulture)); - Assert.Equal("1 lbf·ft/rad", new RotationalStiffness(1, RotationalStiffnessUnit.PoundForceFeetPerRadian).ToString(swedishCulture)); - Assert.Equal("1 lbf·ft/deg", new RotationalStiffness(1, RotationalStiffnessUnit.PoundForceFootPerDegrees).ToString(swedishCulture)); + Assert.Equal("1 cN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.CentinewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 cN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.CentinewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 cN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.CentinewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 daN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecanewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 daN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecanewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 daN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.DecanewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 dN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecinewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 dN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.DecinewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 dN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.DecinewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 kN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 kN·m/rad", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 kN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 kN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.KilonewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 kipf·ft/°", new RotationalStiffness(1, RotationalStiffnessUnit.KilopoundForceFootPerDegrees).ToString(null, swedishCulture)); + Assert.Equal("1 MN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 MN·m/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 MN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 MN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MeganewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 µN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MicronewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 µN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MicronewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 µN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MicronewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 mN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MillinewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 mN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.MillinewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 mN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.MillinewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 nN·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NanonewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 nN·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NanonewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 nN·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.NanonewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 N·m/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 N·m/rad", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 N·mm/deg", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMillimeterPerDegree).ToString(null, swedishCulture)); + Assert.Equal("1 N·mm/rad", new RotationalStiffness(1, RotationalStiffnessUnit.NewtonMillimeterPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·ft/rad", new RotationalStiffness(1, RotationalStiffnessUnit.PoundForceFeetPerRadian).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·ft/deg", new RotationalStiffness(1, RotationalStiffnessUnit.PoundForceFootPerDegrees).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs index bec1aaf660..8619e6012c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ScalarTestsBase.g.cs @@ -525,7 +525,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1", new Scalar(1, ScalarUnit.Amount).ToString(swedishCulture)); + Assert.Equal("1", new Scalar(1, ScalarUnit.Amount).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs index 803e0f6bf7..145977e63b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SolidAngleTestsBase.g.cs @@ -525,7 +525,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 sr", new SolidAngle(1, SolidAngleUnit.Steradian).ToString(swedishCulture)); + Assert.Equal("1 sr", new SolidAngle(1, SolidAngleUnit.Steradian).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs index 88b83c8c44..e079c12140 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEnergyTestsBase.g.cs @@ -1543,36 +1543,36 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 btu/lb", new SpecificEnergy(1, SpecificEnergyUnit.BtuPerPound).ToString(swedishCulture)); - Assert.Equal("1 cal/g", new SpecificEnergy(1, SpecificEnergyUnit.CaloriePerGram).ToString(swedishCulture)); - Assert.Equal("1 GWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.GigawattDayPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 GWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.GigawattDayPerShortTon).ToString(swedishCulture)); - Assert.Equal("1 GWd/t", new SpecificEnergy(1, SpecificEnergyUnit.GigawattDayPerTonne).ToString(swedishCulture)); - Assert.Equal("1 GWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.GigawattHourPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 GWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.GigawattHourPerPound).ToString(swedishCulture)); - Assert.Equal("1 J/kg", new SpecificEnergy(1, SpecificEnergyUnit.JoulePerKilogram).ToString(swedishCulture)); - Assert.Equal("1 kcal/g", new SpecificEnergy(1, SpecificEnergyUnit.KilocaloriePerGram).ToString(swedishCulture)); - Assert.Equal("1 kJ/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilojoulePerKilogram).ToString(swedishCulture)); - Assert.Equal("1 kWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilowattDayPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 kWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.KilowattDayPerShortTon).ToString(swedishCulture)); - Assert.Equal("1 kWd/t", new SpecificEnergy(1, SpecificEnergyUnit.KilowattDayPerTonne).ToString(swedishCulture)); - Assert.Equal("1 kWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 kWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerPound).ToString(swedishCulture)); - Assert.Equal("1 MJ/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegajoulePerKilogram).ToString(swedishCulture)); - Assert.Equal("1 MJ/t", new SpecificEnergy(1, SpecificEnergyUnit.MegaJoulePerTonne).ToString(swedishCulture)); - Assert.Equal("1 MWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 MWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerShortTon).ToString(swedishCulture)); - Assert.Equal("1 MWd/t", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerTonne).ToString(swedishCulture)); - Assert.Equal("1 MWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegawattHourPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 MWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.MegawattHourPerPound).ToString(swedishCulture)); - Assert.Equal("1 TWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.TerawattDayPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 TWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.TerawattDayPerShortTon).ToString(swedishCulture)); - Assert.Equal("1 TWd/t", new SpecificEnergy(1, SpecificEnergyUnit.TerawattDayPerTonne).ToString(swedishCulture)); - Assert.Equal("1 Wd/kg", new SpecificEnergy(1, SpecificEnergyUnit.WattDayPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 Wd/ST", new SpecificEnergy(1, SpecificEnergyUnit.WattDayPerShortTon).ToString(swedishCulture)); - Assert.Equal("1 Wd/t", new SpecificEnergy(1, SpecificEnergyUnit.WattDayPerTonne).ToString(swedishCulture)); - Assert.Equal("1 Wh/kg", new SpecificEnergy(1, SpecificEnergyUnit.WattHourPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 Wh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.WattHourPerPound).ToString(swedishCulture)); + Assert.Equal("1 btu/lb", new SpecificEnergy(1, SpecificEnergyUnit.BtuPerPound).ToString(null, swedishCulture)); + Assert.Equal("1 cal/g", new SpecificEnergy(1, SpecificEnergyUnit.CaloriePerGram).ToString(null, swedishCulture)); + Assert.Equal("1 GWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.GigawattDayPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 GWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.GigawattDayPerShortTon).ToString(null, swedishCulture)); + Assert.Equal("1 GWd/t", new SpecificEnergy(1, SpecificEnergyUnit.GigawattDayPerTonne).ToString(null, swedishCulture)); + Assert.Equal("1 GWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.GigawattHourPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 GWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.GigawattHourPerPound).ToString(null, swedishCulture)); + Assert.Equal("1 J/kg", new SpecificEnergy(1, SpecificEnergyUnit.JoulePerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/g", new SpecificEnergy(1, SpecificEnergyUnit.KilocaloriePerGram).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilojoulePerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 kWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilowattDayPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 kWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.KilowattDayPerShortTon).ToString(null, swedishCulture)); + Assert.Equal("1 kWd/t", new SpecificEnergy(1, SpecificEnergyUnit.KilowattDayPerTonne).ToString(null, swedishCulture)); + Assert.Equal("1 kWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 kWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.KilowattHourPerPound).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegajoulePerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/t", new SpecificEnergy(1, SpecificEnergyUnit.MegaJoulePerTonne).ToString(null, swedishCulture)); + Assert.Equal("1 MWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 MWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerShortTon).ToString(null, swedishCulture)); + Assert.Equal("1 MWd/t", new SpecificEnergy(1, SpecificEnergyUnit.MegawattDayPerTonne).ToString(null, swedishCulture)); + Assert.Equal("1 MWh/kg", new SpecificEnergy(1, SpecificEnergyUnit.MegawattHourPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 MWh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.MegawattHourPerPound).ToString(null, swedishCulture)); + Assert.Equal("1 TWd/kg", new SpecificEnergy(1, SpecificEnergyUnit.TerawattDayPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 TWd/ST", new SpecificEnergy(1, SpecificEnergyUnit.TerawattDayPerShortTon).ToString(null, swedishCulture)); + Assert.Equal("1 TWd/t", new SpecificEnergy(1, SpecificEnergyUnit.TerawattDayPerTonne).ToString(null, swedishCulture)); + Assert.Equal("1 Wd/kg", new SpecificEnergy(1, SpecificEnergyUnit.WattDayPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 Wd/ST", new SpecificEnergy(1, SpecificEnergyUnit.WattDayPerShortTon).ToString(null, swedishCulture)); + Assert.Equal("1 Wd/t", new SpecificEnergy(1, SpecificEnergyUnit.WattDayPerTonne).ToString(null, swedishCulture)); + Assert.Equal("1 Wh/kg", new SpecificEnergy(1, SpecificEnergyUnit.WattHourPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 Wh/lbs", new SpecificEnergy(1, SpecificEnergyUnit.WattHourPerPound).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs index b7be2f1f7c..1d571fe96a 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificEntropyTestsBase.g.cs @@ -871,15 +871,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 BTU/(lb·°F)", new SpecificEntropy(1, SpecificEntropyUnit.BtuPerPoundFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 cal/g·K", new SpecificEntropy(1, SpecificEntropyUnit.CaloriePerGramKelvin).ToString(swedishCulture)); - Assert.Equal("1 J/kg·°C", new SpecificEntropy(1, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 J/kg·K", new SpecificEntropy(1, SpecificEntropyUnit.JoulePerKilogramKelvin).ToString(swedishCulture)); - Assert.Equal("1 kcal/g·K", new SpecificEntropy(1, SpecificEntropyUnit.KilocaloriePerGramKelvin).ToString(swedishCulture)); - Assert.Equal("1 kJ/kg·°C", new SpecificEntropy(1, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 kJ/kg·K", new SpecificEntropy(1, SpecificEntropyUnit.KilojoulePerKilogramKelvin).ToString(swedishCulture)); - Assert.Equal("1 MJ/kg·°C", new SpecificEntropy(1, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 MJ/kg·K", new SpecificEntropy(1, SpecificEntropyUnit.MegajoulePerKilogramKelvin).ToString(swedishCulture)); + Assert.Equal("1 BTU/(lb·°F)", new SpecificEntropy(1, SpecificEntropyUnit.BtuPerPoundFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 cal/g·K", new SpecificEntropy(1, SpecificEntropyUnit.CaloriePerGramKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 J/kg·°C", new SpecificEntropy(1, SpecificEntropyUnit.JoulePerKilogramDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 J/kg·K", new SpecificEntropy(1, SpecificEntropyUnit.JoulePerKilogramKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/g·K", new SpecificEntropy(1, SpecificEntropyUnit.KilocaloriePerGramKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/kg·°C", new SpecificEntropy(1, SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/kg·K", new SpecificEntropy(1, SpecificEntropyUnit.KilojoulePerKilogramKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/kg·°C", new SpecificEntropy(1, SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/kg·K", new SpecificEntropy(1, SpecificEntropyUnit.MegajoulePerKilogramKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs index eebaaf98a3..cef5404aea 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificFuelConsumptionTestsBase.g.cs @@ -685,10 +685,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 g/(kN·s)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.GramPerKilonewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 kg/(kgf·h)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour).ToString(swedishCulture)); - Assert.Equal("1 kg/(kN·s)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.KilogramPerKilonewtonSecond).ToString(swedishCulture)); - Assert.Equal("1 lb/(lbf·h)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour).ToString(swedishCulture)); + Assert.Equal("1 g/(kN·s)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.GramPerKilonewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kg/(kgf·h)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour).ToString(null, swedishCulture)); + Assert.Equal("1 kg/(kN·s)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.KilogramPerKilonewtonSecond).ToString(null, swedishCulture)); + Assert.Equal("1 lb/(lbf·h)", new SpecificFuelConsumption(1, SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs index 21eef2f26a..bc13b84c37 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificVolumeTestsBase.g.cs @@ -652,9 +652,9 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 ft³/lb", new SpecificVolume(1, SpecificVolumeUnit.CubicFootPerPound).ToString(swedishCulture)); - Assert.Equal("1 m³/kg", new SpecificVolume(1, SpecificVolumeUnit.CubicMeterPerKilogram).ToString(swedishCulture)); - Assert.Equal("1 mm³/kg", new SpecificVolume(1, SpecificVolumeUnit.MillicubicMeterPerKilogram).ToString(swedishCulture)); + Assert.Equal("1 ft³/lb", new SpecificVolume(1, SpecificVolumeUnit.CubicFootPerPound).ToString(null, swedishCulture)); + Assert.Equal("1 m³/kg", new SpecificVolume(1, SpecificVolumeUnit.CubicMeterPerKilogram).ToString(null, swedishCulture)); + Assert.Equal("1 mm³/kg", new SpecificVolume(1, SpecificVolumeUnit.MillicubicMeterPerKilogram).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs index f05740c9aa..287c456c44 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpecificWeightTestsBase.g.cs @@ -1114,23 +1114,23 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 kgf/cm³", new SpecificWeight(1, SpecificWeightUnit.KilogramForcePerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/m³", new SpecificWeight(1, SpecificWeightUnit.KilogramForcePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kgf/mm³", new SpecificWeight(1, SpecificWeightUnit.KilogramForcePerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kN/cm³", new SpecificWeight(1, SpecificWeightUnit.KilonewtonPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kN/m³", new SpecificWeight(1, SpecificWeightUnit.KilonewtonPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kN/mm³", new SpecificWeight(1, SpecificWeightUnit.KilonewtonPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kipf/ft³", new SpecificWeight(1, SpecificWeightUnit.KilopoundForcePerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 kipf/in³", new SpecificWeight(1, SpecificWeightUnit.KilopoundForcePerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 MN/m³", new SpecificWeight(1, SpecificWeightUnit.MeganewtonPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 N/cm³", new SpecificWeight(1, SpecificWeightUnit.NewtonPerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 N/m³", new SpecificWeight(1, SpecificWeightUnit.NewtonPerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 N/mm³", new SpecificWeight(1, SpecificWeightUnit.NewtonPerCubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 lbf/ft³", new SpecificWeight(1, SpecificWeightUnit.PoundForcePerCubicFoot).ToString(swedishCulture)); - Assert.Equal("1 lbf/in³", new SpecificWeight(1, SpecificWeightUnit.PoundForcePerCubicInch).ToString(swedishCulture)); - Assert.Equal("1 tf/cm³", new SpecificWeight(1, SpecificWeightUnit.TonneForcePerCubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 tf/m³", new SpecificWeight(1, SpecificWeightUnit.TonneForcePerCubicMeter).ToString(swedishCulture)); - Assert.Equal("1 tf/mm³", new SpecificWeight(1, SpecificWeightUnit.TonneForcePerCubicMillimeter).ToString(swedishCulture)); + Assert.Equal("1 kgf/cm³", new SpecificWeight(1, SpecificWeightUnit.KilogramForcePerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/m³", new SpecificWeight(1, SpecificWeightUnit.KilogramForcePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf/mm³", new SpecificWeight(1, SpecificWeightUnit.KilogramForcePerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/cm³", new SpecificWeight(1, SpecificWeightUnit.KilonewtonPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/m³", new SpecificWeight(1, SpecificWeightUnit.KilonewtonPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN/mm³", new SpecificWeight(1, SpecificWeightUnit.KilonewtonPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/ft³", new SpecificWeight(1, SpecificWeightUnit.KilopoundForcePerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kipf/in³", new SpecificWeight(1, SpecificWeightUnit.KilopoundForcePerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 MN/m³", new SpecificWeight(1, SpecificWeightUnit.MeganewtonPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/cm³", new SpecificWeight(1, SpecificWeightUnit.NewtonPerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/m³", new SpecificWeight(1, SpecificWeightUnit.NewtonPerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 N/mm³", new SpecificWeight(1, SpecificWeightUnit.NewtonPerCubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/ft³", new SpecificWeight(1, SpecificWeightUnit.PoundForcePerCubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lbf/in³", new SpecificWeight(1, SpecificWeightUnit.PoundForcePerCubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 tf/cm³", new SpecificWeight(1, SpecificWeightUnit.TonneForcePerCubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf/m³", new SpecificWeight(1, SpecificWeightUnit.TonneForcePerCubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf/mm³", new SpecificWeight(1, SpecificWeightUnit.TonneForcePerCubicMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs index 4e3be5e6a1..fecf60470d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/SpeedTestsBase.g.cs @@ -2176,39 +2176,39 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm/h", new Speed(1, SpeedUnit.CentimeterPerHour).ToString(swedishCulture)); - Assert.Equal("1 cm/min", new Speed(1, SpeedUnit.CentimeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 cm/s", new Speed(1, SpeedUnit.CentimeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 dm/min", new Speed(1, SpeedUnit.DecimeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 dm/s", new Speed(1, SpeedUnit.DecimeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 ft/h", new Speed(1, SpeedUnit.FootPerHour).ToString(swedishCulture)); - Assert.Equal("1 ft/min", new Speed(1, SpeedUnit.FootPerMinute).ToString(swedishCulture)); - Assert.Equal("1 ft/s", new Speed(1, SpeedUnit.FootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 in/h", new Speed(1, SpeedUnit.InchPerHour).ToString(swedishCulture)); - Assert.Equal("1 in/min", new Speed(1, SpeedUnit.InchPerMinute).ToString(swedishCulture)); - Assert.Equal("1 in/s", new Speed(1, SpeedUnit.InchPerSecond).ToString(swedishCulture)); - Assert.Equal("1 km/h", new Speed(1, SpeedUnit.KilometerPerHour).ToString(swedishCulture)); - Assert.Equal("1 km/min", new Speed(1, SpeedUnit.KilometerPerMinute).ToString(swedishCulture)); - Assert.Equal("1 km/s", new Speed(1, SpeedUnit.KilometerPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kn", new Speed(1, SpeedUnit.Knot).ToString(swedishCulture)); - Assert.Equal("1 M", new Speed(1, SpeedUnit.Mach).ToString(swedishCulture)); - Assert.Equal("1 m/h", new Speed(1, SpeedUnit.MeterPerHour).ToString(swedishCulture)); - Assert.Equal("1 m/min", new Speed(1, SpeedUnit.MeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 m/s", new Speed(1, SpeedUnit.MeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 µm/min", new Speed(1, SpeedUnit.MicrometerPerMinute).ToString(swedishCulture)); - Assert.Equal("1 µm/s", new Speed(1, SpeedUnit.MicrometerPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mph", new Speed(1, SpeedUnit.MilePerHour).ToString(swedishCulture)); - Assert.Equal("1 mm/h", new Speed(1, SpeedUnit.MillimeterPerHour).ToString(swedishCulture)); - Assert.Equal("1 mm/min", new Speed(1, SpeedUnit.MillimeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 mm/s", new Speed(1, SpeedUnit.MillimeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 nm/min", new Speed(1, SpeedUnit.NanometerPerMinute).ToString(swedishCulture)); - Assert.Equal("1 nm/s", new Speed(1, SpeedUnit.NanometerPerSecond).ToString(swedishCulture)); - Assert.Equal("1 ftUS/h", new Speed(1, SpeedUnit.UsSurveyFootPerHour).ToString(swedishCulture)); - Assert.Equal("1 ftUS/min", new Speed(1, SpeedUnit.UsSurveyFootPerMinute).ToString(swedishCulture)); - Assert.Equal("1 ftUS/s", new Speed(1, SpeedUnit.UsSurveyFootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 yd/h", new Speed(1, SpeedUnit.YardPerHour).ToString(swedishCulture)); - Assert.Equal("1 yd/min", new Speed(1, SpeedUnit.YardPerMinute).ToString(swedishCulture)); - Assert.Equal("1 yd/s", new Speed(1, SpeedUnit.YardPerSecond).ToString(swedishCulture)); + Assert.Equal("1 cm/h", new Speed(1, SpeedUnit.CentimeterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 cm/min", new Speed(1, SpeedUnit.CentimeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 cm/s", new Speed(1, SpeedUnit.CentimeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dm/min", new Speed(1, SpeedUnit.DecimeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 dm/s", new Speed(1, SpeedUnit.DecimeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 ft/h", new Speed(1, SpeedUnit.FootPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 ft/min", new Speed(1, SpeedUnit.FootPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 ft/s", new Speed(1, SpeedUnit.FootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 in/h", new Speed(1, SpeedUnit.InchPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 in/min", new Speed(1, SpeedUnit.InchPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 in/s", new Speed(1, SpeedUnit.InchPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 km/h", new Speed(1, SpeedUnit.KilometerPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 km/min", new Speed(1, SpeedUnit.KilometerPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 km/s", new Speed(1, SpeedUnit.KilometerPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kn", new Speed(1, SpeedUnit.Knot).ToString(null, swedishCulture)); + Assert.Equal("1 M", new Speed(1, SpeedUnit.Mach).ToString(null, swedishCulture)); + Assert.Equal("1 m/h", new Speed(1, SpeedUnit.MeterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 m/min", new Speed(1, SpeedUnit.MeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 m/s", new Speed(1, SpeedUnit.MeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µm/min", new Speed(1, SpeedUnit.MicrometerPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 µm/s", new Speed(1, SpeedUnit.MicrometerPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mph", new Speed(1, SpeedUnit.MilePerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mm/h", new Speed(1, SpeedUnit.MillimeterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 mm/min", new Speed(1, SpeedUnit.MillimeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 mm/s", new Speed(1, SpeedUnit.MillimeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 nm/min", new Speed(1, SpeedUnit.NanometerPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 nm/s", new Speed(1, SpeedUnit.NanometerPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 ftUS/h", new Speed(1, SpeedUnit.UsSurveyFootPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 ftUS/min", new Speed(1, SpeedUnit.UsSurveyFootPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 ftUS/s", new Speed(1, SpeedUnit.UsSurveyFootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 yd/h", new Speed(1, SpeedUnit.YardPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 yd/min", new Speed(1, SpeedUnit.YardPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 yd/s", new Speed(1, SpeedUnit.YardPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs index 62a1a307d2..fa1d827523 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/StandardVolumeFlowTestsBase.g.cs @@ -850,15 +850,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 sccm", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 scfh", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicFootPerHour).ToString(swedishCulture)); - Assert.Equal("1 scfm", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicFootPerMinute).ToString(swedishCulture)); - Assert.Equal("1 Sft³/s", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicFootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Sm³/d", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerDay).ToString(swedishCulture)); - Assert.Equal("1 Sm³/h", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerHour).ToString(swedishCulture)); - Assert.Equal("1 Sm³/min", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 Sm³/s", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 slm", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardLiterPerMinute).ToString(swedishCulture)); + Assert.Equal("1 sccm", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 scfh", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicFootPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 scfm", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicFootPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 Sft³/s", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicFootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Sm³/d", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 Sm³/h", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 Sm³/min", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 Sm³/s", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardCubicMeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 slm", new StandardVolumeFlow(1, StandardVolumeFlowUnit.StandardLiterPerMinute).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs index e67c9bf1af..1fc4e82f2c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureChangeRateTestsBase.g.cs @@ -1114,23 +1114,23 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 c°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 da°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 d°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 °C/h", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeCelsiusPerHour).ToString(swedishCulture)); - Assert.Equal("1 °C/min", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeCelsiusPerMinute).ToString(swedishCulture)); - Assert.Equal("1 °C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 °F/h", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeFahrenheitPerHour).ToString(swedishCulture)); - Assert.Equal("1 °F/min", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeFahrenheitPerMinute).ToString(swedishCulture)); - Assert.Equal("1 °F/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeFahrenheitPerSecond).ToString(swedishCulture)); - Assert.Equal("1 K/h", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeKelvinPerHour).ToString(swedishCulture)); - Assert.Equal("1 K/min", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeKelvinPerMinute).ToString(swedishCulture)); - Assert.Equal("1 K/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeKelvinPerSecond).ToString(swedishCulture)); - Assert.Equal("1 h°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 k°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 µ°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 m°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond).ToString(swedishCulture)); - Assert.Equal("1 n°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond).ToString(swedishCulture)); + Assert.Equal("1 c°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 da°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 d°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 °C/h", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeCelsiusPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 °C/min", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeCelsiusPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 °C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 °F/h", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeFahrenheitPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 °F/min", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeFahrenheitPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 °F/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeFahrenheitPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 K/h", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeKelvinPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 K/min", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeKelvinPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 K/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.DegreeKelvinPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 h°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 k°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 µ°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 m°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 n°C/s", new TemperatureChangeRate(1, TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs index c9c43808a1..61a66cc2d8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureDeltaTestsBase.g.cs @@ -850,15 +850,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 ∆°C", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 ∆°De", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeDelisle).ToString(swedishCulture)); - Assert.Equal("1 ∆°F", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 ∆°N", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeNewton).ToString(swedishCulture)); - Assert.Equal("1 ∆°R", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeRankine).ToString(swedishCulture)); - Assert.Equal("1 ∆°Ré", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeReaumur).ToString(swedishCulture)); - Assert.Equal("1 ∆°Rø", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeRoemer).ToString(swedishCulture)); - Assert.Equal("1 ∆K", new TemperatureDelta(1, TemperatureDeltaUnit.Kelvin).ToString(swedishCulture)); - Assert.Equal("1 ∆m°C", new TemperatureDelta(1, TemperatureDeltaUnit.MillidegreeCelsius).ToString(swedishCulture)); + Assert.Equal("1 ∆°C", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°De", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeDelisle).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°F", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°N", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeNewton).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°R", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeRankine).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°Ré", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeReaumur).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°Rø", new TemperatureDelta(1, TemperatureDeltaUnit.DegreeRoemer).ToString(null, swedishCulture)); + Assert.Equal("1 ∆K", new TemperatureDelta(1, TemperatureDeltaUnit.Kelvin).ToString(null, swedishCulture)); + Assert.Equal("1 ∆m°C", new TemperatureDelta(1, TemperatureDeltaUnit.MillidegreeCelsius).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs index 9b14c0aad5..8ba706436d 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureGradientTestsBase.g.cs @@ -685,10 +685,10 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 ∆°C/km", new TemperatureGradient(1, TemperatureGradientUnit.DegreeCelsiusPerKilometer).ToString(swedishCulture)); - Assert.Equal("1 ∆°C/m", new TemperatureGradient(1, TemperatureGradientUnit.DegreeCelsiusPerMeter).ToString(swedishCulture)); - Assert.Equal("1 ∆°F/ft", new TemperatureGradient(1, TemperatureGradientUnit.DegreeFahrenheitPerFoot).ToString(swedishCulture)); - Assert.Equal("1 ∆°K/m", new TemperatureGradient(1, TemperatureGradientUnit.KelvinPerMeter).ToString(swedishCulture)); + Assert.Equal("1 ∆°C/km", new TemperatureGradient(1, TemperatureGradientUnit.DegreeCelsiusPerKilometer).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°C/m", new TemperatureGradient(1, TemperatureGradientUnit.DegreeCelsiusPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°F/ft", new TemperatureGradient(1, TemperatureGradientUnit.DegreeFahrenheitPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 ∆°K/m", new TemperatureGradient(1, TemperatureGradientUnit.KelvinPerMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs index e2c26233df..eaa1a1446f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TemperatureTestsBase.g.cs @@ -871,16 +871,16 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 °C", new Temperature(1, TemperatureUnit.DegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 °De", new Temperature(1, TemperatureUnit.DegreeDelisle).ToString(swedishCulture)); - Assert.Equal("1 °F", new Temperature(1, TemperatureUnit.DegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 °N", new Temperature(1, TemperatureUnit.DegreeNewton).ToString(swedishCulture)); - Assert.Equal("1 °R", new Temperature(1, TemperatureUnit.DegreeRankine).ToString(swedishCulture)); - Assert.Equal("1 °Ré", new Temperature(1, TemperatureUnit.DegreeReaumur).ToString(swedishCulture)); - Assert.Equal("1 °Rø", new Temperature(1, TemperatureUnit.DegreeRoemer).ToString(swedishCulture)); - Assert.Equal("1 K", new Temperature(1, TemperatureUnit.Kelvin).ToString(swedishCulture)); - Assert.Equal("1 m°C", new Temperature(1, TemperatureUnit.MillidegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 T⊙", new Temperature(1, TemperatureUnit.SolarTemperature).ToString(swedishCulture)); + Assert.Equal("1 °C", new Temperature(1, TemperatureUnit.DegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 °De", new Temperature(1, TemperatureUnit.DegreeDelisle).ToString(null, swedishCulture)); + Assert.Equal("1 °F", new Temperature(1, TemperatureUnit.DegreeFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 °N", new Temperature(1, TemperatureUnit.DegreeNewton).ToString(null, swedishCulture)); + Assert.Equal("1 °R", new Temperature(1, TemperatureUnit.DegreeRankine).ToString(null, swedishCulture)); + Assert.Equal("1 °Ré", new Temperature(1, TemperatureUnit.DegreeReaumur).ToString(null, swedishCulture)); + Assert.Equal("1 °Rø", new Temperature(1, TemperatureUnit.DegreeRoemer).ToString(null, swedishCulture)); + Assert.Equal("1 K", new Temperature(1, TemperatureUnit.Kelvin).ToString(null, swedishCulture)); + Assert.Equal("1 m°C", new Temperature(1, TemperatureUnit.MillidegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 T⊙", new Temperature(1, TemperatureUnit.SolarTemperature).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs index 80d71e8442..3d412c4b2c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalConductivityTestsBase.g.cs @@ -619,8 +619,8 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 BTU/(h·ft·°F)", new ThermalConductivity(1, ThermalConductivityUnit.BtuPerHourFootFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 W/(m·K)", new ThermalConductivity(1, ThermalConductivityUnit.WattPerMeterKelvin).ToString(swedishCulture)); + Assert.Equal("1 BTU/(h·ft·°F)", new ThermalConductivity(1, ThermalConductivityUnit.BtuPerHourFootFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 W/(m·K)", new ThermalConductivity(1, ThermalConductivityUnit.WattPerMeterKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs index eeb2d5e55f..b52fa5cb30 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/ThermalInsulanceTestsBase.g.cs @@ -751,12 +751,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 Hrft²°F/Btu", new ThermalInsulance(1, ThermalInsulanceUnit.HourSquareFeetDegreeFahrenheitPerBtu).ToString(swedishCulture)); - Assert.Equal("1 cm²Hr°C/kcal", new ThermalInsulance(1, ThermalInsulanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie).ToString(swedishCulture)); - Assert.Equal("1 cm²K/W", new ThermalInsulance(1, ThermalInsulanceUnit.SquareCentimeterKelvinPerWatt).ToString(swedishCulture)); - Assert.Equal("1 m²°C/W", new ThermalInsulance(1, ThermalInsulanceUnit.SquareMeterDegreeCelsiusPerWatt).ToString(swedishCulture)); - Assert.Equal("1 m²K/kW", new ThermalInsulance(1, ThermalInsulanceUnit.SquareMeterKelvinPerKilowatt).ToString(swedishCulture)); - Assert.Equal("1 m²K/W", new ThermalInsulance(1, ThermalInsulanceUnit.SquareMeterKelvinPerWatt).ToString(swedishCulture)); + Assert.Equal("1 Hrft²°F/Btu", new ThermalInsulance(1, ThermalInsulanceUnit.HourSquareFeetDegreeFahrenheitPerBtu).ToString(null, swedishCulture)); + Assert.Equal("1 cm²Hr°C/kcal", new ThermalInsulance(1, ThermalInsulanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie).ToString(null, swedishCulture)); + Assert.Equal("1 cm²K/W", new ThermalInsulance(1, ThermalInsulanceUnit.SquareCentimeterKelvinPerWatt).ToString(null, swedishCulture)); + Assert.Equal("1 m²°C/W", new ThermalInsulance(1, ThermalInsulanceUnit.SquareMeterDegreeCelsiusPerWatt).ToString(null, swedishCulture)); + Assert.Equal("1 m²K/kW", new ThermalInsulance(1, ThermalInsulanceUnit.SquareMeterKelvinPerKilowatt).ToString(null, swedishCulture)); + Assert.Equal("1 m²K/W", new ThermalInsulance(1, ThermalInsulanceUnit.SquareMeterKelvinPerWatt).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs index 32ec732239..68e64ecbb0 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TorqueTestsBase.g.cs @@ -1429,31 +1429,31 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 gf·cm", new Torque(1, TorqueUnit.GramForceCentimeter).ToString(swedishCulture)); - Assert.Equal("1 gf·m", new Torque(1, TorqueUnit.GramForceMeter).ToString(swedishCulture)); - Assert.Equal("1 gf·mm", new Torque(1, TorqueUnit.GramForceMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kgf·cm", new Torque(1, TorqueUnit.KilogramForceCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kgf·m", new Torque(1, TorqueUnit.KilogramForceMeter).ToString(swedishCulture)); - Assert.Equal("1 kgf·mm", new Torque(1, TorqueUnit.KilogramForceMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kN·cm", new Torque(1, TorqueUnit.KilonewtonCentimeter).ToString(swedishCulture)); - Assert.Equal("1 kN·m", new Torque(1, TorqueUnit.KilonewtonMeter).ToString(swedishCulture)); - Assert.Equal("1 kN·mm", new Torque(1, TorqueUnit.KilonewtonMillimeter).ToString(swedishCulture)); - Assert.Equal("1 kipf·ft", new Torque(1, TorqueUnit.KilopoundForceFoot).ToString(swedishCulture)); - Assert.Equal("1 kipf·in", new Torque(1, TorqueUnit.KilopoundForceInch).ToString(swedishCulture)); - Assert.Equal("1 MN·cm", new Torque(1, TorqueUnit.MeganewtonCentimeter).ToString(swedishCulture)); - Assert.Equal("1 MN·m", new Torque(1, TorqueUnit.MeganewtonMeter).ToString(swedishCulture)); - Assert.Equal("1 MN·mm", new Torque(1, TorqueUnit.MeganewtonMillimeter).ToString(swedishCulture)); - Assert.Equal("1 Mlbf·ft", new Torque(1, TorqueUnit.MegapoundForceFoot).ToString(swedishCulture)); - Assert.Equal("1 Mlbf·in", new Torque(1, TorqueUnit.MegapoundForceInch).ToString(swedishCulture)); - Assert.Equal("1 N·cm", new Torque(1, TorqueUnit.NewtonCentimeter).ToString(swedishCulture)); - Assert.Equal("1 N·m", new Torque(1, TorqueUnit.NewtonMeter).ToString(swedishCulture)); - Assert.Equal("1 N·mm", new Torque(1, TorqueUnit.NewtonMillimeter).ToString(swedishCulture)); - Assert.Equal("1 pdl·ft", new Torque(1, TorqueUnit.PoundalFoot).ToString(swedishCulture)); - Assert.Equal("1 lbf·ft", new Torque(1, TorqueUnit.PoundForceFoot).ToString(swedishCulture)); - Assert.Equal("1 lbf·in", new Torque(1, TorqueUnit.PoundForceInch).ToString(swedishCulture)); - Assert.Equal("1 tf·cm", new Torque(1, TorqueUnit.TonneForceCentimeter).ToString(swedishCulture)); - Assert.Equal("1 tf·m", new Torque(1, TorqueUnit.TonneForceMeter).ToString(swedishCulture)); - Assert.Equal("1 tf·mm", new Torque(1, TorqueUnit.TonneForceMillimeter).ToString(swedishCulture)); + Assert.Equal("1 gf·cm", new Torque(1, TorqueUnit.GramForceCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 gf·m", new Torque(1, TorqueUnit.GramForceMeter).ToString(null, swedishCulture)); + Assert.Equal("1 gf·mm", new Torque(1, TorqueUnit.GramForceMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf·cm", new Torque(1, TorqueUnit.KilogramForceCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf·m", new Torque(1, TorqueUnit.KilogramForceMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgf·mm", new Torque(1, TorqueUnit.KilogramForceMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN·cm", new Torque(1, TorqueUnit.KilonewtonCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN·m", new Torque(1, TorqueUnit.KilonewtonMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kN·mm", new Torque(1, TorqueUnit.KilonewtonMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 kipf·ft", new Torque(1, TorqueUnit.KilopoundForceFoot).ToString(null, swedishCulture)); + Assert.Equal("1 kipf·in", new Torque(1, TorqueUnit.KilopoundForceInch).ToString(null, swedishCulture)); + Assert.Equal("1 MN·cm", new Torque(1, TorqueUnit.MeganewtonCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 MN·m", new Torque(1, TorqueUnit.MeganewtonMeter).ToString(null, swedishCulture)); + Assert.Equal("1 MN·mm", new Torque(1, TorqueUnit.MeganewtonMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 Mlbf·ft", new Torque(1, TorqueUnit.MegapoundForceFoot).ToString(null, swedishCulture)); + Assert.Equal("1 Mlbf·in", new Torque(1, TorqueUnit.MegapoundForceInch).ToString(null, swedishCulture)); + Assert.Equal("1 N·cm", new Torque(1, TorqueUnit.NewtonCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 N·m", new Torque(1, TorqueUnit.NewtonMeter).ToString(null, swedishCulture)); + Assert.Equal("1 N·mm", new Torque(1, TorqueUnit.NewtonMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 pdl·ft", new Torque(1, TorqueUnit.PoundalFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·ft", new Torque(1, TorqueUnit.PoundForceFoot).ToString(null, swedishCulture)); + Assert.Equal("1 lbf·in", new Torque(1, TorqueUnit.PoundForceInch).ToString(null, swedishCulture)); + Assert.Equal("1 tf·cm", new Torque(1, TorqueUnit.TonneForceCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf·m", new Torque(1, TorqueUnit.TonneForceMeter).ToString(null, swedishCulture)); + Assert.Equal("1 tf·mm", new Torque(1, TorqueUnit.TonneForceMillimeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs index 79652c0c80..0cba17c235 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/TurbidityTestsBase.g.cs @@ -525,7 +525,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 NTU", new Turbidity(1, TurbidityUnit.NTU).ToString(swedishCulture)); + Assert.Equal("1 NTU", new Turbidity(1, TurbidityUnit.NTU).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs index 7762a71ed3..e87ed9ef36 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VitaminATestsBase.g.cs @@ -525,7 +525,7 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 IU", new VitaminA(1, VitaminAUnit.InternationalUnit).ToString(swedishCulture)); + Assert.Equal("1 IU", new VitaminA(1, VitaminAUnit.InternationalUnit).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs index 90ea98854b..b157ed6a8f 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeConcentrationTestsBase.g.cs @@ -1174,26 +1174,26 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cl/l", new VolumeConcentration(1, VolumeConcentrationUnit.CentiliterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 cl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.CentiliterPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 dl/l", new VolumeConcentration(1, VolumeConcentrationUnit.DeciliterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 dl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.DeciliterPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1", new VolumeConcentration(1, VolumeConcentrationUnit.DecimalFraction).ToString(swedishCulture)); - Assert.Equal("1 l/l", new VolumeConcentration(1, VolumeConcentrationUnit.LiterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 l/ml", new VolumeConcentration(1, VolumeConcentrationUnit.LiterPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 µl/l", new VolumeConcentration(1, VolumeConcentrationUnit.MicroliterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 µl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.MicroliterPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 ml/l", new VolumeConcentration(1, VolumeConcentrationUnit.MilliliterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 ml/ml", new VolumeConcentration(1, VolumeConcentrationUnit.MilliliterPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 nl/l", new VolumeConcentration(1, VolumeConcentrationUnit.NanoliterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 nl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.NanoliterPerMilliliter).ToString(swedishCulture)); - Assert.Equal("1 ppb", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerBillion).ToString(swedishCulture)); - Assert.Equal("1 ppm", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerMillion).ToString(swedishCulture)); - Assert.Equal("1 ‰", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerThousand).ToString(swedishCulture)); - Assert.Equal("1 ppt", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerTrillion).ToString(swedishCulture)); - Assert.Equal("1 %", new VolumeConcentration(1, VolumeConcentrationUnit.Percent).ToString(swedishCulture)); - Assert.Equal("1 pl/l", new VolumeConcentration(1, VolumeConcentrationUnit.PicoliterPerLiter).ToString(swedishCulture)); - Assert.Equal("1 pl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.PicoliterPerMilliliter).ToString(swedishCulture)); + Assert.Equal("1 cl/l", new VolumeConcentration(1, VolumeConcentrationUnit.CentiliterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 cl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.CentiliterPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 dl/l", new VolumeConcentration(1, VolumeConcentrationUnit.DeciliterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 dl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.DeciliterPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1", new VolumeConcentration(1, VolumeConcentrationUnit.DecimalFraction).ToString(null, swedishCulture)); + Assert.Equal("1 l/l", new VolumeConcentration(1, VolumeConcentrationUnit.LiterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 l/ml", new VolumeConcentration(1, VolumeConcentrationUnit.LiterPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 µl/l", new VolumeConcentration(1, VolumeConcentrationUnit.MicroliterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 µl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.MicroliterPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 ml/l", new VolumeConcentration(1, VolumeConcentrationUnit.MilliliterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 ml/ml", new VolumeConcentration(1, VolumeConcentrationUnit.MilliliterPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 nl/l", new VolumeConcentration(1, VolumeConcentrationUnit.NanoliterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 nl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.NanoliterPerMilliliter).ToString(null, swedishCulture)); + Assert.Equal("1 ppb", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerBillion).ToString(null, swedishCulture)); + Assert.Equal("1 ppm", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerMillion).ToString(null, swedishCulture)); + Assert.Equal("1 ‰", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerThousand).ToString(null, swedishCulture)); + Assert.Equal("1 ppt", new VolumeConcentration(1, VolumeConcentrationUnit.PartPerTrillion).ToString(null, swedishCulture)); + Assert.Equal("1 %", new VolumeConcentration(1, VolumeConcentrationUnit.Percent).ToString(null, swedishCulture)); + Assert.Equal("1 pl/l", new VolumeConcentration(1, VolumeConcentrationUnit.PicoliterPerLiter).ToString(null, swedishCulture)); + Assert.Equal("1 pl/ml", new VolumeConcentration(1, VolumeConcentrationUnit.PicoliterPerMilliliter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs index 64b5265cb9..08eb247e8c 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowPerAreaTestsBase.g.cs @@ -619,8 +619,8 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 CFM/ft²", new VolumeFlowPerArea(1, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot).ToString(swedishCulture)); - Assert.Equal("1 m³/(s·m²)", new VolumeFlowPerArea(1, VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter).ToString(swedishCulture)); + Assert.Equal("1 CFM/ft²", new VolumeFlowPerArea(1, VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot).ToString(null, swedishCulture)); + Assert.Equal("1 m³/(s·m²)", new VolumeFlowPerArea(1, VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs index 3c4143cfd6..9c920a58d8 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeFlowTestsBase.g.cs @@ -4735,81 +4735,81 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 af/d", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerDay).ToString(swedishCulture)); - Assert.Equal("1 af/h", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerHour).ToString(swedishCulture)); - Assert.Equal("1 af/m", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerMinute).ToString(swedishCulture)); - Assert.Equal("1 af/s", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 cl/day", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 cl/h", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 cl/min", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 cl/s", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 cm³/min", new VolumeFlow(1, VolumeFlowUnit.CubicCentimeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 dm³/min", new VolumeFlow(1, VolumeFlowUnit.CubicDecimeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 ft³/h", new VolumeFlow(1, VolumeFlowUnit.CubicFootPerHour).ToString(swedishCulture)); - Assert.Equal("1 ft³/min", new VolumeFlow(1, VolumeFlowUnit.CubicFootPerMinute).ToString(swedishCulture)); - Assert.Equal("1 ft³/s", new VolumeFlow(1, VolumeFlowUnit.CubicFootPerSecond).ToString(swedishCulture)); - Assert.Equal("1 m³/d", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerDay).ToString(swedishCulture)); - Assert.Equal("1 m³/h", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerHour).ToString(swedishCulture)); - Assert.Equal("1 m³/min", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 m³/s", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 mm³/s", new VolumeFlow(1, VolumeFlowUnit.CubicMillimeterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 cy/day", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerDay).ToString(swedishCulture)); - Assert.Equal("1 yd³/h", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerHour).ToString(swedishCulture)); - Assert.Equal("1 yd³/min", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerMinute).ToString(swedishCulture)); - Assert.Equal("1 yd³/s", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerSecond).ToString(swedishCulture)); - Assert.Equal("1 dal/day", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 dal/h", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 dal/min", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 dal/s", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 dl/day", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 dl/h", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 dl/min", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 dl/s", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 hl/day", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 hl/h", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 hl/min", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 hl/s", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kl/day", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 kl/h", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 kl/min", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 kl/s", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 kgal (U.S.)/min", new VolumeFlow(1, VolumeFlowUnit.KilousGallonPerMinute).ToString(swedishCulture)); - Assert.Equal("1 l/day", new VolumeFlow(1, VolumeFlowUnit.LiterPerDay).ToString(swedishCulture)); - Assert.Equal("1 l/h", new VolumeFlow(1, VolumeFlowUnit.LiterPerHour).ToString(swedishCulture)); - Assert.Equal("1 l/min", new VolumeFlow(1, VolumeFlowUnit.LiterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 l/s", new VolumeFlow(1, VolumeFlowUnit.LiterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Ml/day", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 Ml/h", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 Ml/min", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 Ml/s", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mgal (U. K.)/d", new VolumeFlow(1, VolumeFlowUnit.MegaukGallonPerDay).ToString(swedishCulture)); - Assert.Equal("1 Mgal (imp.)/s", new VolumeFlow(1, VolumeFlowUnit.MegaukGallonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 Mgpd", new VolumeFlow(1, VolumeFlowUnit.MegausGallonPerDay).ToString(swedishCulture)); - Assert.Equal("1 µl/day", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 µl/h", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 µl/min", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 µl/s", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 ml/day", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 ml/h", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 ml/min", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 ml/s", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 MGD", new VolumeFlow(1, VolumeFlowUnit.MillionUsGallonPerDay).ToString(swedishCulture)); - Assert.Equal("1 nl/day", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerDay).ToString(swedishCulture)); - Assert.Equal("1 nl/h", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerHour).ToString(swedishCulture)); - Assert.Equal("1 nl/min", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerMinute).ToString(swedishCulture)); - Assert.Equal("1 nl/s", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerSecond).ToString(swedishCulture)); - Assert.Equal("1 bbl/d", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerDay).ToString(swedishCulture)); - Assert.Equal("1 bbl/hr", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerHour).ToString(swedishCulture)); - Assert.Equal("1 bbl/min", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerMinute).ToString(swedishCulture)); - Assert.Equal("1 bbl/s", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerSecond).ToString(swedishCulture)); - Assert.Equal("1 gal (U. K.)/d", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerDay).ToString(swedishCulture)); - Assert.Equal("1 gal (imp.)/h", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerHour).ToString(swedishCulture)); - Assert.Equal("1 gal (imp.)/min", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerMinute).ToString(swedishCulture)); - Assert.Equal("1 gal (imp.)/s", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerSecond).ToString(swedishCulture)); - Assert.Equal("1 gpd", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerDay).ToString(swedishCulture)); - Assert.Equal("1 gal (U.S.)/h", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerHour).ToString(swedishCulture)); - Assert.Equal("1 gal (U.S.)/min", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerMinute).ToString(swedishCulture)); - Assert.Equal("1 gal (U.S.)/s", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerSecond).ToString(swedishCulture)); + Assert.Equal("1 af/d", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 af/h", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 af/m", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 af/s", new VolumeFlow(1, VolumeFlowUnit.AcreFootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 cl/day", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 cl/h", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 cl/min", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 cl/s", new VolumeFlow(1, VolumeFlowUnit.CentiliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 cm³/min", new VolumeFlow(1, VolumeFlowUnit.CubicCentimeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 dm³/min", new VolumeFlow(1, VolumeFlowUnit.CubicDecimeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 ft³/h", new VolumeFlow(1, VolumeFlowUnit.CubicFootPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 ft³/min", new VolumeFlow(1, VolumeFlowUnit.CubicFootPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 ft³/s", new VolumeFlow(1, VolumeFlowUnit.CubicFootPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 m³/d", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 m³/h", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 m³/min", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 m³/s", new VolumeFlow(1, VolumeFlowUnit.CubicMeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 mm³/s", new VolumeFlow(1, VolumeFlowUnit.CubicMillimeterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 cy/day", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 yd³/h", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 yd³/min", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 yd³/s", new VolumeFlow(1, VolumeFlowUnit.CubicYardPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dal/day", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 dal/h", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 dal/min", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 dal/s", new VolumeFlow(1, VolumeFlowUnit.DecaliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 dl/day", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 dl/h", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 dl/min", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 dl/s", new VolumeFlow(1, VolumeFlowUnit.DeciliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 hl/day", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 hl/h", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 hl/min", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 hl/s", new VolumeFlow(1, VolumeFlowUnit.HectoliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kl/day", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 kl/h", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 kl/min", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 kl/s", new VolumeFlow(1, VolumeFlowUnit.KiloliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 kgal (U.S.)/min", new VolumeFlow(1, VolumeFlowUnit.KilousGallonPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 l/day", new VolumeFlow(1, VolumeFlowUnit.LiterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 l/h", new VolumeFlow(1, VolumeFlowUnit.LiterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 l/min", new VolumeFlow(1, VolumeFlowUnit.LiterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 l/s", new VolumeFlow(1, VolumeFlowUnit.LiterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Ml/day", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 Ml/h", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 Ml/min", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 Ml/s", new VolumeFlow(1, VolumeFlowUnit.MegaliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mgal (U. K.)/d", new VolumeFlow(1, VolumeFlowUnit.MegaukGallonPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 Mgal (imp.)/s", new VolumeFlow(1, VolumeFlowUnit.MegaukGallonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 Mgpd", new VolumeFlow(1, VolumeFlowUnit.MegausGallonPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 µl/day", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 µl/h", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 µl/min", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 µl/s", new VolumeFlow(1, VolumeFlowUnit.MicroliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 ml/day", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 ml/h", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 ml/min", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 ml/s", new VolumeFlow(1, VolumeFlowUnit.MilliliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 MGD", new VolumeFlow(1, VolumeFlowUnit.MillionUsGallonPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 nl/day", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 nl/h", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 nl/min", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 nl/s", new VolumeFlow(1, VolumeFlowUnit.NanoliterPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 bbl/d", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 bbl/hr", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 bbl/min", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 bbl/s", new VolumeFlow(1, VolumeFlowUnit.OilBarrelPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 gal (U. K.)/d", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 gal (imp.)/h", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 gal (imp.)/min", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 gal (imp.)/s", new VolumeFlow(1, VolumeFlowUnit.UkGallonPerSecond).ToString(null, swedishCulture)); + Assert.Equal("1 gpd", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerDay).ToString(null, swedishCulture)); + Assert.Equal("1 gal (U.S.)/h", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerHour).ToString(null, swedishCulture)); + Assert.Equal("1 gal (U.S.)/min", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerMinute).ToString(null, swedishCulture)); + Assert.Equal("1 gal (U.S.)/s", new VolumeFlow(1, VolumeFlowUnit.UsGallonPerSecond).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs index 98a966b218..aaddabe7da 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumePerLengthTestsBase.g.cs @@ -850,15 +850,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 m³/m", new VolumePerLength(1, VolumePerLengthUnit.CubicMeterPerMeter).ToString(swedishCulture)); - Assert.Equal("1 yd³/ft", new VolumePerLength(1, VolumePerLengthUnit.CubicYardPerFoot).ToString(swedishCulture)); - Assert.Equal("1 yd³/ftUS", new VolumePerLength(1, VolumePerLengthUnit.CubicYardPerUsSurveyFoot).ToString(swedishCulture)); - Assert.Equal("1 gal (imp.)/mi", new VolumePerLength(1, VolumePerLengthUnit.ImperialGallonPerMile).ToString(swedishCulture)); - Assert.Equal("1 l/km", new VolumePerLength(1, VolumePerLengthUnit.LiterPerKilometer).ToString(swedishCulture)); - Assert.Equal("1 l/m", new VolumePerLength(1, VolumePerLengthUnit.LiterPerMeter).ToString(swedishCulture)); - Assert.Equal("1 l/mm", new VolumePerLength(1, VolumePerLengthUnit.LiterPerMillimeter).ToString(swedishCulture)); - Assert.Equal("1 bbl/ft", new VolumePerLength(1, VolumePerLengthUnit.OilBarrelPerFoot).ToString(swedishCulture)); - Assert.Equal("1 gal (U.S.)/mi", new VolumePerLength(1, VolumePerLengthUnit.UsGallonPerMile).ToString(swedishCulture)); + Assert.Equal("1 m³/m", new VolumePerLength(1, VolumePerLengthUnit.CubicMeterPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 yd³/ft", new VolumePerLength(1, VolumePerLengthUnit.CubicYardPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 yd³/ftUS", new VolumePerLength(1, VolumePerLengthUnit.CubicYardPerUsSurveyFoot).ToString(null, swedishCulture)); + Assert.Equal("1 gal (imp.)/mi", new VolumePerLength(1, VolumePerLengthUnit.ImperialGallonPerMile).ToString(null, swedishCulture)); + Assert.Equal("1 l/km", new VolumePerLength(1, VolumePerLengthUnit.LiterPerKilometer).ToString(null, swedishCulture)); + Assert.Equal("1 l/m", new VolumePerLength(1, VolumePerLengthUnit.LiterPerMeter).ToString(null, swedishCulture)); + Assert.Equal("1 l/mm", new VolumePerLength(1, VolumePerLengthUnit.LiterPerMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 bbl/ft", new VolumePerLength(1, VolumePerLengthUnit.OilBarrelPerFoot).ToString(null, swedishCulture)); + Assert.Equal("1 gal (U.S.)/mi", new VolumePerLength(1, VolumePerLengthUnit.UsGallonPerMile).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs index 77adc8d55f..e53199244b 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumeTestsBase.g.cs @@ -3230,60 +3230,60 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 ac-ft", new Volume(1, VolumeUnit.AcreFoot).ToString(swedishCulture)); - Assert.Equal("1 tablespoon (A.U.)", new Volume(1, VolumeUnit.AuTablespoon).ToString(swedishCulture)); - Assert.Equal("1 bf", new Volume(1, VolumeUnit.BoardFoot).ToString(swedishCulture)); - Assert.Equal("1 cl", new Volume(1, VolumeUnit.Centiliter).ToString(swedishCulture)); - Assert.Equal("1 cm³", new Volume(1, VolumeUnit.CubicCentimeter).ToString(swedishCulture)); - Assert.Equal("1 dm³", new Volume(1, VolumeUnit.CubicDecimeter).ToString(swedishCulture)); - Assert.Equal("1 ft³", new Volume(1, VolumeUnit.CubicFoot).ToString(swedishCulture)); - Assert.Equal("1 hm³", new Volume(1, VolumeUnit.CubicHectometer).ToString(swedishCulture)); - Assert.Equal("1 in³", new Volume(1, VolumeUnit.CubicInch).ToString(swedishCulture)); - Assert.Equal("1 km³", new Volume(1, VolumeUnit.CubicKilometer).ToString(swedishCulture)); - Assert.Equal("1 m³", new Volume(1, VolumeUnit.CubicMeter).ToString(swedishCulture)); - Assert.Equal("1 µm³", new Volume(1, VolumeUnit.CubicMicrometer).ToString(swedishCulture)); - Assert.Equal("1 mi³", new Volume(1, VolumeUnit.CubicMile).ToString(swedishCulture)); - Assert.Equal("1 mm³", new Volume(1, VolumeUnit.CubicMillimeter).ToString(swedishCulture)); - Assert.Equal("1 yd³", new Volume(1, VolumeUnit.CubicYard).ToString(swedishCulture)); - Assert.Equal("1 dal", new Volume(1, VolumeUnit.Decaliter).ToString(swedishCulture)); - Assert.Equal("1 dagal (U.S.)", new Volume(1, VolumeUnit.DecausGallon).ToString(swedishCulture)); - Assert.Equal("1 dl", new Volume(1, VolumeUnit.Deciliter).ToString(swedishCulture)); - Assert.Equal("1 dgal (U.S.)", new Volume(1, VolumeUnit.DeciusGallon).ToString(swedishCulture)); - Assert.Equal("1 hft³", new Volume(1, VolumeUnit.HectocubicFoot).ToString(swedishCulture)); - Assert.Equal("1 hm³", new Volume(1, VolumeUnit.HectocubicMeter).ToString(swedishCulture)); - Assert.Equal("1 hl", new Volume(1, VolumeUnit.Hectoliter).ToString(swedishCulture)); - Assert.Equal("1 hgal (U.S.)", new Volume(1, VolumeUnit.HectousGallon).ToString(swedishCulture)); - Assert.Equal("1 bl (imp.)", new Volume(1, VolumeUnit.ImperialBeerBarrel).ToString(swedishCulture)); - Assert.Equal("1 gal (imp.)", new Volume(1, VolumeUnit.ImperialGallon).ToString(swedishCulture)); - Assert.Equal("1 oz (imp.)", new Volume(1, VolumeUnit.ImperialOunce).ToString(swedishCulture)); - Assert.Equal("1 pt (imp.)", new Volume(1, VolumeUnit.ImperialPint).ToString(swedishCulture)); - Assert.Equal("1 qt (imp.)", new Volume(1, VolumeUnit.ImperialQuart).ToString(swedishCulture)); - Assert.Equal("1 kft³", new Volume(1, VolumeUnit.KilocubicFoot).ToString(swedishCulture)); - Assert.Equal("1 km³", new Volume(1, VolumeUnit.KilocubicMeter).ToString(swedishCulture)); - Assert.Equal("1 kgal (imp.)", new Volume(1, VolumeUnit.KiloimperialGallon).ToString(swedishCulture)); - Assert.Equal("1 kl", new Volume(1, VolumeUnit.Kiloliter).ToString(swedishCulture)); - Assert.Equal("1 kgal (U.S.)", new Volume(1, VolumeUnit.KilousGallon).ToString(swedishCulture)); - Assert.Equal("1 l", new Volume(1, VolumeUnit.Liter).ToString(swedishCulture)); - Assert.Equal("1 Mft³", new Volume(1, VolumeUnit.MegacubicFoot).ToString(swedishCulture)); - Assert.Equal("1 Mgal (imp.)", new Volume(1, VolumeUnit.MegaimperialGallon).ToString(swedishCulture)); - Assert.Equal("1 Ml", new Volume(1, VolumeUnit.Megaliter).ToString(swedishCulture)); - Assert.Equal("1 Mgal (U.S.)", new Volume(1, VolumeUnit.MegausGallon).ToString(swedishCulture)); - Assert.Equal("1 metric cup", new Volume(1, VolumeUnit.MetricCup).ToString(swedishCulture)); - Assert.Equal("1 tsp", new Volume(1, VolumeUnit.MetricTeaspoon).ToString(swedishCulture)); - Assert.Equal("1 µl", new Volume(1, VolumeUnit.Microliter).ToString(swedishCulture)); - Assert.Equal("1 ml", new Volume(1, VolumeUnit.Milliliter).ToString(swedishCulture)); - Assert.Equal("1 nl", new Volume(1, VolumeUnit.Nanoliter).ToString(swedishCulture)); - Assert.Equal("1 bbl", new Volume(1, VolumeUnit.OilBarrel).ToString(swedishCulture)); - Assert.Equal("1 tablespoon (U.K.)", new Volume(1, VolumeUnit.UkTablespoon).ToString(swedishCulture)); - Assert.Equal("1 bl (U.S.)", new Volume(1, VolumeUnit.UsBeerBarrel).ToString(swedishCulture)); - Assert.Equal("1 cup (U.S. customary)", new Volume(1, VolumeUnit.UsCustomaryCup).ToString(swedishCulture)); - Assert.Equal("1 gal (U.S.)", new Volume(1, VolumeUnit.UsGallon).ToString(swedishCulture)); - Assert.Equal("1 cup (U.S.)", new Volume(1, VolumeUnit.UsLegalCup).ToString(swedishCulture)); - Assert.Equal("1 oz (U.S.)", new Volume(1, VolumeUnit.UsOunce).ToString(swedishCulture)); - Assert.Equal("1 pt (U.S.)", new Volume(1, VolumeUnit.UsPint).ToString(swedishCulture)); - Assert.Equal("1 qt (U.S.)", new Volume(1, VolumeUnit.UsQuart).ToString(swedishCulture)); - Assert.Equal("1 tablespoon (U.S.)", new Volume(1, VolumeUnit.UsTablespoon).ToString(swedishCulture)); - Assert.Equal("1 teaspoon (U.S.)", new Volume(1, VolumeUnit.UsTeaspoon).ToString(swedishCulture)); + Assert.Equal("1 ac-ft", new Volume(1, VolumeUnit.AcreFoot).ToString(null, swedishCulture)); + Assert.Equal("1 tablespoon (A.U.)", new Volume(1, VolumeUnit.AuTablespoon).ToString(null, swedishCulture)); + Assert.Equal("1 bf", new Volume(1, VolumeUnit.BoardFoot).ToString(null, swedishCulture)); + Assert.Equal("1 cl", new Volume(1, VolumeUnit.Centiliter).ToString(null, swedishCulture)); + Assert.Equal("1 cm³", new Volume(1, VolumeUnit.CubicCentimeter).ToString(null, swedishCulture)); + Assert.Equal("1 dm³", new Volume(1, VolumeUnit.CubicDecimeter).ToString(null, swedishCulture)); + Assert.Equal("1 ft³", new Volume(1, VolumeUnit.CubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 hm³", new Volume(1, VolumeUnit.CubicHectometer).ToString(null, swedishCulture)); + Assert.Equal("1 in³", new Volume(1, VolumeUnit.CubicInch).ToString(null, swedishCulture)); + Assert.Equal("1 km³", new Volume(1, VolumeUnit.CubicKilometer).ToString(null, swedishCulture)); + Assert.Equal("1 m³", new Volume(1, VolumeUnit.CubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 µm³", new Volume(1, VolumeUnit.CubicMicrometer).ToString(null, swedishCulture)); + Assert.Equal("1 mi³", new Volume(1, VolumeUnit.CubicMile).ToString(null, swedishCulture)); + Assert.Equal("1 mm³", new Volume(1, VolumeUnit.CubicMillimeter).ToString(null, swedishCulture)); + Assert.Equal("1 yd³", new Volume(1, VolumeUnit.CubicYard).ToString(null, swedishCulture)); + Assert.Equal("1 dal", new Volume(1, VolumeUnit.Decaliter).ToString(null, swedishCulture)); + Assert.Equal("1 dagal (U.S.)", new Volume(1, VolumeUnit.DecausGallon).ToString(null, swedishCulture)); + Assert.Equal("1 dl", new Volume(1, VolumeUnit.Deciliter).ToString(null, swedishCulture)); + Assert.Equal("1 dgal (U.S.)", new Volume(1, VolumeUnit.DeciusGallon).ToString(null, swedishCulture)); + Assert.Equal("1 hft³", new Volume(1, VolumeUnit.HectocubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 hm³", new Volume(1, VolumeUnit.HectocubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 hl", new Volume(1, VolumeUnit.Hectoliter).ToString(null, swedishCulture)); + Assert.Equal("1 hgal (U.S.)", new Volume(1, VolumeUnit.HectousGallon).ToString(null, swedishCulture)); + Assert.Equal("1 bl (imp.)", new Volume(1, VolumeUnit.ImperialBeerBarrel).ToString(null, swedishCulture)); + Assert.Equal("1 gal (imp.)", new Volume(1, VolumeUnit.ImperialGallon).ToString(null, swedishCulture)); + Assert.Equal("1 oz (imp.)", new Volume(1, VolumeUnit.ImperialOunce).ToString(null, swedishCulture)); + Assert.Equal("1 pt (imp.)", new Volume(1, VolumeUnit.ImperialPint).ToString(null, swedishCulture)); + Assert.Equal("1 qt (imp.)", new Volume(1, VolumeUnit.ImperialQuart).ToString(null, swedishCulture)); + Assert.Equal("1 kft³", new Volume(1, VolumeUnit.KilocubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 km³", new Volume(1, VolumeUnit.KilocubicMeter).ToString(null, swedishCulture)); + Assert.Equal("1 kgal (imp.)", new Volume(1, VolumeUnit.KiloimperialGallon).ToString(null, swedishCulture)); + Assert.Equal("1 kl", new Volume(1, VolumeUnit.Kiloliter).ToString(null, swedishCulture)); + Assert.Equal("1 kgal (U.S.)", new Volume(1, VolumeUnit.KilousGallon).ToString(null, swedishCulture)); + Assert.Equal("1 l", new Volume(1, VolumeUnit.Liter).ToString(null, swedishCulture)); + Assert.Equal("1 Mft³", new Volume(1, VolumeUnit.MegacubicFoot).ToString(null, swedishCulture)); + Assert.Equal("1 Mgal (imp.)", new Volume(1, VolumeUnit.MegaimperialGallon).ToString(null, swedishCulture)); + Assert.Equal("1 Ml", new Volume(1, VolumeUnit.Megaliter).ToString(null, swedishCulture)); + Assert.Equal("1 Mgal (U.S.)", new Volume(1, VolumeUnit.MegausGallon).ToString(null, swedishCulture)); + Assert.Equal("1 metric cup", new Volume(1, VolumeUnit.MetricCup).ToString(null, swedishCulture)); + Assert.Equal("1 tsp", new Volume(1, VolumeUnit.MetricTeaspoon).ToString(null, swedishCulture)); + Assert.Equal("1 µl", new Volume(1, VolumeUnit.Microliter).ToString(null, swedishCulture)); + Assert.Equal("1 ml", new Volume(1, VolumeUnit.Milliliter).ToString(null, swedishCulture)); + Assert.Equal("1 nl", new Volume(1, VolumeUnit.Nanoliter).ToString(null, swedishCulture)); + Assert.Equal("1 bbl", new Volume(1, VolumeUnit.OilBarrel).ToString(null, swedishCulture)); + Assert.Equal("1 tablespoon (U.K.)", new Volume(1, VolumeUnit.UkTablespoon).ToString(null, swedishCulture)); + Assert.Equal("1 bl (U.S.)", new Volume(1, VolumeUnit.UsBeerBarrel).ToString(null, swedishCulture)); + Assert.Equal("1 cup (U.S. customary)", new Volume(1, VolumeUnit.UsCustomaryCup).ToString(null, swedishCulture)); + Assert.Equal("1 gal (U.S.)", new Volume(1, VolumeUnit.UsGallon).ToString(null, swedishCulture)); + Assert.Equal("1 cup (U.S.)", new Volume(1, VolumeUnit.UsLegalCup).ToString(null, swedishCulture)); + Assert.Equal("1 oz (U.S.)", new Volume(1, VolumeUnit.UsOunce).ToString(null, swedishCulture)); + Assert.Equal("1 pt (U.S.)", new Volume(1, VolumeUnit.UsPint).ToString(null, swedishCulture)); + Assert.Equal("1 qt (U.S.)", new Volume(1, VolumeUnit.UsQuart).ToString(null, swedishCulture)); + Assert.Equal("1 tablespoon (U.S.)", new Volume(1, VolumeUnit.UsTablespoon).ToString(null, swedishCulture)); + Assert.Equal("1 teaspoon (U.S.)", new Volume(1, VolumeUnit.UsTeaspoon).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs index 585a1bd0a7..740037b534 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/VolumetricHeatCapacityTestsBase.g.cs @@ -850,15 +850,15 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 BTU/(ft³·°F)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit).ToString(swedishCulture)); - Assert.Equal("1 cal/(cm³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 J/(m³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 J/(m³·K)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin).ToString(swedishCulture)); - Assert.Equal("1 kcal/(cm³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 kJ/(m³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 kJ/(m³·K)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin).ToString(swedishCulture)); - Assert.Equal("1 MJ/(m³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius).ToString(swedishCulture)); - Assert.Equal("1 MJ/(m³·K)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin).ToString(swedishCulture)); + Assert.Equal("1 BTU/(ft³·°F)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit).ToString(null, swedishCulture)); + Assert.Equal("1 cal/(cm³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 J/(m³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 J/(m³·K)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 kcal/(cm³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/(m³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 kJ/(m³·K)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/(m³·°C)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius).ToString(null, swedishCulture)); + Assert.Equal("1 MJ/(m³·K)", new VolumetricHeatCapacity(1, VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs index f3675cad26..ebbe1931a1 100644 --- a/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TestsBase/WarpingMomentOfInertiaTestsBase.g.cs @@ -751,12 +751,12 @@ public void ToString_WithSwedishCulture_ReturnsUnitAbbreviationForEnglishCulture // Chose this culture, because we don't currently have any abbreviations mapped for that culture and we expect the en-US to be used as fallback. var swedishCulture = CultureInfo.GetCultureInfo("sv-SE"); - Assert.Equal("1 cm⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.CentimeterToTheSixth).ToString(swedishCulture)); - Assert.Equal("1 dm⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.DecimeterToTheSixth).ToString(swedishCulture)); - Assert.Equal("1 ft⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.FootToTheSixth).ToString(swedishCulture)); - Assert.Equal("1 in⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.InchToTheSixth).ToString(swedishCulture)); - Assert.Equal("1 m⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.MeterToTheSixth).ToString(swedishCulture)); - Assert.Equal("1 mm⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.MillimeterToTheSixth).ToString(swedishCulture)); + Assert.Equal("1 cm⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.CentimeterToTheSixth).ToString(null, swedishCulture)); + Assert.Equal("1 dm⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.DecimeterToTheSixth).ToString(null, swedishCulture)); + Assert.Equal("1 ft⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.FootToTheSixth).ToString(null, swedishCulture)); + Assert.Equal("1 in⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.InchToTheSixth).ToString(null, swedishCulture)); + Assert.Equal("1 m⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.MeterToTheSixth).ToString(null, swedishCulture)); + Assert.Equal("1 mm⁶", new WarpingMomentOfInertia(1, WarpingMomentOfInertiaUnit.MillimeterToTheSixth).ToString(null, swedishCulture)); } [Fact] diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index a214cc6392..5fdb3ec3a4 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -77,7 +77,7 @@ public void UnsupportedFormatStringThrowsException() #endif public void DefaultToStringFormatting(double value, string expected) { - string actual = Length.FromMeters(value).ToString(AmericanCulture); + string actual = Length.FromMeters(value).ToString(null, AmericanCulture); Assert.Equal(expected, actual); } [Theory] @@ -95,7 +95,7 @@ public void RadixPointCultureFormatting(string cultureName) { CultureInfo culture = CultureInfo.GetCultureInfo(cultureName); string ds = culture.NumberFormat.NumberDecimalSeparator; - Assert.Equal($"0{ds}12 m", Length.FromMeters(0.12).ToString(culture)); + Assert.Equal($"0{ds}12 m", Length.FromMeters(0.12).ToString(null, culture)); } [Theory] @@ -132,7 +132,7 @@ public void ToString_SFormat_DecimalSeparator_ForCulture(string cultureName) public void ToString_WithCultureWithoutGroupingSeparator(string cultureName) { CultureInfo culture = CultureInfo.GetCultureInfo(cultureName); - Assert.Equal("1111 m", Length.FromMeters(1111).ToString(culture)); + Assert.Equal("1111 m", Length.FromMeters(1111).ToString(null, culture)); } [Theory] @@ -273,18 +273,18 @@ public void ToString_SFormat_Above1e6_UsesScientificNotation(double value, strin [Fact] public void AllUnitsImplementToStringForInvariantCulture() { - Assert.Equal("1 °", Angle.FromDegrees(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 m²", Area.FromSquareMeters(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 V", ElectricPotential.FromVolts(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 N", Force.FromNewtons(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 m", Length.FromMeters(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 kg", Mass.FromKilograms(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 Pa", Pressure.FromPascals(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 rad/s", RotationalSpeed.FromRadiansPerSecond(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 K", Temperature.FromKelvins(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 N·m", Torque.FromNewtonMeters(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 m³", Volume.FromCubicMeters(1).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("1 m³/s", VolumeFlow.FromCubicMetersPerSecond(1).ToString(CultureInfo.InvariantCulture)); + Assert.Equal("1 °", Angle.FromDegrees(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 m²", Area.FromSquareMeters(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 V", ElectricPotential.FromVolts(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 N", Force.FromNewtons(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 m", Length.FromMeters(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 kg", Mass.FromKilograms(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 Pa", Pressure.FromPascals(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 rad/s", RotationalSpeed.FromRadiansPerSecond(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 K", Temperature.FromKelvins(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 N·m", Torque.FromNewtonMeters(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 m³", Volume.FromCubicMeters(1).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("1 m³/s", VolumeFlow.FromCubicMetersPerSecond(1).ToString(null, CultureInfo.InvariantCulture)); Assert.Equal("2 ft 3 in", Length.FromFeetInches(2, 3).FeetInches.ToString(CultureInfo.InvariantCulture)); Assert.Equal("3 st 7 lb", Mass.FromStonePounds(3, 7).StonePounds.ToString(CultureInfo.InvariantCulture)); @@ -293,35 +293,35 @@ public void AllUnitsImplementToStringForInvariantCulture() [Fact] public void ToString_WithNorwegianCulture() { - Assert.Equal("1 °", Angle.FromDegrees(1).ToUnit(AngleUnit.Degree).ToString(NorwegianCulture)); - Assert.Equal("1 m²", Area.FromSquareMeters(1).ToUnit(AreaUnit.SquareMeter).ToString(NorwegianCulture)); - Assert.Equal("1 V", ElectricPotential.FromVolts(1).ToUnit(ElectricPotentialUnit.Volt).ToString(NorwegianCulture)); - Assert.Equal("1 m³/s", VolumeFlow.FromCubicMetersPerSecond(1).ToUnit(VolumeFlowUnit.CubicMeterPerSecond).ToString(NorwegianCulture)); - Assert.Equal("1 N", Force.FromNewtons(1).ToUnit(ForceUnit.Newton).ToString(NorwegianCulture)); - Assert.Equal("1 m", Length.FromMeters(1).ToUnit(LengthUnit.Meter).ToString(NorwegianCulture)); - Assert.Equal("1 kg", Mass.FromKilograms(1).ToUnit(MassUnit.Kilogram).ToString(NorwegianCulture)); - Assert.Equal("1 Pa", Pressure.FromPascals(1).ToUnit(PressureUnit.Pascal).ToString(NorwegianCulture)); - Assert.Equal("1 rad/s", RotationalSpeed.FromRadiansPerSecond(1).ToUnit(RotationalSpeedUnit.RadianPerSecond).ToString(NorwegianCulture)); - Assert.Equal("1 K", Temperature.FromKelvins(1).ToUnit(TemperatureUnit.Kelvin).ToString(NorwegianCulture)); - Assert.Equal("1 N·m", Torque.FromNewtonMeters(1).ToUnit(TorqueUnit.NewtonMeter).ToString(NorwegianCulture)); - Assert.Equal("1 m³", Volume.FromCubicMeters(1).ToUnit(VolumeUnit.CubicMeter).ToString(NorwegianCulture)); + Assert.Equal("1 °", Angle.FromDegrees(1).ToUnit(AngleUnit.Degree).ToString(null, NorwegianCulture)); + Assert.Equal("1 m²", Area.FromSquareMeters(1).ToUnit(AreaUnit.SquareMeter).ToString(null, NorwegianCulture)); + Assert.Equal("1 V", ElectricPotential.FromVolts(1).ToUnit(ElectricPotentialUnit.Volt).ToString(null, NorwegianCulture)); + Assert.Equal("1 m³/s", VolumeFlow.FromCubicMetersPerSecond(1).ToUnit(VolumeFlowUnit.CubicMeterPerSecond).ToString(null, NorwegianCulture)); + Assert.Equal("1 N", Force.FromNewtons(1).ToUnit(ForceUnit.Newton).ToString(null, NorwegianCulture)); + Assert.Equal("1 m", Length.FromMeters(1).ToUnit(LengthUnit.Meter).ToString(null, NorwegianCulture)); + Assert.Equal("1 kg", Mass.FromKilograms(1).ToUnit(MassUnit.Kilogram).ToString(null, NorwegianCulture)); + Assert.Equal("1 Pa", Pressure.FromPascals(1).ToUnit(PressureUnit.Pascal).ToString(null, NorwegianCulture)); + Assert.Equal("1 rad/s", RotationalSpeed.FromRadiansPerSecond(1).ToUnit(RotationalSpeedUnit.RadianPerSecond).ToString(null, NorwegianCulture)); + Assert.Equal("1 K", Temperature.FromKelvins(1).ToUnit(TemperatureUnit.Kelvin).ToString(null, NorwegianCulture)); + Assert.Equal("1 N·m", Torque.FromNewtonMeters(1).ToUnit(TorqueUnit.NewtonMeter).ToString(null, NorwegianCulture)); + Assert.Equal("1 m³", Volume.FromCubicMeters(1).ToUnit(VolumeUnit.CubicMeter).ToString(null, NorwegianCulture)); } [Fact] public void ToString_WithRussianCulture() { - Assert.Equal("1 °", Angle.FromDegrees(1).ToUnit(AngleUnit.Degree).ToString(RussianCulture)); - Assert.Equal("1 м²", Area.FromSquareMeters(1).ToUnit(AreaUnit.SquareMeter).ToString(RussianCulture)); - Assert.Equal("1 В", ElectricPotential.FromVolts(1).ToUnit(ElectricPotentialUnit.Volt).ToString(RussianCulture)); - Assert.Equal("1 м³/с", VolumeFlow.FromCubicMetersPerSecond(1).ToUnit(VolumeFlowUnit.CubicMeterPerSecond).ToString(RussianCulture)); - Assert.Equal("1 Н", Force.FromNewtons(1).ToUnit(ForceUnit.Newton).ToString(RussianCulture)); - Assert.Equal("1 м", Length.FromMeters(1).ToUnit(LengthUnit.Meter).ToString(RussianCulture)); - Assert.Equal("1 кг", Mass.FromKilograms(1).ToUnit(MassUnit.Kilogram).ToString(RussianCulture)); - Assert.Equal("1 Па", Pressure.FromPascals(1).ToUnit(PressureUnit.Pascal).ToString(RussianCulture)); - Assert.Equal("1 рад/с", RotationalSpeed.FromRadiansPerSecond(1).ToUnit(RotationalSpeedUnit.RadianPerSecond).ToString(RussianCulture)); - Assert.Equal("1 K", Temperature.FromKelvins(1).ToUnit(TemperatureUnit.Kelvin).ToString(RussianCulture)); - Assert.Equal("1 Н·м", Torque.FromNewtonMeters(1).ToUnit(TorqueUnit.NewtonMeter).ToString(RussianCulture)); - Assert.Equal("1 м³", Volume.FromCubicMeters(1).ToUnit(VolumeUnit.CubicMeter).ToString(RussianCulture)); + Assert.Equal("1 °", Angle.FromDegrees(1).ToUnit(AngleUnit.Degree).ToString(null, RussianCulture)); + Assert.Equal("1 м²", Area.FromSquareMeters(1).ToUnit(AreaUnit.SquareMeter).ToString(null, RussianCulture)); + Assert.Equal("1 В", ElectricPotential.FromVolts(1).ToUnit(ElectricPotentialUnit.Volt).ToString(null, RussianCulture)); + Assert.Equal("1 м³/с", VolumeFlow.FromCubicMetersPerSecond(1).ToUnit(VolumeFlowUnit.CubicMeterPerSecond).ToString(null, RussianCulture)); + Assert.Equal("1 Н", Force.FromNewtons(1).ToUnit(ForceUnit.Newton).ToString(null, RussianCulture)); + Assert.Equal("1 м", Length.FromMeters(1).ToUnit(LengthUnit.Meter).ToString(null, RussianCulture)); + Assert.Equal("1 кг", Mass.FromKilograms(1).ToUnit(MassUnit.Kilogram).ToString(null, RussianCulture)); + Assert.Equal("1 Па", Pressure.FromPascals(1).ToUnit(PressureUnit.Pascal).ToString(null, RussianCulture)); + Assert.Equal("1 рад/с", RotationalSpeed.FromRadiansPerSecond(1).ToUnit(RotationalSpeedUnit.RadianPerSecond).ToString(null, RussianCulture)); + Assert.Equal("1 K", Temperature.FromKelvins(1).ToUnit(TemperatureUnit.Kelvin).ToString(null, RussianCulture)); + Assert.Equal("1 Н·м", Torque.FromNewtonMeters(1).ToUnit(TorqueUnit.NewtonMeter).ToString(null, RussianCulture)); + Assert.Equal("1 м³", Volume.FromCubicMeters(1).ToUnit(VolumeUnit.CubicMeter).ToString(null, RussianCulture)); } } diff --git a/UnitsNet.Tests/QuantityTests.ToString.cs b/UnitsNet.Tests/QuantityTests.ToString.cs index 65faccd6aa..9549dd5396 100644 --- a/UnitsNet.Tests/QuantityTests.ToString.cs +++ b/UnitsNet.Tests/QuantityTests.ToString.cs @@ -17,24 +17,24 @@ public class ToStringTests public void ReturnsTheOriginalValueAndUnit() { var culture = CultureInfo.InvariantCulture; - Assert.Equal("5 kg", Mass.FromKilograms(5).ToString(culture)); - Assert.Equal("5000 g", Mass.FromGrams(5000).ToString(culture)); - Assert.Equal("0.0001 long tn", Mass.FromLongTons(1e-4).ToString(culture)); - Assert.Equal("0.00034567 dN/m", ForcePerLength.FromDecinewtonsPerMeter(0.00034567).ToString(culture)); - Assert.Equal("0.0069 dB", Level.FromDecibels(0.0069).ToString(culture)); - Assert.Equal("0.011 kWh/kg", SpecificEnergy.FromKilowattHoursPerKilogram(0.011).ToString(culture)); + Assert.Equal("5 kg", Mass.FromKilograms(5).ToString(null, culture)); + Assert.Equal("5000 g", Mass.FromGrams(5000).ToString(null, culture)); + Assert.Equal("0.0001 long tn", Mass.FromLongTons(1e-4).ToString(null, culture)); + Assert.Equal("0.00034567 dN/m", ForcePerLength.FromDecinewtonsPerMeter(0.00034567).ToString(null, culture)); + Assert.Equal("0.0069 dB", Level.FromDecibels(0.0069).ToString(null, culture)); + Assert.Equal("0.011 kWh/kg", SpecificEnergy.FromKilowattHoursPerKilogram(0.011).ToString(null, culture)); // Assert.Equal("0.1 MJ/kg·C", SpecificEntropy.FromMegajoulesPerKilogramDegreeCelsius(0.1).ToString(culture)); - Assert.Equal("0.1 MJ/kg·°C", SpecificEntropy.FromMegajoulesPerKilogramDegreeCelsius(0.1).ToString(culture)); - Assert.Equal("5 cm", Length.FromCentimeters(5).ToString(culture)); + Assert.Equal("0.1 MJ/kg·°C", SpecificEntropy.FromMegajoulesPerKilogramDegreeCelsius(0.1).ToString(null, culture)); + Assert.Equal("5 cm", Length.FromCentimeters(5).ToString(null, culture)); } [Fact] public void FormatsNumberUsingGivenCulture() { using var _ = new CultureScope(CultureInfo.InvariantCulture); - Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString((IFormatProvider?)null)); - Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(CultureInfo.InvariantCulture)); - Assert.Equal("0,05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(CultureInfo.GetCultureInfo("nb-NO"))); + Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString()); + Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(null, CultureInfo.InvariantCulture)); + Assert.Equal("0,05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(null, CultureInfo.GetCultureInfo("nb-NO"))); } } } diff --git a/UnitsNet.Tests/QuantityTypeConverterTest.cs b/UnitsNet.Tests/QuantityTypeConverterTest.cs index ca15b50c97..6e6d91c049 100644 --- a/UnitsNet.Tests/QuantityTypeConverterTest.cs +++ b/UnitsNet.Tests/QuantityTypeConverterTest.cs @@ -264,7 +264,7 @@ public void ConvertTo_GivenCurrentCulture_ReturnValueFormattedAccordingToGivenCu culture: CultureInfo.GetCultureInfo("de-AT"), // uses comma as decimal separator uiCulture: CultureInfo.InvariantCulture); // uses dot as decimal separator Length length = Length.FromMeters(1.5); - string expectedResult = length.ToString(CultureInfo.CurrentCulture); + string expectedResult = length.ToString(null, CultureInfo.CurrentCulture); var convertedQuantity = (string?)converter.ConvertTo(context, CultureInfo.CurrentCulture, length, typeof(string)); diff --git a/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs b/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs index fedda4472b..bb1af196b5 100644 --- a/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs +++ b/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs @@ -237,7 +237,7 @@ public void MapUnitToDefaultAbbreviation_GivenCustomAbbreviation_SetsAbbreviatio var newZealandCulture = CultureInfo.GetCultureInfo("en-NZ"); UnitsNetSetup.Default.UnitAbbreviations.MapUnitToDefaultAbbreviation(AreaUnit.SquareMeter, newZealandCulture, "m^2"); - Assert.Equal("1 m^2", Area.FromSquareMeters(1).ToString(newZealandCulture)); + Assert.Equal("1 m^2", Area.FromSquareMeters(1).ToString(null, newZealandCulture)); } [Fact] diff --git a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs index 57cfee1b8d..d286b961db 100644 --- a/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs @@ -1035,32 +1035,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 584ac0de3e..5e7a3e9bdf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -1037,32 +1037,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index e381b30dd4..f6bb11f40e 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -1098,32 +1098,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index bc258c9816..68bc8f7fa3 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -810,32 +810,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 7ceef7ca45..43611655b4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -1027,32 +1027,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 0b0b9cfcfd..0267cbdba4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -1121,32 +1121,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 6c495102d4..d772302afa 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -811,32 +811,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 9bf65b7675..62db2d05c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -872,32 +872,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index 62ce547c49..38e667729c 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1449,32 +1449,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 87b0f7dcf6..95ac470284 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -824,32 +824,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index 01ab892215..5c5e8216c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -865,32 +865,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs index 1286088069..89a00586d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs @@ -870,32 +870,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 9c5f68a4b6..b61f5b8c24 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1817,32 +1817,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs b/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs index 0258546dca..b1c6718174 100644 --- a/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DoseAreaProduct.g.cs @@ -1107,32 +1107,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 29a6b52b27..20a02c562c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -1071,32 +1071,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 7c99e89231..d65d25a57f 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -947,32 +947,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 9fccdb2ac0..b552647d7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -1036,32 +1036,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs index c3c0cb98eb..98f6aa3ff8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs @@ -798,32 +798,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs index 7582b2cee5..1ccf460fce 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricApparentPower.g.cs @@ -855,32 +855,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs index 5b9e0a6516..87d934a25b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCapacitance.g.cs @@ -873,32 +873,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 6d0fe93098..dbfdc1c3de 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -972,32 +972,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 8dc4b7eb73..98e0c608f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -765,32 +765,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 31ae1f7508..e07fbde310 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -1035,32 +1035,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index 6185357f60..1695472acf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -866,32 +866,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 1f401e6938..7160731577 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -950,32 +950,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 6e60b45b35..1d7d331917 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -801,32 +801,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index d6f5d8e9b2..a23c13f9ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -883,32 +883,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index c18116b8d2..0d8ed79f9c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -765,32 +765,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs index 3bc020f499..5ab7f29713 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricImpedance.g.cs @@ -892,32 +892,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 73e87af91e..7298138ddf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -837,32 +837,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 0524f7ba67..ce75a84791 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -889,32 +889,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs index 1a7d89b1ca..a7f2686c90 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs @@ -1104,32 +1104,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs index d38bbf9f28..30644db8f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricReactance.g.cs @@ -891,32 +891,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs index fcbda67d80..bb24500831 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs @@ -798,32 +798,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs index 7e3602d3af..6a66acd401 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricReactivePower.g.cs @@ -819,32 +819,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index f4680cbd50..9a998eee69 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -904,32 +904,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 549bc37d8d..14be8e3a1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -1010,32 +1010,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs index 6e48ad9179..1f82ffbb1c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs @@ -801,32 +801,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs index 9de5b7aa28..034a371572 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricSusceptance.g.cs @@ -1035,32 +1035,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index b1023afba3..f75a1e3c94 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1561,32 +1561,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs index e8cc4d1578..eb86425999 100644 --- a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs @@ -973,32 +973,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 96b8253b31..0ca385fbc9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -897,32 +897,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs index c2051578d5..82461f1540 100644 --- a/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FluidResistance.g.cs @@ -1089,32 +1089,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 0cf91ae539..f286ae3e64 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -1104,32 +1104,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 4d11b9388e..374f45c418 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -1027,32 +1027,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 4111623605..af9f7a1aa1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -1497,32 +1497,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 34e9ca573d..f64e2da35e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -973,32 +973,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs index 8df73ecc28..09a8534608 100644 --- a/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs @@ -819,32 +819,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 8006caf670..b438246f3e 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -1081,32 +1081,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 7489c8f9ac..c3188f4262 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -834,32 +834,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 1919e9a0cb..15d0b927f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -832,32 +832,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs index cadf0717ce..586736bdc2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Impulse.g.cs @@ -978,32 +978,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index cca7dcbb53..5605b6d0f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1432,32 +1432,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 7a9010e546..cc6236da6c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -996,32 +996,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index 5830988e67..d718f77b47 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -909,32 +909,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs index 0487a05d5f..f2afc8ede2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs @@ -955,32 +955,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 15f8bec30c..6d81116a34 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -943,32 +943,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs index 031d8571e5..b3fd2de8db 100644 --- a/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LeakRate.g.cs @@ -801,32 +801,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index c60350df15..829a210d96 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by \generate-code.bat. // @@ -1639,32 +1639,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 8b13dab6d0..65e9c37892 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -774,32 +774,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 42be914595..e499e43d60 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -1098,32 +1098,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs index 9f58cb012f..bb2a526f59 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearPowerDensity.g.cs @@ -1197,32 +1197,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs index 763826f11b..be1d2ef9cb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs @@ -940,32 +940,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs index 6eaaaf560c..e7c2773f69 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminosity.g.cs @@ -999,32 +999,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 51a7aedab5..87a62b138b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -785,32 +785,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index cf10a6929e..8d0167e32e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -785,32 +785,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index ea33a6055c..cd4753d084 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -855,32 +855,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index d7b0b286f4..b083794a95 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -765,32 +765,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 57f3d001c6..4790be8bbc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -765,32 +765,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 9ecb3ea89d..c35716a720 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1348,32 +1348,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index 057487a995..a3685e5011 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -1670,32 +1670,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 5ef954faca..17dc6505d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -1414,32 +1414,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 2585ae1f64..b2973f9bc6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -987,32 +987,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index 7049f5d0c7..36acfed4d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs @@ -1178,32 +1178,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index acd8dd86ba..4b1787bd60 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1248,32 +1248,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs index 15ac985bf3..1fbd199c02 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molality.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molality.g.cs @@ -801,32 +801,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index ce6967aa3b..088b51c4c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -811,32 +811,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 1da342ca2b..c20020336f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -798,32 +798,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs index 280bfb5126..543f571cb0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -940,32 +940,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index b0dc8647f7..2f9bb571b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -1005,32 +1005,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 6cc86296ef..23d31a08c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -986,32 +986,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 9a72750e46..3d34a4d153 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -765,32 +765,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 8d8262bd1c..23d3f61a86 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -765,32 +765,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs index ed12c3eaa5..cb15d61060 100644 --- a/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PorousMediumPermeability.g.cs @@ -837,32 +837,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 7246b0241d..c1371bd523 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1334,32 +1334,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 92e952fd10..bf32a81b3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1536,32 +1536,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 71a896abfa..8862acd299 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -774,32 +774,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 12bdbf77df..aecc29dae5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1666,32 +1666,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 38533f3058..047f4a33ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -1081,32 +1081,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs index b57f0adb9e..ed0d0b03dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs @@ -872,32 +872,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs index 5899e3d517..12d24d5834 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs @@ -937,32 +937,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs index 01761c4a4b..1e6985f686 100644 --- a/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RadiationExposure.g.cs @@ -888,32 +888,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs index 14f51a39b3..21e243aab5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Radioactivity.g.cs @@ -1266,32 +1266,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 71dfdab69d..5649dfd17b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -838,32 +838,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs index 5c9c658d66..4727e20635 100644 --- a/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RatioChangeRate.g.cs @@ -780,32 +780,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs index 0e8f6a6ca7..92e27651d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs @@ -993,32 +993,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs index e6065e26fb..df8869480b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs @@ -989,32 +989,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs index 45620d538a..99444ebac2 100644 --- a/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RelativeHumidity.g.cs @@ -748,32 +748,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 03fd744cf7..4fdcaa7a14 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -816,32 +816,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 353f25359f..bc7ee2bcd5 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -998,32 +998,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index a035083f0f..af7f307f24 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -1365,32 +1365,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 1c61d270bf..731b32117a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -847,32 +847,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs index 168d57fd09..7d232c7df6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Scalar.g.cs @@ -748,32 +748,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index ce4f4cf588..9e21c926f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -751,32 +751,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index ca20c24014..57616afe16 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -1341,32 +1341,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index b27dc303be..a7396b896d 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -926,32 +926,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs index d824513537..31a1e383b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs @@ -819,32 +819,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 07f1994a8a..0065eafd9f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -818,32 +818,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index d8551976b7..e786da6a81 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -1087,32 +1087,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 73885a877c..50dc0a77b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1400,32 +1400,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs index eab2b96bb1..11cc4b725b 100644 --- a/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/StandardVolumeFlow.g.cs @@ -906,32 +906,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 6fadae50c4..9993d46a29 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -875,32 +875,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index e0a101b12a..950053faba 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -1063,32 +1063,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index c72a69624b..bb74670fa5 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -961,32 +961,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs index 11d64354e1..474c54d42a 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs @@ -829,32 +829,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index e31ec01384..7260929d72 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -783,32 +783,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs index 0133fcd6fa..b3f24b6293 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalInsulance.g.cs @@ -852,32 +852,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 7632fb2fdd..3fcfe0f973 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1249,32 +1249,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs index ec02d68ebb..eedc032daf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Turbidity.g.cs @@ -751,32 +751,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 143f790aa5..97dffe6eb9 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -748,32 +748,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 711534ca4a..eb8f0b5b56 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1813,32 +1813,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index 5130c4b829..ec5e516d80 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs @@ -1113,32 +1113,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index b160969e5f..9d9c70fcdb 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -2135,32 +2135,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs index 903b1ab63b..0236dea613 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs @@ -780,32 +780,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs index 49a17c2b03..8808ca8e9a 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumePerLength.g.cs @@ -906,32 +906,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs index e1888a5ac6..064f5e788c 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs @@ -909,32 +909,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs index 6426a72417..b3a14c271a 100644 --- a/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs @@ -852,32 +852,11 @@ public override string ToString() return ToString(null, null); } - /// - /// Gets the default string representation of value and unit using the given format provider. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString(IFormatProvider? provider) - { - return ToString(null, provider); - } - - /// - /// - /// Gets the string representation of this instance in the specified format string using . - /// - /// The format string. - /// The string representation. - public string ToString(string? format) - { - return ToString(format, null); - } - /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// - public string ToString(string? format, IFormatProvider? provider) + public string ToString(string? format = null, IFormatProvider? provider = null) { return QuantityFormatter.Default.Format(this, format, provider); } diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 6fa31d6d51..8ddb3cab06 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -86,19 +86,12 @@ public interface IQuantity : IFormattable IQuantity ToUnit(Enum unit); /// - /// Converts to a quantity with a unit determined by the given , which affects things like . + /// Converts to a quantity with a unit determined by the given . /// If multiple units were found for the given , the first match will be used. /// /// The to convert the quantity to. /// A new quantity with the determined unit. IQuantity ToUnit(UnitSystem unitSystem); - - /// - /// Gets the string representation of value and unit. Uses two significant digits after radix. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - string ToString(IFormatProvider? provider); /// /// Gets the unique key for the unit type and its corresponding value. @@ -143,7 +136,7 @@ public interface IQuantity : IQuantity IQuantity ToUnit(TUnitType unit); /// - /// Converts to a quantity with a unit determined by the given , which affects things like . + /// Converts to a quantity with a unit determined by the given . /// If multiple units were found for the given , the first match will be used. /// /// The to convert the quantity to. diff --git a/UnitsNet/QuantityTypeConverter.cs b/UnitsNet/QuantityTypeConverter.cs index 7722b87623..8a5aad6953 100644 --- a/UnitsNet/QuantityTypeConverter.cs +++ b/UnitsNet/QuantityTypeConverter.cs @@ -58,7 +58,7 @@ public ConvertToUnitAttribute(object? unitType) : base(unitType) { } public class DisplayAsUnitAttribute : DefaultUnitAttribute { /// - /// The formatting used when the quantity is converted to string. See + /// The formatting used when the quantity is converted to string. See /// public string Format { get; set; } @@ -66,7 +66,7 @@ public class DisplayAsUnitAttribute : DefaultUnitAttribute /// Initializes a new instance of the class. /// /// The unit the quantity should be displayed in - /// Formatting string + /// Formatting string See public DisplayAsUnitAttribute(object? unitType, string format = "G") : base(unitType) { Format = format; @@ -225,7 +225,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destina if (displayAsUnit == null) { - return qvalue.ToString(culture); + return qvalue.ToString(null, culture); } if (displayAsUnit.UnitType == null)