public void Convert_ToInt32_EqualsValueAsSameType() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal((int)quantity.Value, Convert.ToInt32(quantity)); }
/// <inheritdoc cref="ReactivePower.FromVoltamperesReactive(UnitsNet.QuantityValue)" /> public static ReactivePower VoltamperesReactive <T>(this T value) => ReactivePower.FromVoltamperesReactive(Convert.ToDouble(value));
/// <inheritdoc cref="ReactivePower.FromVoltamperesReactive(UnitsNet.QuantityValue)" /> public static ReactivePower?VoltamperesReactive(this float?value) => ReactivePower.FromVoltamperesReactive(value);
public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(ReactivePower.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions))); }
public void GetHashCode_Equals() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(new { ReactivePower.QuantityType, quantity.Value, quantity.Unit }.GetHashCode(), quantity.GetHashCode()); }
public void Convert_ToUInt64_EqualsValueAsSameType() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity)); }
public void Convert_ChangeType_UnitType_EqualsUnit() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(ReactivePowerUnit))); }
public void CompareToThrowsOnNull() { ReactivePower voltamperereactive = ReactivePower.FromVoltamperesReactive(1); Assert.Throws <ArgumentNullException>(() => voltamperereactive.CompareTo(null)); }
public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException() { var v = ReactivePower.FromVoltamperesReactive(1); Assert.Throws <ArgumentOutOfRangeException>(() => v.Equals(ReactivePower.FromVoltamperesReactive(1), -1, ComparisonType.Relative)); }
public void ToBaseUnit_ReturnsQuantityWithBaseUnit() { var quantityInBaseUnit = ReactivePower.FromVoltamperesReactive(1).ToBaseUnit(); Assert.Equal(ReactivePower.BaseUnit, quantityInBaseUnit.Unit); }
public void CompareToThrowsOnTypeMismatch() { ReactivePower voltamperereactive = ReactivePower.FromVoltamperesReactive(1); Assert.Throws <ArgumentException>(() => voltamperereactive.CompareTo(new object())); }
public void FromVoltamperesReactive_WithNanValue_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => ReactivePower.FromVoltamperesReactive(double.NaN)); }
public void FromVoltamperesReactive_WithInfinityValue_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => ReactivePower.FromVoltamperesReactive(double.PositiveInfinity)); Assert.Throws <ArgumentException>(() => ReactivePower.FromVoltamperesReactive(double.NegativeInfinity)); }
/// <inheritdoc cref="ReactivePower.FromVoltamperesReactive(UnitsNet.QuantityValue)" /> public static ReactivePower?VoltamperesReactive(this decimal?value) => ReactivePower.FromVoltamperesReactive(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void Convert_ToSingle_EqualsValueAsSameType() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity)); }
public void EqualsReturnsFalseOnTypeMismatch() { ReactivePower voltamperereactive = ReactivePower.FromVoltamperesReactive(1); Assert.False(voltamperereactive.Equals(new object())); }
public void Convert_ToString_EqualsToString() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(quantity.ToString(), Convert.ToString(quantity)); }
public void EqualsReturnsFalseOnNull() { ReactivePower voltamperereactive = ReactivePower.FromVoltamperesReactive(1); Assert.False(voltamperereactive.Equals(null)); }
public void Convert_ChangeType_SelfType_EqualsSelf() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(ReactivePower))); }
public void ToString_NullArgs_ThrowsArgumentNullException() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Throws <ArgumentNullException>(() => quantity.ToString(null, "g", null)); }
public void Convert_ChangeType_QuantityType_EqualsQuantityType() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(QuantityType.ReactivePower, Convert.ChangeType(quantity, typeof(QuantityType))); }
public void ToString_NullProvider_EqualsCurrentUICulture() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal(quantity.ToString(CultureInfo.CurrentUICulture, "g"), quantity.ToString(null, "g")); }
public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Throws <InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter))); }
public void Convert_ToDateTime_ThrowsInvalidCastException() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Throws <InvalidCastException>(() => Convert.ToDateTime(quantity)); }
public void NegationOperator_ReturnsQuantity_WithNegatedValue(decimal value) { var quantity = ReactivePower.FromVoltamperesReactive(value); Assert.Equal(ReactivePower.FromVoltamperesReactive(-value), -quantity); }
public void Convert_ToDecimal_EqualsValueAsSameType() { var quantity = ReactivePower.FromVoltamperesReactive(1.0); Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity)); }
public void NumberToVoltamperesReactiveTest() => Assert.Equal(ReactivePower.FromVoltamperesReactive(2), 2.VoltamperesReactive());
/// <inheritdoc cref="ReactivePower.FromVoltamperesReactive(UnitsNet.QuantityValue)" /> public static ReactivePower VoltamperesReactive(this double value) => ReactivePower.FromVoltamperesReactive(value);