Example #1
0
        public void ConversionRoundTrip()
        {
            ApparentPower voltampere = ApparentPower.FromVoltamperes(1);

            AssertEx.EqualTolerance(1, ApparentPower.FromKilovoltamperes(voltampere.Kilovoltamperes).Voltamperes, KilovoltamperesTolerance);
            AssertEx.EqualTolerance(1, ApparentPower.FromMegavoltamperes(voltampere.Megavoltamperes).Voltamperes, MegavoltamperesTolerance);
            AssertEx.EqualTolerance(1, ApparentPower.FromVoltamperes(voltampere.Voltamperes).Voltamperes, VoltamperesTolerance);
        }
Example #2
0
 /// <inheritdoc cref="ApparentPower.FromKilovoltamperes(UnitsNet.QuantityValue)" />
 public static ApparentPower?Kilovoltamperes(this double?value) => ApparentPower.FromKilovoltamperes(value);
Example #3
0
 /// <inheritdoc cref="ApparentPower.FromKilovoltamperes(UnitsNet.QuantityValue)" />
 public static ApparentPower Kilovoltamperes(this long value) => ApparentPower.FromKilovoltamperes(value);
Example #4
0
 /// <inheritdoc cref="ApparentPower.FromKilovoltamperes(UnitsNet.QuantityValue)" />
 public static ApparentPower?Kilovoltamperes(this decimal?value) => ApparentPower.FromKilovoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));
Example #5
0
 /// <inheritdoc cref="ApparentPower.FromKilovoltamperes(UnitsNet.QuantityValue)" />
 public static ApparentPower Kilovoltamperes(this decimal value) => ApparentPower.FromKilovoltamperes(Convert.ToDouble(value));
Example #6
0
 public static ApparentPower Kilovoltamperes <T>(this T value) =>
 ApparentPower.FromKilovoltamperes(Convert.ToDecimal(value));
Example #7
0
 public void NumberToKilovoltamperesTest() =>
 Assert.Equal(ApparentPower.FromKilovoltamperes(2), 2.Kilovoltamperes());
 public static ApparentPower?Kilovoltamperes <T>(this T?value) where T : struct => ApparentPower.FromKilovoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));