public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerHourSquareFoot).BtusPerHourSquareFoot, BtusPerHourSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerMinuteSquareFoot).BtusPerMinuteSquareFoot, BtusPerMinuteSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareFoot).BtusPerSecondSquareFoot, BtusPerSecondSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareInch).BtusPerSecondSquareInch, BtusPerSecondSquareInchTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.CaloriePerSecondSquareCentimeter).CaloriesPerSecondSquareCentimeter, CaloriesPerSecondSquareCentimeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.CentiwattPerSquareMeter).CentiwattsPerSquareMeter, CentiwattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.DecawattPerSquareMeter).DecawattsPerSquareMeter, DecawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.DeciwattPerSquareMeter).DeciwattsPerSquareMeter, DeciwattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.ExawattPerSquareMeter).ExawattsPerSquareMeter, ExawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.FemtowattPerSquareMeter).FemtowattsPerSquareMeter, FemtowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.GigawattPerSquareMeter).GigawattsPerSquareMeter, GigawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.HectowattPerSquareMeter).HectowattsPerSquareMeter, HectowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilocaloriePerHourSquareMeter).KilocaloriesPerHourSquareMeter, KilocaloriesPerHourSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter).KilocaloriesPerSecondSquareCentimeter, KilocaloriesPerSecondSquareCentimeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilowattPerSquareMeter).KilowattsPerSquareMeter, KilowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MegawattPerSquareMeter).MegawattsPerSquareMeter, MegawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MicrowattPerSquareMeter).MicrowattsPerSquareMeter, MicrowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MilliwattPerSquareMeter).MilliwattsPerSquareMeter, MilliwattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.NanowattPerSquareMeter).NanowattsPerSquareMeter, NanowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.PetawattPerSquareMeter).PetawattsPerSquareMeter, PetawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.PicowattPerSquareMeter).PicowattsPerSquareMeter, PicowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.PoundForcePerFootSecond).PoundsForcePerFootSecond, PoundsForcePerFootSecondTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.PoundPerSecondCubed).PoundsPerSecondCubed, PoundsPerSecondCubedTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.QutrawattPerSquareMeter).QutrawattsPerSquareMeter, QutrawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.TerawattPerSquareMeter).TerawattsPerSquareMeter, TerawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.VettawattPerSquareMeter).VettawattsPerSquareMeter, VettawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareFoot).WattsPerSquareFoot, WattsPerSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareInch).WattsPerSquareInch, WattsPerSquareInchTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareMeter).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.YottawattPerSquareMeter).YottawattsPerSquareMeter, YottawattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.ZettawattPerSquareMeter).ZettawattsPerSquareMeter, ZettawattsPerSquareMeterTolerance);
 }
 public void FromValueAndUnit()
 {
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerHourSquareFoot).BtusPerHourSquareFoot, BtusPerHourSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerMinuteSquareFoot).BtusPerMinuteSquareFoot, BtusPerMinuteSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareFoot).BtusPerSecondSquareFoot, BtusPerSecondSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareInch).BtusPerSecondSquareInch, BtusPerSecondSquareInchTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.CaloriePerSecondSquareCentimeter).CaloriesPerSecondSquareCentimeter, CaloriesPerSecondSquareCentimeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.CentiwattPerSquareMeter).CentiwattsPerSquareMeter, CentiwattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.DeciwattPerSquareMeter).DeciwattsPerSquareMeter, DeciwattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilocaloriePerHourSquareMeter).KilocaloriesPerHourSquareMeter, KilocaloriesPerHourSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter).KilocaloriesPerSecondSquareCentimeter, KilocaloriesPerSecondSquareCentimeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilowattPerSquareMeter).KilowattsPerSquareMeter, KilowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MicrowattPerSquareMeter).MicrowattsPerSquareMeter, MicrowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MilliwattPerSquareMeter).MilliwattsPerSquareMeter, MilliwattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.NanowattPerSquareMeter).NanowattsPerSquareMeter, NanowattsPerSquareMeterTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareFoot).WattsPerSquareFoot, WattsPerSquareFootTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareInch).WattsPerSquareInch, WattsPerSquareInchTolerance);
     AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareMeter).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
 }
