コード例 #1
0
        public void ConversionRoundTrip()
        {
            PressureChangeRate pascalpersecond = PressureChangeRate.FromPascalsPerSecond(1);

            AssertEx.EqualTolerance(1, PressureChangeRate.FromAtmospheresPerSecond(pascalpersecond.AtmospheresPerSecond).PascalsPerSecond, AtmospheresPerSecondTolerance);
            AssertEx.EqualTolerance(1, PressureChangeRate.FromKilopascalsPerSecond(pascalpersecond.KilopascalsPerSecond).PascalsPerSecond, KilopascalsPerSecondTolerance);
            AssertEx.EqualTolerance(1, PressureChangeRate.FromMegapascalsPerSecond(pascalpersecond.MegapascalsPerSecond).PascalsPerSecond, MegapascalsPerSecondTolerance);
            AssertEx.EqualTolerance(1, PressureChangeRate.FromPascalsPerSecond(pascalpersecond.PascalsPerSecond).PascalsPerSecond, PascalsPerSecondTolerance);
        }
コード例 #2
0
 public void NumberToMegapascalsPerSecondTest() =>
 Assert.Equal(PressureChangeRate.FromMegapascalsPerSecond(2), 2.MegapascalsPerSecond());
コード例 #3
0
 /// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double?)"/>
 public static PressureChangeRate?MegapascalsPerSecond(this decimal?value) => PressureChangeRate.FromMegapascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));
コード例 #4
0
 /// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double)"/>
 public static PressureChangeRate MegapascalsPerSecond(this decimal value) => PressureChangeRate.FromMegapascalsPerSecond(Convert.ToDouble(value));
コード例 #5
0
 /// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double?)"/>
 public static PressureChangeRate?MegapascalsPerSecond(this float?value) => PressureChangeRate.FromMegapascalsPerSecond(value);
コード例 #6
0
 /// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(double)"/>
 public static PressureChangeRate MegapascalsPerSecond(this double value) => PressureChangeRate.FromMegapascalsPerSecond(value);
コード例 #7
0
 public static PressureChangeRate MegapascalsPerSecond <T>(this T value) =>
 PressureChangeRate.FromMegapascalsPerSecond(Convert.ToDecimal(value));
コード例 #8
0
 public static PressureChangeRate?MegapascalsPerSecond <T>(this T?value) where T : struct => PressureChangeRate.FromMegapascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));