public void EqualsReturnsFalseOnTypeMismatch() { PressureChangeRate pascalpersecond = PressureChangeRate.FromPascalsPerSecond(1); Assert.False(pascalpersecond.Equals(new object())); }
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate AtmospheresPerSecond(this decimal value) => PressureChangeRate.FromAtmospheresPerSecond(Convert.ToDouble(value));
/// <inheritdoc cref="PressureChangeRate.FromKilopascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate?KilopascalsPerSecond(this long?value) => PressureChangeRate.FromKilopascalsPerSecond(value);
/// <inheritdoc cref="PressureChangeRate.FromPascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate?PascalsPerSecond(this float?value) => PressureChangeRate.FromPascalsPerSecond(value);
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate AtmospheresPerSecond(this double value) => PressureChangeRate.FromAtmospheresPerSecond(value);
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate?MegapascalsPerSecond(this double?value) => PressureChangeRate.FromMegapascalsPerSecond(value);
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate?MegapascalsPerSecond(this decimal?value) => PressureChangeRate.FromMegapascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void Convert_ToInt16_EqualsValueAsSameType() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal((short)quantity.Value, Convert.ToInt16(quantity)); }
public void Convert_ToSingle_EqualsValueAsSameType() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity)); }
public void Convert_ToDateTime_ThrowsInvalidCastException() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Throws <InvalidCastException>(() => Convert.ToDateTime(quantity)); }
public void Convert_ToDecimal_EqualsValueAsSameType() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal((decimal)quantity.Value, Convert.ToDecimal(quantity)); }
public void ToString_NullProvider_EqualsCurrentUICulture() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(quantity.ToString(CultureInfo.CurrentUICulture, "g"), quantity.ToString(null, "g")); }
public void ToString_NullArgs_ThrowsArgumentNullException() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Throws <ArgumentNullException>(() => quantity.ToString(null, "g", null)); }
public void EqualsReturnsFalseOnNull() { PressureChangeRate pascalpersecond = PressureChangeRate.FromPascalsPerSecond(1); Assert.False(pascalpersecond.Equals(null)); }
public void GetHashCode_Equals() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(new { PressureChangeRate.QuantityType, quantity.Value, quantity.Unit }.GetHashCode(), quantity.GetHashCode()); }
public void Convert_ToString_EqualsToString() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(quantity.ToString(), Convert.ToString(quantity)); }
public void NegationOperator_ReturnsQuantity_WithNegatedValue(double value) { var quantity = PressureChangeRate.FromPascalsPerSecond(value); Assert.Equal(PressureChangeRate.FromPascalsPerSecond(-value), -quantity); }
public void Convert_ToUInt64_EqualsValueAsSameType() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity)); }
/// <inheritdoc cref="PressureChangeRate.FromMegapascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate MegapascalsPerSecond(this float value) => PressureChangeRate.FromMegapascalsPerSecond(value);
public void Convert_ChangeType_SelfType_EqualsSelf() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(PressureChangeRate))); }
/// <inheritdoc cref="PressureChangeRate.FromPascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate PascalsPerSecond(this long value) => PressureChangeRate.FromPascalsPerSecond(value);
public void Convert_ChangeType_UnitType_EqualsUnit() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(PressureChangeRateUnit))); }
/// <inheritdoc cref="PressureChangeRate.FromPascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate PascalsPerSecond(this decimal value) => PressureChangeRate.FromPascalsPerSecond(Convert.ToDouble(value));
public void Convert_ChangeType_QuantityType_EqualsQuantityType() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(QuantityType.PressureChangeRate, Convert.ChangeType(quantity, typeof(QuantityType))); }
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate?AtmospheresPerSecond(this float?value) => PressureChangeRate.FromAtmospheresPerSecond(value);
public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Equal(PressureChangeRate.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions))); }
/// <inheritdoc cref="PressureChangeRate.FromAtmospheresPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate?AtmospheresPerSecond(this decimal?value) => PressureChangeRate.FromAtmospheresPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() { var quantity = PressureChangeRate.FromPascalsPerSecond(1.0); Assert.Throws <InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter))); }
/// <inheritdoc cref="PressureChangeRate.FromKilopascalsPerSecond(UnitsNet.QuantityValue)" /> public static PressureChangeRate KilopascalsPerSecond(this double value) => PressureChangeRate.FromKilopascalsPerSecond(value);
public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException() { var v = PressureChangeRate.FromPascalsPerSecond(1); Assert.Throws <ArgumentOutOfRangeException>(() => v.Equals(PressureChangeRate.FromPascalsPerSecond(1), -1, ComparisonType.Relative)); }