コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 /// <inheritdoc cref="HeatFlux.FromBtusPerSecondSquareInch(UnitsNet.QuantityValue)" />
 public static HeatFlux BtusPerSecondSquareInch <T>(this T value) =>
 HeatFlux.FromBtusPerSecondSquareInch(Convert.ToDouble(value));
コード例 #4
0
 /// <inheritdoc cref="HeatFlux.FromBtusPerSecondSquareInch(double?)"/>
 public static HeatFlux?BtusPerSecondSquareInch(this decimal?value) => HeatFlux.FromBtusPerSecondSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value));
コード例 #5
0
 /// <inheritdoc cref="HeatFlux.FromBtusPerSecondSquareInch(double?)"/>
 public static HeatFlux?BtusPerSecondSquareInch(this float?value) => HeatFlux.FromBtusPerSecondSquareInch(value);
コード例 #6
0
 /// <inheritdoc cref="HeatFlux.FromBtusPerSecondSquareInch(double)"/>
 public static HeatFlux BtusPerSecondSquareInch(this double value) => HeatFlux.FromBtusPerSecondSquareInch(value);
コード例 #7
0
 public static HeatFlux?BtusPerSecondSquareInch <T>(this T?value) where T : struct => HeatFlux.FromBtusPerSecondSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value));
コード例 #8
0
 public void NumberToBtusPerSecondSquareInchTest() =>
 Assert.Equal(HeatFlux.FromBtusPerSecondSquareInch(2), 2.BtusPerSecondSquareInch());