public void TryParse() { { Assert.True(WarpingMomentOfInertia.TryParse("1 cm⁶", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.CentimetersToTheSixth, CentimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.CentimeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 cm^6", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.CentimetersToTheSixth, CentimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.CentimeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 dm⁶", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.DecimetersToTheSixth, DecimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.DecimeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 dm^6", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.DecimetersToTheSixth, DecimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.DecimeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 ft⁶", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.FeetToTheSixth, FeetToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.FootToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 ft^6", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.FeetToTheSixth, FeetToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.FootToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 in⁶", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.InchesToTheSixth, InchesToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.InchToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 in^6", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.InchesToTheSixth, InchesToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.InchToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 m⁶", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.MetersToTheSixth, MetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 m^6", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.MetersToTheSixth, MetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 mm⁶", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.MillimetersToTheSixth, MillimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MillimeterToTheSixth, parsed.Unit); } { Assert.True(WarpingMomentOfInertia.TryParse("1 mm^6", CultureInfo.GetCultureInfo("en-US"), out var parsed)); AssertEx.EqualTolerance(1, parsed.MillimetersToTheSixth, MillimetersToTheSixthTolerance); Assert.Equal(WarpingMomentOfInertiaUnit.MillimeterToTheSixth, parsed.Unit); } }