/// <inheritdoc cref="HeatFlux.FromWattsPerSquareMeter(UnitsNet.QuantityValue)" />
 public static HeatFlux?WattsPerSquareMeter(this decimal?value) => HeatFlux.FromWattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
Esempio n. 2
0
        public void CompareToThrowsOnTypeMismatch()
        {
            HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);

            Assert.Throws <ArgumentException>(() => wattpersquaremeter.CompareTo(new object()));
        }
Esempio n. 3
0
        public void EqualsReturnsFalseOnTypeMismatch()
        {
            HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);

            Assert.False(wattpersquaremeter.Equals(new object()));
        }
Esempio n. 4
0
        public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(HeatFlux.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions)));
        }
Esempio n. 5
0
        public void GetHashCode_Equals()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(new { HeatFlux.QuantityType, quantity.Value, quantity.Unit }.GetHashCode(), quantity.GetHashCode());
        }
Esempio n. 6
0
        public void Convert_ToUInt64_EqualsValueAsSameType()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity));
        }
Esempio n. 7
0
        public void Convert_ChangeType_UnitType_EqualsUnit()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(HeatFluxUnit)));
        }
Esempio n. 8
0
        public void PowerDividedByHeatFluxEqualsArea()
        {
            Area area = Power.FromWatts(12) / HeatFlux.FromWattsPerSquareMeter(3);

            Assert.Equal(area, Area.FromSquareMeters(4));
        }