Esempio n. 3
0
        public void From_ValueAndUnit_ReturnsQuantityWithSameValueAndUnit()
        {
            var quantity00 = HeatFlux.From(1, HeatFluxUnit.BtuPerHourSquareFoot);

            AssertEx.EqualTolerance(1, quantity00.BtusPerHourSquareFoot, BtusPerHourSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerHourSquareFoot, quantity00.Unit);

            var quantity01 = HeatFlux.From(1, HeatFluxUnit.BtuPerMinuteSquareFoot);

            AssertEx.EqualTolerance(1, quantity01.BtusPerMinuteSquareFoot, BtusPerMinuteSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerMinuteSquareFoot, quantity01.Unit);

            var quantity02 = HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareFoot);

            AssertEx.EqualTolerance(1, quantity02.BtusPerSecondSquareFoot, BtusPerSecondSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerSecondSquareFoot, quantity02.Unit);

            var quantity03 = HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareInch);

            AssertEx.EqualTolerance(1, quantity03.BtusPerSecondSquareInch, BtusPerSecondSquareInchTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerSecondSquareInch, quantity03.Unit);

            var quantity04 = HeatFlux.From(1, HeatFluxUnit.CaloriePerSecondSquareCentimeter);

            AssertEx.EqualTolerance(1, quantity04.CaloriesPerSecondSquareCentimeter, CaloriesPerSecondSquareCentimeterTolerance);
            Assert.Equal(HeatFluxUnit.CaloriePerSecondSquareCentimeter, quantity04.Unit);

            var quantity05 = HeatFlux.From(1, HeatFluxUnit.CentiwattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity05.CentiwattsPerSquareMeter, CentiwattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.CentiwattPerSquareMeter, quantity05.Unit);

            var quantity06 = HeatFlux.From(1, HeatFluxUnit.DeciwattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity06.DeciwattsPerSquareMeter, DeciwattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.DeciwattPerSquareMeter, quantity06.Unit);

            var quantity07 = HeatFlux.From(1, HeatFluxUnit.KilocaloriePerHourSquareMeter);

            AssertEx.EqualTolerance(1, quantity07.KilocaloriesPerHourSquareMeter, KilocaloriesPerHourSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.KilocaloriePerHourSquareMeter, quantity07.Unit);

            var quantity08 = HeatFlux.From(1, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter);

            AssertEx.EqualTolerance(1, quantity08.KilocaloriesPerSecondSquareCentimeter, KilocaloriesPerSecondSquareCentimeterTolerance);
            Assert.Equal(HeatFluxUnit.KilocaloriePerSecondSquareCentimeter, quantity08.Unit);

            var quantity09 = HeatFlux.From(1, HeatFluxUnit.KilowattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity09.KilowattsPerSquareMeter, KilowattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.KilowattPerSquareMeter, quantity09.Unit);

            var quantity10 = HeatFlux.From(1, HeatFluxUnit.MicrowattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity10.MicrowattsPerSquareMeter, MicrowattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.MicrowattPerSquareMeter, quantity10.Unit);

            var quantity11 = HeatFlux.From(1, HeatFluxUnit.MilliwattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity11.MilliwattsPerSquareMeter, MilliwattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.MilliwattPerSquareMeter, quantity11.Unit);

            var quantity12 = HeatFlux.From(1, HeatFluxUnit.NanowattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity12.NanowattsPerSquareMeter, NanowattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.NanowattPerSquareMeter, quantity12.Unit);

            var quantity13 = HeatFlux.From(1, HeatFluxUnit.PoundForcePerFootSecond);

            AssertEx.EqualTolerance(1, quantity13.PoundsForcePerFootSecond, PoundsForcePerFootSecondTolerance);
            Assert.Equal(HeatFluxUnit.PoundForcePerFootSecond, quantity13.Unit);

            var quantity14 = HeatFlux.From(1, HeatFluxUnit.PoundPerSecondCubed);

            AssertEx.EqualTolerance(1, quantity14.PoundsPerSecondCubed, PoundsPerSecondCubedTolerance);
            Assert.Equal(HeatFluxUnit.PoundPerSecondCubed, quantity14.Unit);

            var quantity15 = HeatFlux.From(1, HeatFluxUnit.WattPerSquareFoot);

            AssertEx.EqualTolerance(1, quantity15.WattsPerSquareFoot, WattsPerSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.WattPerSquareFoot, quantity15.Unit);

            var quantity16 = HeatFlux.From(1, HeatFluxUnit.WattPerSquareInch);

            AssertEx.EqualTolerance(1, quantity16.WattsPerSquareInch, WattsPerSquareInchTolerance);
            Assert.Equal(HeatFluxUnit.WattPerSquareInch, quantity16.Unit);

            var quantity17 = HeatFlux.From(1, HeatFluxUnit.WattPerSquareMeter);

            AssertEx.EqualTolerance(1, quantity17.WattsPerSquareMeter, WattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.WattPerSquareMeter, quantity17.Unit);
        }