public void ConversionRoundTrip() { HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerHourSquareFoot(wattpersquaremeter.BtusPerHourSquareFoot).WattsPerSquareMeter, BtusPerHourSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerMinuteSquareFoot(wattpersquaremeter.BtusPerMinuteSquareFoot).WattsPerSquareMeter, BtusPerMinuteSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerSecondSquareFoot(wattpersquaremeter.BtusPerSecondSquareFoot).WattsPerSquareMeter, BtusPerSecondSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerSecondSquareInch(wattpersquaremeter.BtusPerSecondSquareInch).WattsPerSquareMeter, BtusPerSecondSquareInchTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromCaloriesPerSecondSquareCentimeter(wattpersquaremeter.CaloriesPerSecondSquareCentimeter).WattsPerSquareMeter, CaloriesPerSecondSquareCentimeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromCentiwattsPerSquareMeter(wattpersquaremeter.CentiwattsPerSquareMeter).WattsPerSquareMeter, CentiwattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromDeciwattsPerSquareMeter(wattpersquaremeter.DeciwattsPerSquareMeter).WattsPerSquareMeter, DeciwattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromKilocaloriesPerHourSquareMeter(wattpersquaremeter.KilocaloriesPerHourSquareMeter).WattsPerSquareMeter, KilocaloriesPerHourSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(wattpersquaremeter.KilocaloriesPerSecondSquareCentimeter).WattsPerSquareMeter, KilocaloriesPerSecondSquareCentimeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromKilowattsPerSquareMeter(wattpersquaremeter.KilowattsPerSquareMeter).WattsPerSquareMeter, KilowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromMicrowattsPerSquareMeter(wattpersquaremeter.MicrowattsPerSquareMeter).WattsPerSquareMeter, MicrowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromMilliwattsPerSquareMeter(wattpersquaremeter.MilliwattsPerSquareMeter).WattsPerSquareMeter, MilliwattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromNanowattsPerSquareMeter(wattpersquaremeter.NanowattsPerSquareMeter).WattsPerSquareMeter, NanowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareFoot(wattpersquaremeter.WattsPerSquareFoot).WattsPerSquareMeter, WattsPerSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareInch(wattpersquaremeter.WattsPerSquareInch).WattsPerSquareMeter, WattsPerSquareInchTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareMeter(wattpersquaremeter.WattsPerSquareMeter).WattsPerSquareMeter, WattsPerSquareMeterTolerance); }
public void ConversionRoundTrip() { HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerHourSquareFoot(wattpersquaremeter.BtusPerHourSquareFoot).WattsPerSquareMeter, BtusPerHourSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerMinuteSquareFoot(wattpersquaremeter.BtusPerMinuteSquareFoot).WattsPerSquareMeter, BtusPerMinuteSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerSecondSquareFoot(wattpersquaremeter.BtusPerSecondSquareFoot).WattsPerSquareMeter, BtusPerSecondSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerSecondSquareInch(wattpersquaremeter.BtusPerSecondSquareInch).WattsPerSquareMeter, BtusPerSecondSquareInchTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromCaloriesPerSecondSquareCentimeter(wattpersquaremeter.CaloriesPerSecondSquareCentimeter).WattsPerSquareMeter, CaloriesPerSecondSquareCentimeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromCentiwattsPerSquareMeter(wattpersquaremeter.CentiwattsPerSquareMeter).WattsPerSquareMeter, CentiwattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromDecawattsPerSquareMeter(wattpersquaremeter.DecawattsPerSquareMeter).WattsPerSquareMeter, DecawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromDeciwattsPerSquareMeter(wattpersquaremeter.DeciwattsPerSquareMeter).WattsPerSquareMeter, DeciwattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromExawattsPerSquareMeter(wattpersquaremeter.ExawattsPerSquareMeter).WattsPerSquareMeter, ExawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromFemtowattsPerSquareMeter(wattpersquaremeter.FemtowattsPerSquareMeter).WattsPerSquareMeter, FemtowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromGigawattsPerSquareMeter(wattpersquaremeter.GigawattsPerSquareMeter).WattsPerSquareMeter, GigawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromHectowattsPerSquareMeter(wattpersquaremeter.HectowattsPerSquareMeter).WattsPerSquareMeter, HectowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromKilocaloriesPerHourSquareMeter(wattpersquaremeter.KilocaloriesPerHourSquareMeter).WattsPerSquareMeter, KilocaloriesPerHourSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(wattpersquaremeter.KilocaloriesPerSecondSquareCentimeter).WattsPerSquareMeter, KilocaloriesPerSecondSquareCentimeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromKilowattsPerSquareMeter(wattpersquaremeter.KilowattsPerSquareMeter).WattsPerSquareMeter, KilowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromMegawattsPerSquareMeter(wattpersquaremeter.MegawattsPerSquareMeter).WattsPerSquareMeter, MegawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromMicrowattsPerSquareMeter(wattpersquaremeter.MicrowattsPerSquareMeter).WattsPerSquareMeter, MicrowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromMilliwattsPerSquareMeter(wattpersquaremeter.MilliwattsPerSquareMeter).WattsPerSquareMeter, MilliwattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromNanowattsPerSquareMeter(wattpersquaremeter.NanowattsPerSquareMeter).WattsPerSquareMeter, NanowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromPetawattsPerSquareMeter(wattpersquaremeter.PetawattsPerSquareMeter).WattsPerSquareMeter, PetawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromPicowattsPerSquareMeter(wattpersquaremeter.PicowattsPerSquareMeter).WattsPerSquareMeter, PicowattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromPoundsForcePerFootSecond(wattpersquaremeter.PoundsForcePerFootSecond).WattsPerSquareMeter, PoundsForcePerFootSecondTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromPoundsPerSecondCubed(wattpersquaremeter.PoundsPerSecondCubed).WattsPerSquareMeter, PoundsPerSecondCubedTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromQutrawattsPerSquareMeter(wattpersquaremeter.QutrawattsPerSquareMeter).WattsPerSquareMeter, QutrawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromTerawattsPerSquareMeter(wattpersquaremeter.TerawattsPerSquareMeter).WattsPerSquareMeter, TerawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromVettawattsPerSquareMeter(wattpersquaremeter.VettawattsPerSquareMeter).WattsPerSquareMeter, VettawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareFoot(wattpersquaremeter.WattsPerSquareFoot).WattsPerSquareMeter, WattsPerSquareFootTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareInch(wattpersquaremeter.WattsPerSquareInch).WattsPerSquareMeter, WattsPerSquareInchTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareMeter(wattpersquaremeter.WattsPerSquareMeter).WattsPerSquareMeter, WattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromYottawattsPerSquareMeter(wattpersquaremeter.YottawattsPerSquareMeter).WattsPerSquareMeter, YottawattsPerSquareMeterTolerance); AssertEx.EqualTolerance(1, HeatFlux.FromZettawattsPerSquareMeter(wattpersquaremeter.ZettawattsPerSquareMeter).WattsPerSquareMeter, ZettawattsPerSquareMeterTolerance); }
/// <inheritdoc cref="HeatFlux.FromBtusPerMinuteSquareFoot(UnitsNet.QuantityValue)" /> public static HeatFlux BtusPerMinuteSquareFoot <T>(this T value) => HeatFlux.FromBtusPerMinuteSquareFoot(Convert.ToDouble(value));
/// <inheritdoc cref="HeatFlux.FromBtusPerMinuteSquareFoot(double?)"/> public static HeatFlux?BtusPerMinuteSquareFoot(this double?value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
/// <inheritdoc cref="HeatFlux.FromBtusPerMinuteSquareFoot(double)"/> public static HeatFlux BtusPerMinuteSquareFoot(this long value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
/// <inheritdoc cref="HeatFlux.FromBtusPerMinuteSquareFoot(double?)"/> public static HeatFlux?BtusPerMinuteSquareFoot(this decimal?value) => HeatFlux.FromBtusPerMinuteSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value));
public static HeatFlux?BtusPerMinuteSquareFoot <T>(this T?value) where T : struct => HeatFlux.FromBtusPerMinuteSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void NumberToBtusPerMinuteSquareFootTest() => Assert.Equal(HeatFlux.FromBtusPerMinuteSquareFoot(2), 2.BtusPerMinuteSquareFoot());