Esempio n. 9
0
        public void ToUnit()
        {
            var wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);

            var btuperhoursquarefootQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.BtuPerHourSquareFoot);

            AssertEx.EqualTolerance(BtusPerHourSquareFootInOneWattPerSquareMeter, (decimal)btuperhoursquarefootQuantity.Value, BtusPerHourSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerHourSquareFoot, btuperhoursquarefootQuantity.Unit);

            var btuperminutesquarefootQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.BtuPerMinuteSquareFoot);

            AssertEx.EqualTolerance(BtusPerMinuteSquareFootInOneWattPerSquareMeter, (decimal)btuperminutesquarefootQuantity.Value, BtusPerMinuteSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerMinuteSquareFoot, btuperminutesquarefootQuantity.Unit);

            var btupersecondsquarefootQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.BtuPerSecondSquareFoot);

            AssertEx.EqualTolerance(BtusPerSecondSquareFootInOneWattPerSquareMeter, (decimal)btupersecondsquarefootQuantity.Value, BtusPerSecondSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerSecondSquareFoot, btupersecondsquarefootQuantity.Unit);

            var btupersecondsquareinchQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.BtuPerSecondSquareInch);

            AssertEx.EqualTolerance(BtusPerSecondSquareInchInOneWattPerSquareMeter, (decimal)btupersecondsquareinchQuantity.Value, BtusPerSecondSquareInchTolerance);
            Assert.Equal(HeatFluxUnit.BtuPerSecondSquareInch, btupersecondsquareinchQuantity.Unit);

            var caloriepersecondsquarecentimeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.CaloriePerSecondSquareCentimeter);

            AssertEx.EqualTolerance(CaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter, (decimal)caloriepersecondsquarecentimeterQuantity.Value, CaloriesPerSecondSquareCentimeterTolerance);
            Assert.Equal(HeatFluxUnit.CaloriePerSecondSquareCentimeter, caloriepersecondsquarecentimeterQuantity.Unit);

            var centiwattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.CentiwattPerSquareMeter);

            AssertEx.EqualTolerance(CentiwattsPerSquareMeterInOneWattPerSquareMeter, (decimal)centiwattpersquaremeterQuantity.Value, CentiwattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.CentiwattPerSquareMeter, centiwattpersquaremeterQuantity.Unit);

            var deciwattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.DeciwattPerSquareMeter);

            AssertEx.EqualTolerance(DeciwattsPerSquareMeterInOneWattPerSquareMeter, (decimal)deciwattpersquaremeterQuantity.Value, DeciwattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.DeciwattPerSquareMeter, deciwattpersquaremeterQuantity.Unit);

            var kilocalorieperhoursquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.KilocaloriePerHourSquareMeter);

            AssertEx.EqualTolerance(KilocaloriesPerHourSquareMeterInOneWattPerSquareMeter, (decimal)kilocalorieperhoursquaremeterQuantity.Value, KilocaloriesPerHourSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.KilocaloriePerHourSquareMeter, kilocalorieperhoursquaremeterQuantity.Unit);

            var kilocaloriepersecondsquarecentimeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.KilocaloriePerSecondSquareCentimeter);

            AssertEx.EqualTolerance(KilocaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter, (decimal)kilocaloriepersecondsquarecentimeterQuantity.Value, KilocaloriesPerSecondSquareCentimeterTolerance);
            Assert.Equal(HeatFluxUnit.KilocaloriePerSecondSquareCentimeter, kilocaloriepersecondsquarecentimeterQuantity.Unit);

            var kilowattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.KilowattPerSquareMeter);

            AssertEx.EqualTolerance(KilowattsPerSquareMeterInOneWattPerSquareMeter, (decimal)kilowattpersquaremeterQuantity.Value, KilowattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.KilowattPerSquareMeter, kilowattpersquaremeterQuantity.Unit);

            var microwattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.MicrowattPerSquareMeter);

            AssertEx.EqualTolerance(MicrowattsPerSquareMeterInOneWattPerSquareMeter, (decimal)microwattpersquaremeterQuantity.Value, MicrowattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.MicrowattPerSquareMeter, microwattpersquaremeterQuantity.Unit);

            var milliwattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.MilliwattPerSquareMeter);

            AssertEx.EqualTolerance(MilliwattsPerSquareMeterInOneWattPerSquareMeter, (decimal)milliwattpersquaremeterQuantity.Value, MilliwattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.MilliwattPerSquareMeter, milliwattpersquaremeterQuantity.Unit);

            var nanowattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.NanowattPerSquareMeter);

            AssertEx.EqualTolerance(NanowattsPerSquareMeterInOneWattPerSquareMeter, (decimal)nanowattpersquaremeterQuantity.Value, NanowattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.NanowattPerSquareMeter, nanowattpersquaremeterQuantity.Unit);

            var poundforceperfootsecondQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.PoundForcePerFootSecond);

            AssertEx.EqualTolerance(PoundsForcePerFootSecondInOneWattPerSquareMeter, (decimal)poundforceperfootsecondQuantity.Value, PoundsForcePerFootSecondTolerance);
            Assert.Equal(HeatFluxUnit.PoundForcePerFootSecond, poundforceperfootsecondQuantity.Unit);

            var poundpersecondcubedQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.PoundPerSecondCubed);

            AssertEx.EqualTolerance(PoundsPerSecondCubedInOneWattPerSquareMeter, (decimal)poundpersecondcubedQuantity.Value, PoundsPerSecondCubedTolerance);
            Assert.Equal(HeatFluxUnit.PoundPerSecondCubed, poundpersecondcubedQuantity.Unit);

            var wattpersquarefootQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.WattPerSquareFoot);

            AssertEx.EqualTolerance(WattsPerSquareFootInOneWattPerSquareMeter, (decimal)wattpersquarefootQuantity.Value, WattsPerSquareFootTolerance);
            Assert.Equal(HeatFluxUnit.WattPerSquareFoot, wattpersquarefootQuantity.Unit);

            var wattpersquareinchQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.WattPerSquareInch);

            AssertEx.EqualTolerance(WattsPerSquareInchInOneWattPerSquareMeter, (decimal)wattpersquareinchQuantity.Value, WattsPerSquareInchTolerance);
            Assert.Equal(HeatFluxUnit.WattPerSquareInch, wattpersquareinchQuantity.Unit);

            var wattpersquaremeterQuantity = wattpersquaremeter.ToUnit(HeatFluxUnit.WattPerSquareMeter);

            AssertEx.EqualTolerance(WattsPerSquareMeterInOneWattPerSquareMeter, (decimal)wattpersquaremeterQuantity.Value, WattsPerSquareMeterTolerance);
            Assert.Equal(HeatFluxUnit.WattPerSquareMeter, wattpersquaremeterQuantity.Unit);
        }
Esempio n. 10
0
        public void PowerDividedByAreaEqualsHeatFlux()
        {
            HeatFlux heatFlux = Power.FromWatts(12) / Area.FromSquareMeters(3);

            Assert.Equal(heatFlux, HeatFlux.FromWattsPerSquareMeter(4));
        }
