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

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

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

            Assert.Equal(HeatFlux.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions)));
        }
Exemplo 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());
        }
Exemplo n.º 6
0
        public void Convert_ToUInt64_EqualsValueAsSameType()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

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

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

            Assert.Equal(area, Area.FromSquareMeters(4));
        }
Exemplo 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);
        }
Exemplo n.º 10
0
        public void PowerDividedByAreaEqualsHeatFlux()
        {
            HeatFlux heatFlux = Power.FromWatts(12) / Area.FromSquareMeters(3);

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

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

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

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

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

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

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

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

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

            Assert.Equal(QuantityType.HeatFlux, Convert.ChangeType(quantity, typeof(QuantityType)));
        }
Exemplo 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"));
        }
Exemplo n.º 23
0
        public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException()
        {
            var quantity = HeatFlux.FromWattsPerSquareMeter(1.0);

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

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

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

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

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

            Assert.Equal((int)quantity.Value, Convert.ToInt32(quantity));
        }
Exemplo 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));