Example #1
0
        public void ConversionRoundTrip()
        {
            ElectricConductance siemens = ElectricConductance.FromSiemens(1);

            AssertEx.EqualTolerance(1, ElectricConductance.FromMicrosiemens(siemens.Microsiemens).Siemens, MicrosiemensTolerance);
            AssertEx.EqualTolerance(1, ElectricConductance.FromMillisiemens(siemens.Millisiemens).Siemens, MillisiemensTolerance);
            AssertEx.EqualTolerance(1, ElectricConductance.FromSiemens(siemens.Siemens).Siemens, SiemensTolerance);
        }
Example #2
0
 /// <inheritdoc cref="ElectricConductance.FromMillisiemens(UnitsNet.QuantityValue)" />
 public static ElectricConductance?Millisiemens(this double?value) => ElectricConductance.FromMillisiemens(value);
 public static ElectricConductance Millisiemens <T>(this T value) =>
 ElectricConductance.FromMillisiemens(Convert.ToDecimal(value));
Example #4
0
 /// <inheritdoc cref="ElectricConductance.FromMillisiemens(UnitsNet.QuantityValue)" />
 public static ElectricConductance Millisiemens(this long value) => ElectricConductance.FromMillisiemens(value);
Example #5
0
 /// <inheritdoc cref="ElectricConductance.FromMillisiemens(UnitsNet.QuantityValue)" />
 public static ElectricConductance?Millisiemens(this decimal?value) => ElectricConductance.FromMillisiemens(value == null ? (double?)null : Convert.ToDouble(value.Value));
Example #6
0
 /// <inheritdoc cref="ElectricConductance.FromMillisiemens(UnitsNet.QuantityValue)" />
 public static ElectricConductance Millisiemens(this decimal value) => ElectricConductance.FromMillisiemens(Convert.ToDouble(value));
 public void NumberToMillisiemensTest() =>
 Assert.Equal(ElectricConductance.FromMillisiemens(2), 2.Millisiemens());
 public static ElectricConductance?Millisiemens <T>(this T?value) where T : struct => ElectricConductance.FromMillisiemens(value == null ? (double?)null : Convert.ToDouble(value.Value));