public void Parse() { try { var parsed = WarpingMomentOfInertia.Parse("1 cm⁶", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.CentimetersToTheSixth, CentimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.CentimeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 cm^6", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.CentimetersToTheSixth, CentimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.CentimeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 dm⁶", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.DecimetersToTheSixth, DecimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.DecimeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 dm^6", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.DecimetersToTheSixth, DecimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.DecimeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 ft⁶", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.FeetToTheSixth, FeetToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.FootToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 ft^6", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.FeetToTheSixth, FeetToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.FootToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 in⁶", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.InchesToTheSixth, InchesToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.InchToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 in^6", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.InchesToTheSixth, InchesToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.InchToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 m⁶", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.MetersToTheSixth, MetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 m^6", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.MetersToTheSixth, MetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 mm⁶", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.MillimetersToTheSixth, MillimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MillimeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } try { var parsed = WarpingMomentOfInertia.Parse("1 mm^6", CultureInfo.GetCultureInfo("en-US")); AssertEx.EqualTolerance(1, parsed.MillimetersToTheSixth, MillimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MillimeterToTheSixth, parsed.Unit); } catch (AmbiguousUnitParseException) { /* Some units have the same abbreviations */ } }