Esempio n. 11
0
        public void HeatFluxTimesAreaEqualsPower()
        {
            Power power = HeatFlux.FromWattsPerSquareMeter(3) * Area.FromSquareMeters(4);

            Assert.Equal(power, Power.FromWatts(12));
        }
Esempio n. 12
0
        public void FromWattsPerSquareMeter_WithNanValue_CreateQuantityAndAffectNaNValue()
        {
            var nanQuantity = HeatFlux.FromWattsPerSquareMeter(double.NaN);

            Assert.True(double.IsNaN(nanQuantity.Value));
        }
Esempio n. 13
0
 public void FromWattsPerSquareMeter_WithNanValue_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => HeatFlux.FromWattsPerSquareMeter(double.NaN));
 }
Esempio n. 14
0
 public void FromWattsPerSquareMeter_WithInfinityValue_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => HeatFlux.FromWattsPerSquareMeter(double.PositiveInfinity));
     Assert.Throws <ArgumentException>(() => HeatFlux.FromWattsPerSquareMeter(double.NegativeInfinity));
 }
Esempio n. 15
0
        public void Convert_ToSingle_EqualsValueAsSameType()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity));
        }
Esempio n. 16
0
        public void ToBaseUnit_ReturnsQuantityWithBaseUnit()
        {
            var quantityInBaseUnit = HeatFlux.FromWattsPerSquareMeter(1).ToBaseUnit();

            Assert.Equal(HeatFlux.BaseUnit, quantityInBaseUnit.Unit);
        }
Esempio n. 17
0
        public void Convert_ToString_EqualsToString()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(quantity.ToString(), Convert.ToString(quantity));
        }
Esempio n. 18
0
        public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException()
        {
            var v = HeatFlux.FromWattsPerSquareMeter(1);

            Assert.Throws <ArgumentOutOfRangeException>(() => v.Equals(HeatFlux.FromWattsPerSquareMeter(1), -1, ComparisonType.Relative));
        }
Esempio n. 19
0
        public void Convert_ChangeType_SelfType_EqualsSelf()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(HeatFlux)));
        }
Esempio n. 20
0
        public void ToString_NullArgs_ThrowsArgumentNullException()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Throws <ArgumentNullException>(() => quantity.ToString(null, "g", null));
        }
Esempio n. 21
0
        public void Convert_ChangeType_QuantityType_EqualsQuantityType()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(QuantityType.HeatFlux, Convert.ChangeType(quantity, typeof(QuantityType)));
        }
Esempio n. 22
0
        public void ToString_NullProvider_EqualsCurrentUICulture()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal(quantity.ToString(CultureInfo.CurrentUICulture, "g"), quantity.ToString(null, "g"));
        }
Esempio n. 23
0
        public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Throws <InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter)));
        }
Esempio n. 24
0
        public void Convert_ToDateTime_ThrowsInvalidCastException()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Throws <InvalidCastException>(() => Convert.ToDateTime(quantity));
        }
Esempio n. 25
0
        public void NegationOperator_ReturnsQuantity_WithNegatedValue(decimal value)
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(value);

            Assert.Equal(HeatFlux.FromWattsPerSquareMeter(-value), -quantity);
        }
Esempio n. 26
0
        public void Convert_ToDecimal_EqualsValueAsSameType()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity));
        }
Esempio n. 27
0
        public void CompareToThrowsOnNull()
        {
            HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);

            Assert.Throws <ArgumentNullException>(() => wattpersquaremeter.CompareTo(null));
        }
Esempio n. 28
0
        public void Convert_ToInt32_EqualsValueAsSameType()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

            Assert.Equal((int)quantity.Value, Convert.ToInt32(quantity));
        }
Esempio n. 29
0
        public void EqualsReturnsFalseOnNull()
        {
            HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);

            Assert.False(wattpersquaremeter.Equals(null));
        }
 /// <inheritdoc cref="HeatFlux.FromWattsPerSquareMeter(UnitsNet.QuantityValue)" />
 public static HeatFlux WattsPerSquareMeter(this decimal value) => HeatFlux.FromWattsPerSquareMeter(Convert.ToDouble(value));