コード例 #1
0
        public void ConversionRoundTrip()
        {
            ElectricConductivity siemenspermeter = ElectricConductivity.FromSiemensPerMeter(1);

            AssertEx.EqualTolerance(1, ElectricConductivity.FromSiemensPerFoot(siemenspermeter.SiemensPerFoot).SiemensPerMeter, SiemensPerFootTolerance);
            AssertEx.EqualTolerance(1, ElectricConductivity.FromSiemensPerInch(siemenspermeter.SiemensPerInch).SiemensPerMeter, SiemensPerInchTolerance);
            AssertEx.EqualTolerance(1, ElectricConductivity.FromSiemensPerMeter(siemenspermeter.SiemensPerMeter).SiemensPerMeter, SiemensPerMeterTolerance);
        }
コード例 #2
0
 public static ElectricConductivity SiemensPerFoot <T>(this T value) =>
 ElectricConductivity.FromSiemensPerFoot(Convert.ToDecimal(value));
 public void NumberToSiemensPerFootTest() =>
 Assert.Equal(ElectricConductivity.FromSiemensPerFoot(2), 2.SiemensPerFoot());