public void OhmToElectricResistanceUnits() { ElectricResistance ohm = ElectricResistance.FromOhms(1); AssertEx.EqualTolerance(KiloohmsInOneOhm, ohm.Kiloohms, KiloohmsTolerance); AssertEx.EqualTolerance(MegaohmsInOneOhm, ohm.Megaohms, MegaohmsTolerance); AssertEx.EqualTolerance(MilliohmsInOneOhm, ohm.Milliohms, MilliohmsTolerance); AssertEx.EqualTolerance(OhmsInOneOhm, ohm.Ohms, OhmsTolerance); }
public void ConversionRoundTrip() { ElectricResistance ohm = ElectricResistance.FromOhms(1); AssertEx.EqualTolerance(1, ElectricResistance.FromKiloohms(ohm.Kiloohms).Ohms, KiloohmsTolerance); AssertEx.EqualTolerance(1, ElectricResistance.FromMegaohms(ohm.Megaohms).Ohms, MegaohmsTolerance); AssertEx.EqualTolerance(1, ElectricResistance.FromMilliohms(ohm.Milliohms).Ohms, MilliohmsTolerance); AssertEx.EqualTolerance(1, ElectricResistance.FromOhms(ohm.Ohms).Ohms, OhmsTolerance); }
public void ConversionRoundTrip() { AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1); AssertEx.EqualTolerance(1, AmplitudeRatio.FromDecibelMicrovolts(decibelvolt.DecibelMicrovolts).DecibelVolts, DecibelMicrovoltsTolerance); AssertEx.EqualTolerance(1, AmplitudeRatio.FromDecibelMillivolts(decibelvolt.DecibelMillivolts).DecibelVolts, DecibelMillivoltsTolerance); AssertEx.EqualTolerance(1, AmplitudeRatio.FromDecibelsUnloaded(decibelvolt.DecibelsUnloaded).DecibelVolts, DecibelsUnloadedTolerance); AssertEx.EqualTolerance(1, AmplitudeRatio.FromDecibelVolts(decibelvolt.DecibelVolts).DecibelVolts, DecibelVoltsTolerance); }
public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit() { var quantity00 = ForceChangeRate.From(1, ForceChangeRateUnit.CentinewtonPerSecond); AssertEx.EqualTolerance(1, quantity00.CentinewtonsPerSecond, CentinewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.CentinewtonPerSecond, quantity00.Unit); var quantity01 = ForceChangeRate.From(1, ForceChangeRateUnit.DecanewtonPerMinute); AssertEx.EqualTolerance(1, quantity01.DecanewtonsPerMinute, DecanewtonsPerMinuteTolerance); Assert.Equal(ForceChangeRateUnit.DecanewtonPerMinute, quantity01.Unit); var quantity02 = ForceChangeRate.From(1, ForceChangeRateUnit.DecanewtonPerSecond); AssertEx.EqualTolerance(1, quantity02.DecanewtonsPerSecond, DecanewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.DecanewtonPerSecond, quantity02.Unit); var quantity03 = ForceChangeRate.From(1, ForceChangeRateUnit.DecinewtonPerSecond); AssertEx.EqualTolerance(1, quantity03.DecinewtonsPerSecond, DecinewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.DecinewtonPerSecond, quantity03.Unit); var quantity04 = ForceChangeRate.From(1, ForceChangeRateUnit.KilonewtonPerMinute); AssertEx.EqualTolerance(1, quantity04.KilonewtonsPerMinute, KilonewtonsPerMinuteTolerance); Assert.Equal(ForceChangeRateUnit.KilonewtonPerMinute, quantity04.Unit); var quantity05 = ForceChangeRate.From(1, ForceChangeRateUnit.KilonewtonPerSecond); AssertEx.EqualTolerance(1, quantity05.KilonewtonsPerSecond, KilonewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.KilonewtonPerSecond, quantity05.Unit); var quantity06 = ForceChangeRate.From(1, ForceChangeRateUnit.MicronewtonPerSecond); AssertEx.EqualTolerance(1, quantity06.MicronewtonsPerSecond, MicronewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.MicronewtonPerSecond, quantity06.Unit); var quantity07 = ForceChangeRate.From(1, ForceChangeRateUnit.MillinewtonPerSecond); AssertEx.EqualTolerance(1, quantity07.MillinewtonsPerSecond, MillinewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.MillinewtonPerSecond, quantity07.Unit); var quantity08 = ForceChangeRate.From(1, ForceChangeRateUnit.NanonewtonPerSecond); AssertEx.EqualTolerance(1, quantity08.NanonewtonsPerSecond, NanonewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.NanonewtonPerSecond, quantity08.Unit); var quantity09 = ForceChangeRate.From(1, ForceChangeRateUnit.NewtonPerMinute); AssertEx.EqualTolerance(1, quantity09.NewtonsPerMinute, NewtonsPerMinuteTolerance); Assert.Equal(ForceChangeRateUnit.NewtonPerMinute, quantity09.Unit); var quantity10 = ForceChangeRate.From(1, ForceChangeRateUnit.NewtonPerSecond); AssertEx.EqualTolerance(1, quantity10.NewtonsPerSecond, NewtonsPerSecondTolerance); Assert.Equal(ForceChangeRateUnit.NewtonPerSecond, quantity10.Unit); }
public void As() { var ohm = ElectricResistance.FromOhms(1); AssertEx.EqualTolerance(KiloohmsInOneOhm, ohm.As(ElectricResistanceUnit.Kiloohm), KiloohmsTolerance); AssertEx.EqualTolerance(MegaohmsInOneOhm, ohm.As(ElectricResistanceUnit.Megaohm), MegaohmsTolerance); AssertEx.EqualTolerance(MilliohmsInOneOhm, ohm.As(ElectricResistanceUnit.Milliohm), MilliohmsTolerance); AssertEx.EqualTolerance(OhmsInOneOhm, ohm.As(ElectricResistanceUnit.Ohm), OhmsTolerance); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, AreaMomentOfInertia.From(1, AreaMomentOfInertiaUnit.CentimeterToTheFourth).CentimetersToTheFourth, CentimetersToTheFourthTolerance); AssertEx.EqualTolerance(1, AreaMomentOfInertia.From(1, AreaMomentOfInertiaUnit.DecimeterToTheFourth).DecimetersToTheFourth, DecimetersToTheFourthTolerance); AssertEx.EqualTolerance(1, AreaMomentOfInertia.From(1, AreaMomentOfInertiaUnit.FootToTheFourth).FeetToTheFourth, FeetToTheFourthTolerance); AssertEx.EqualTolerance(1, AreaMomentOfInertia.From(1, AreaMomentOfInertiaUnit.InchToTheFourth).InchesToTheFourth, InchesToTheFourthTolerance); AssertEx.EqualTolerance(1, AreaMomentOfInertia.From(1, AreaMomentOfInertiaUnit.MeterToTheFourth).MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(1, AreaMomentOfInertia.From(1, AreaMomentOfInertiaUnit.MillimeterToTheFourth).MillimetersToTheFourth, MillimetersToTheFourthTolerance); }
public void As() { var decibelvolt = AmplitudeRatio.FromDecibelVolts(1); AssertEx.EqualTolerance(DecibelMicrovoltsInOneDecibelVolt, decibelvolt.As(AmplitudeRatioUnit.DecibelMicrovolt), DecibelMicrovoltsTolerance); AssertEx.EqualTolerance(DecibelMillivoltsInOneDecibelVolt, decibelvolt.As(AmplitudeRatioUnit.DecibelMillivolt), DecibelMillivoltsTolerance); AssertEx.EqualTolerance(DecibelsUnloadedInOneDecibelVolt, decibelvolt.As(AmplitudeRatioUnit.DecibelUnloaded), DecibelsUnloadedTolerance); AssertEx.EqualTolerance(DecibelVoltsInOneDecibelVolt, decibelvolt.As(AmplitudeRatioUnit.DecibelVolt), DecibelVoltsTolerance); }
public void ConversionRoundTrip() { ReactivePower voltamperereactive = ReactivePower.FromVoltamperesReactive(1); AssertEx.EqualTolerance(1, ReactivePower.FromGigavoltamperesReactive(voltamperereactive.GigavoltamperesReactive).VoltamperesReactive, GigavoltamperesReactiveTolerance); AssertEx.EqualTolerance(1, ReactivePower.FromKilovoltamperesReactive(voltamperereactive.KilovoltamperesReactive).VoltamperesReactive, KilovoltamperesReactiveTolerance); AssertEx.EqualTolerance(1, ReactivePower.FromMegavoltamperesReactive(voltamperereactive.MegavoltamperesReactive).VoltamperesReactive, MegavoltamperesReactiveTolerance); AssertEx.EqualTolerance(1, ReactivePower.FromVoltamperesReactive(voltamperereactive.VoltamperesReactive).VoltamperesReactive, VoltamperesReactiveTolerance); }
public void ToUnit() { var amperepermeter = Magnetization.FromAmperesPerMeter(1); var amperepermeterQuantity = amperepermeter.ToUnit(MagnetizationUnit.AmperePerMeter); AssertEx.EqualTolerance(AmperesPerMeterInOneAmperePerMeter, (double)amperepermeterQuantity.Value, AmperesPerMeterTolerance); Assert.Equal(MagnetizationUnit.AmperePerMeter, amperepermeterQuantity.Unit); }
public void VoltampereReactiveToReactivePowerUnits() { ReactivePower voltamperereactive = ReactivePower.FromVoltamperesReactive(1); AssertEx.EqualTolerance(GigavoltamperesReactiveInOneVoltampereReactive, voltamperereactive.GigavoltamperesReactive, GigavoltamperesReactiveTolerance); AssertEx.EqualTolerance(KilovoltamperesReactiveInOneVoltampereReactive, voltamperereactive.KilovoltamperesReactive, KilovoltamperesReactiveTolerance); AssertEx.EqualTolerance(MegavoltamperesReactiveInOneVoltampereReactive, voltamperereactive.MegavoltamperesReactive, MegavoltamperesReactiveTolerance); AssertEx.EqualTolerance(VoltamperesReactiveInOneVoltampereReactive, voltamperereactive.VoltamperesReactive, VoltamperesReactiveTolerance); }
public void As() { var voltamperereactive = ReactivePower.FromVoltamperesReactive(1); AssertEx.EqualTolerance(GigavoltamperesReactiveInOneVoltampereReactive, voltamperereactive.As(ReactivePowerUnit.GigavoltampereReactive), GigavoltamperesReactiveTolerance); AssertEx.EqualTolerance(KilovoltamperesReactiveInOneVoltampereReactive, voltamperereactive.As(ReactivePowerUnit.KilovoltampereReactive), KilovoltamperesReactiveTolerance); AssertEx.EqualTolerance(MegavoltamperesReactiveInOneVoltampereReactive, voltamperereactive.As(ReactivePowerUnit.MegavoltampereReactive), MegavoltamperesReactiveTolerance); AssertEx.EqualTolerance(VoltamperesReactiveInOneVoltampereReactive, voltamperereactive.As(ReactivePowerUnit.VoltampereReactive), VoltamperesReactiveTolerance); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Centipoise).Centipoise, CentipoiseTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.MicropascalSecond).MicropascalSeconds, MicropascalSecondsTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.MillipascalSecond).MillipascalSeconds, MillipascalSecondsTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.NewtonSecondPerMeterSquared).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.PascalSecond).PascalSeconds, PascalSecondsTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.From(1, DynamicViscosityUnit.Poise).Poise, PoiseTolerance); }
public void ToUnit() { var voltpermeter = ElectricField.FromVoltsPerMeter(1); var voltpermeterQuantity = voltpermeter.ToUnit(ElectricFieldUnit.VoltPerMeter); AssertEx.EqualTolerance(VoltsPerMeterInOneVoltPerMeter, (double)voltpermeterQuantity.Value, VoltsPerMeterTolerance); Assert.Equal(ElectricFieldUnit.VoltPerMeter, voltpermeterQuantity.Unit); }
public void ToUnit() { var squaremetercelciusdegreeperkilowatt = ThermalInsulance.FromSquareMeterCelciusDegreePerKilowatts(1); var squaremetercelciusdegreeperkilowattQuantity = squaremetercelciusdegreeperkilowatt.ToUnit(ThermalInsulanceUnit.SquareMeterCelciusDegreePerKilowatt); AssertEx.EqualTolerance(SquareMeterCelciusDegreePerKilowattsInOneSquareMeterCelciusDegreePerKilowatt, (double)squaremetercelciusdegreeperkilowattQuantity.Value, SquareMeterCelciusDegreePerKilowattsTolerance); Assert.Equal(ThermalInsulanceUnit.SquareMeterCelciusDegreePerKilowatt, squaremetercelciusdegreeperkilowattQuantity.Unit); }
public void ToUnit() { var amount = Scalar.FromAmount(1); var amountQuantity = amount.ToUnit(ScalarUnit.Amount); AssertEx.EqualTolerance(AmountInOneAmount, (double)amountQuantity.Value, AmountTolerance); Assert.Equal(ScalarUnit.Amount, amountQuantity.Unit); }
public void As() { var voltdc = ElectricPotentialDc.FromVoltsDc(1); AssertEx.EqualTolerance(KilovoltsDcInOneVoltDc, voltdc.As(ElectricPotentialDcUnit.KilovoltDc), KilovoltsDcTolerance); AssertEx.EqualTolerance(MegavoltsDcInOneVoltDc, voltdc.As(ElectricPotentialDcUnit.MegavoltDc), MegavoltsDcTolerance); AssertEx.EqualTolerance(MicrovoltsDcInOneVoltDc, voltdc.As(ElectricPotentialDcUnit.MicrovoltDc), MicrovoltsDcTolerance); AssertEx.EqualTolerance(MillivoltsDcInOneVoltDc, voltdc.As(ElectricPotentialDcUnit.MillivoltDc), MillivoltsDcTolerance); AssertEx.EqualTolerance(VoltsDcInOneVoltDc, voltdc.As(ElectricPotentialDcUnit.VoltDc), VoltsDcTolerance); }
public void VoltDcToElectricPotentialDcUnits() { ElectricPotentialDc voltdc = ElectricPotentialDc.FromVoltsDc(1); AssertEx.EqualTolerance(KilovoltsDcInOneVoltDc, voltdc.KilovoltsDc, KilovoltsDcTolerance); AssertEx.EqualTolerance(MegavoltsDcInOneVoltDc, voltdc.MegavoltsDc, MegavoltsDcTolerance); AssertEx.EqualTolerance(MicrovoltsDcInOneVoltDc, voltdc.MicrovoltsDc, MicrovoltsDcTolerance); AssertEx.EqualTolerance(MillivoltsDcInOneVoltDc, voltdc.MillivoltsDc, MillivoltsDcTolerance); AssertEx.EqualTolerance(VoltsDcInOneVoltDc, voltdc.VoltsDc, VoltsDcTolerance); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.JoulePerSquareCentimeter).JoulesPerSquareCentimeter, JoulesPerSquareCentimeterTolerance); AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.JoulePerSquareMeter).JoulesPerSquareMeter, JoulesPerSquareMeterTolerance); AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.JoulePerSquareMillimeter).JoulesPerSquareMillimeter, JoulesPerSquareMillimeterTolerance); AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.KilojoulePerSquareMeter).KilojoulesPerSquareMeter, KilojoulesPerSquareMeterTolerance); AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.KilowattHourPerSquareMeter).KilowattHoursPerSquareMeter, KilowattHoursPerSquareMeterTolerance); AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.MillijoulePerSquareCentimeter).MillijoulesPerSquareCentimeter, MillijoulesPerSquareCentimeterTolerance); AssertEx.EqualTolerance(1, Irradiation.From(1, IrradiationUnit.WattHourPerSquareMeter).WattHoursPerSquareMeter, WattHoursPerSquareMeterTolerance); }
public void As() { var metertothesixth = WarpingMomentOfInertia.FromMetersToTheSixth(1); AssertEx.EqualTolerance(CentimetersToTheSixthInOneMeterToTheSixth, metertothesixth.As(WarpingMomentOfInertiaUnit.CentimeterToTheSixth), CentimetersToTheSixthTolerance); AssertEx.EqualTolerance(DecimetersToTheSixthInOneMeterToTheSixth, metertothesixth.As(WarpingMomentOfInertiaUnit.DecimeterToTheSixth), DecimetersToTheSixthTolerance); AssertEx.EqualTolerance(FeetToTheSixthInOneMeterToTheSixth, metertothesixth.As(WarpingMomentOfInertiaUnit.FootToTheSixth), FeetToTheSixthTolerance); AssertEx.EqualTolerance(InchesToTheSixthInOneMeterToTheSixth, metertothesixth.As(WarpingMomentOfInertiaUnit.InchToTheSixth), InchesToTheSixthTolerance); AssertEx.EqualTolerance(MetersToTheSixthInOneMeterToTheSixth, metertothesixth.As(WarpingMomentOfInertiaUnit.MeterToTheSixth), MetersToTheSixthTolerance); AssertEx.EqualTolerance(MillimetersToTheSixthInOneMeterToTheSixth, metertothesixth.As(WarpingMomentOfInertiaUnit.MillimeterToTheSixth), MillimetersToTheSixthTolerance); }
public void ConversionRoundTrip() { WarpingMomentOfInertia metertothesixth = WarpingMomentOfInertia.FromMetersToTheSixth(1); AssertEx.EqualTolerance(1, WarpingMomentOfInertia.FromCentimetersToTheSixth(metertothesixth.CentimetersToTheSixth).MetersToTheSixth, CentimetersToTheSixthTolerance); AssertEx.EqualTolerance(1, WarpingMomentOfInertia.FromDecimetersToTheSixth(metertothesixth.DecimetersToTheSixth).MetersToTheSixth, DecimetersToTheSixthTolerance); AssertEx.EqualTolerance(1, WarpingMomentOfInertia.FromFeetToTheSixth(metertothesixth.FeetToTheSixth).MetersToTheSixth, FeetToTheSixthTolerance); AssertEx.EqualTolerance(1, WarpingMomentOfInertia.FromInchesToTheSixth(metertothesixth.InchesToTheSixth).MetersToTheSixth, InchesToTheSixthTolerance); AssertEx.EqualTolerance(1, WarpingMomentOfInertia.FromMetersToTheSixth(metertothesixth.MetersToTheSixth).MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(1, WarpingMomentOfInertia.FromMillimetersToTheSixth(metertothesixth.MillimetersToTheSixth).MetersToTheSixth, MillimetersToTheSixthTolerance); }
public void ConversionRoundTrip() { ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1); AssertEx.EqualTolerance(1, ElectricPotentialAc.FromKilovoltsAc(voltac.KilovoltsAc).VoltsAc, KilovoltsAcTolerance); AssertEx.EqualTolerance(1, ElectricPotentialAc.FromMegavoltsAc(voltac.MegavoltsAc).VoltsAc, MegavoltsAcTolerance); AssertEx.EqualTolerance(1, ElectricPotentialAc.FromMicrovoltsAc(voltac.MicrovoltsAc).VoltsAc, MicrovoltsAcTolerance); AssertEx.EqualTolerance(1, ElectricPotentialAc.FromMillivoltsAc(voltac.MillivoltsAc).VoltsAc, MillivoltsAcTolerance); AssertEx.EqualTolerance(1, ElectricPotentialAc.FromVoltsAc(voltac.VoltsAc).VoltsAc, VoltsAcTolerance); }
public void MeterToTheSixthToWarpingMomentOfInertiaUnits() { WarpingMomentOfInertia metertothesixth = WarpingMomentOfInertia.FromMetersToTheSixth(1); AssertEx.EqualTolerance(CentimetersToTheSixthInOneMeterToTheSixth, metertothesixth.CentimetersToTheSixth, CentimetersToTheSixthTolerance); AssertEx.EqualTolerance(DecimetersToTheSixthInOneMeterToTheSixth, metertothesixth.DecimetersToTheSixth, DecimetersToTheSixthTolerance); AssertEx.EqualTolerance(FeetToTheSixthInOneMeterToTheSixth, metertothesixth.FeetToTheSixth, FeetToTheSixthTolerance); AssertEx.EqualTolerance(InchesToTheSixthInOneMeterToTheSixth, metertothesixth.InchesToTheSixth, InchesToTheSixthTolerance); AssertEx.EqualTolerance(MetersToTheSixthInOneMeterToTheSixth, metertothesixth.MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(MillimetersToTheSixthInOneMeterToTheSixth, metertothesixth.MillimetersToTheSixth, MillimetersToTheSixthTolerance); }
public void As() { var voltac = ElectricPotentialAc.FromVoltsAc(1); AssertEx.EqualTolerance(KilovoltsAcInOneVoltAc, voltac.As(ElectricPotentialAcUnit.KilovoltAc), KilovoltsAcTolerance); AssertEx.EqualTolerance(MegavoltsAcInOneVoltAc, voltac.As(ElectricPotentialAcUnit.MegavoltAc), MegavoltsAcTolerance); AssertEx.EqualTolerance(MicrovoltsAcInOneVoltAc, voltac.As(ElectricPotentialAcUnit.MicrovoltAc), MicrovoltsAcTolerance); AssertEx.EqualTolerance(MillivoltsAcInOneVoltAc, voltac.As(ElectricPotentialAcUnit.MillivoltAc), MillivoltsAcTolerance); AssertEx.EqualTolerance(VoltsAcInOneVoltAc, voltac.As(ElectricPotentialAcUnit.VoltAc), VoltsAcTolerance); }
public void VoltAcToElectricPotentialAcUnits() { ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1); AssertEx.EqualTolerance(KilovoltsAcInOneVoltAc, voltac.KilovoltsAc, KilovoltsAcTolerance); AssertEx.EqualTolerance(MegavoltsAcInOneVoltAc, voltac.MegavoltsAc, MegavoltsAcTolerance); AssertEx.EqualTolerance(MicrovoltsAcInOneVoltAc, voltac.MicrovoltsAc, MicrovoltsAcTolerance); AssertEx.EqualTolerance(MillivoltsAcInOneVoltAc, voltac.MillivoltsAc, MillivoltsAcTolerance); AssertEx.EqualTolerance(VoltsAcInOneVoltAc, voltac.VoltsAc, VoltsAcTolerance); }
public void ArithmeticOperators() { TemperatureChangeRate v = TemperatureChangeRate.FromDegreesCelsiusPerSecond(1); AssertEx.EqualTolerance(-1, -v.DegreesCelsiusPerSecond, DegreesCelsiusPerSecondTolerance); AssertEx.EqualTolerance(2, (TemperatureChangeRate.FromDegreesCelsiusPerSecond(3)-v).DegreesCelsiusPerSecond, DegreesCelsiusPerSecondTolerance); AssertEx.EqualTolerance(2, (v + v).DegreesCelsiusPerSecond, DegreesCelsiusPerSecondTolerance); AssertEx.EqualTolerance(10, (v*10).DegreesCelsiusPerSecond, DegreesCelsiusPerSecondTolerance); AssertEx.EqualTolerance(10, (10*v).DegreesCelsiusPerSecond, DegreesCelsiusPerSecondTolerance); AssertEx.EqualTolerance(2, (TemperatureChangeRate.FromDegreesCelsiusPerSecond(10)/5).DegreesCelsiusPerSecond, DegreesCelsiusPerSecondTolerance); AssertEx.EqualTolerance(2, TemperatureChangeRate.FromDegreesCelsiusPerSecond(10)/TemperatureChangeRate.FromDegreesCelsiusPerSecond(5), DegreesCelsiusPerSecondTolerance); }
public void ArithmeticOperators() { Power v = Power.FromWatts(1); AssertEx.EqualTolerance(-1, -v.Watts, WattsTolerance); AssertEx.EqualTolerance(2, (Power.FromWatts(3)-v).Watts, WattsTolerance); AssertEx.EqualTolerance(2, (v + v).Watts, WattsTolerance); AssertEx.EqualTolerance(10, (v*10).Watts, WattsTolerance); AssertEx.EqualTolerance(10, (10*v).Watts, WattsTolerance); AssertEx.EqualTolerance(2, (Power.FromWatts(10)/5).Watts, WattsTolerance); AssertEx.EqualTolerance(2, Power.FromWatts(10)/Power.FromWatts(5), WattsTolerance); }
public void ArithmeticOperators() { WarpingMomentOfInertia v = WarpingMomentOfInertia.FromMetersToTheSixth(1); AssertEx.EqualTolerance(-1, -v.MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(2, (WarpingMomentOfInertia.FromMetersToTheSixth(3)-v).MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(2, (v + v).MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(10, (v*10).MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(10, (10*v).MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(2, (WarpingMomentOfInertia.FromMetersToTheSixth(10)/5).MetersToTheSixth, MetersToTheSixthTolerance); AssertEx.EqualTolerance(2, WarpingMomentOfInertia.FromMetersToTheSixth(10)/WarpingMomentOfInertia.FromMetersToTheSixth(5), MetersToTheSixthTolerance); }
public void ArithmeticOperators() { ElectricCurrentGradient v = ElectricCurrentGradient.FromAmperesPerSecond(1); AssertEx.EqualTolerance(-1, -v.AmperesPerSecond, AmperesPerSecondTolerance); AssertEx.EqualTolerance(2, (ElectricCurrentGradient.FromAmperesPerSecond(3)-v).AmperesPerSecond, AmperesPerSecondTolerance); AssertEx.EqualTolerance(2, (v + v).AmperesPerSecond, AmperesPerSecondTolerance); AssertEx.EqualTolerance(10, (v*10).AmperesPerSecond, AmperesPerSecondTolerance); AssertEx.EqualTolerance(10, (10*v).AmperesPerSecond, AmperesPerSecondTolerance); AssertEx.EqualTolerance(2, (ElectricCurrentGradient.FromAmperesPerSecond(10)/5).AmperesPerSecond, AmperesPerSecondTolerance); AssertEx.EqualTolerance(2, ElectricCurrentGradient.FromAmperesPerSecond(10)/ElectricCurrentGradient.FromAmperesPerSecond(5), AmperesPerSecondTolerance); }
public void FromValueAndUnit() { AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.CaloriePerGram).CaloriesPerGram, CaloriesPerGramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.JoulePerKilogram).JoulesPerKilogram, JoulesPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.KilocaloriePerGram).KilocaloriesPerGram, KilocaloriesPerGramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.KilojoulePerKilogram).KilojoulesPerKilogram, KilojoulesPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.KilowattHourPerKilogram).KilowattHoursPerKilogram, KilowattHoursPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.MegajoulePerKilogram).MegajoulesPerKilogram, MegajoulesPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.MegawattHourPerKilogram).MegawattHoursPerKilogram, MegawattHoursPerKilogramTolerance); AssertEx.EqualTolerance(1, SpecificEnergy.From(1, SpecificEnergyUnit.WattHourPerKilogram).WattHoursPerKilogram, WattHoursPerKilogramTolerance); }
public void ArithmeticOperators() { ReactivePower v = ReactivePower.FromVoltamperesReactive(1); AssertEx.EqualTolerance(-1, -v.VoltamperesReactive, VoltamperesReactiveTolerance); AssertEx.EqualTolerance(2, (ReactivePower.FromVoltamperesReactive(3)-v).VoltamperesReactive, VoltamperesReactiveTolerance); AssertEx.EqualTolerance(2, (v + v).VoltamperesReactive, VoltamperesReactiveTolerance); AssertEx.EqualTolerance(10, (v*10).VoltamperesReactive, VoltamperesReactiveTolerance); AssertEx.EqualTolerance(10, (10*v).VoltamperesReactive, VoltamperesReactiveTolerance); AssertEx.EqualTolerance(2, (ReactivePower.FromVoltamperesReactive(10)/5).VoltamperesReactive, VoltamperesReactiveTolerance); AssertEx.EqualTolerance(2, ReactivePower.FromVoltamperesReactive(10)/ReactivePower.FromVoltamperesReactive(5), VoltamperesReactiveTolerance); }