public void Convert_ToSingle_EqualsValueAsSameType() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal((float)quantity.Value, Convert.ToSingle(quantity)); }
/// <inheritdoc cref="AreaMomentOfInertia.FromCentimetersToTheFourth(double?)"/> public static AreaMomentOfInertia?CentimetersToTheFourth(this float?value) => AreaMomentOfInertia.FromCentimetersToTheFourth(value);
/// <inheritdoc cref="AreaMomentOfInertia.FromCentimetersToTheFourth(double?)"/> public static AreaMomentOfInertia?CentimetersToTheFourth(this decimal?value) => AreaMomentOfInertia.FromCentimetersToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="AreaMomentOfInertia.FromMetersToTheFourth(double?)"/> public static AreaMomentOfInertia?MetersToTheFourth(this long?value) => AreaMomentOfInertia.FromMetersToTheFourth(value);
/// <inheritdoc cref="AreaMomentOfInertia.FromMillimetersToTheFourth(double)"/> public static AreaMomentOfInertia MillimetersToTheFourth(this float value) => AreaMomentOfInertia.FromMillimetersToTheFourth(value);
/// <inheritdoc cref="AreaMomentOfInertia.FromFeetToTheFourth(double?)"/> public static AreaMomentOfInertia?FeetToTheFourth(this float?value) => AreaMomentOfInertia.FromFeetToTheFourth(value);
/// <inheritdoc cref="AreaMomentOfInertia.FromInchesToTheFourth(double?)"/> public static AreaMomentOfInertia?InchesToTheFourth(this float?value) => AreaMomentOfInertia.FromInchesToTheFourth(value);
public void Convert_ChangeType_BaseDimensions_EqualsBaseDimensions() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal(AreaMomentOfInertia.BaseDimensions, Convert.ChangeType(quantity, typeof(BaseDimensions))); }
public void Convert_ChangeType_InvalidType_ThrowsInvalidCastException() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Throws <InvalidCastException>(() => Convert.ChangeType(quantity, typeof(QuantityFormatter))); }
public void Convert_ChangeType_UnitType_EqualsUnit() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal(quantity.Unit, Convert.ChangeType(quantity, typeof(AreaMomentOfInertiaUnit))); }
public void Convert_ChangeType_QuantityInfo_EqualsQuantityInfo() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal(AreaMomentOfInertia.Info, Convert.ChangeType(quantity, typeof(QuantityInfo))); }
public void Convert_ChangeType_SelfType_EqualsSelf() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal(quantity, Convert.ChangeType(quantity, typeof(AreaMomentOfInertia))); }
public void Convert_ToUInt64_EqualsValueAsSameType() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal((ulong)quantity.Value, Convert.ToUInt64(quantity)); }
public void Convert_ToString_EqualsToString() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal(quantity.ToString(), Convert.ToString(quantity)); }
public void AreaMomentOfInertiaDividedByLengthEqualsVolume() { Volume volume = AreaMomentOfInertia.FromMetersToTheFourth(20) / Length.FromMeters(10); Assert.Equal(Volume.FromCubicMeters(2), volume); }
public void GetHashCode_Equals() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal(new { AreaMomentOfInertia.Info.Name, quantity.Value, quantity.Unit }.GetHashCode(), quantity.GetHashCode()); }
/// <inheritdoc cref="AreaMomentOfInertia.FromFeetToTheFourth(double)"/> public static AreaMomentOfInertia FeetToTheFourth(this double value) => AreaMomentOfInertia.FromFeetToTheFourth(value);
public void NegationOperator_ReturnsQuantity_WithNegatedValue(double value) { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(value); Assert.Equal(AreaMomentOfInertia.FromMetersToTheFourth(-value), -quantity); }
/// <inheritdoc cref="AreaMomentOfInertia.FromInchesToTheFourth(double)"/> public static AreaMomentOfInertia InchesToTheFourth(this double value) => AreaMomentOfInertia.FromInchesToTheFourth(value);
public void ArithmeticOperators() { AreaMomentOfInertia v = AreaMomentOfInertia.FromMetersToTheFourth(1); AssertEx.EqualTolerance(-1, -v.MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(2, (AreaMomentOfInertia.FromMetersToTheFourth(3) - v).MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(2, (v + v).MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(10, (v * 10).MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(10, (10 * v).MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(2, (AreaMomentOfInertia.FromMetersToTheFourth(10) / 5).MetersToTheFourth, MetersToTheFourthTolerance); AssertEx.EqualTolerance(2, AreaMomentOfInertia.FromMetersToTheFourth(10) / AreaMomentOfInertia.FromMetersToTheFourth(5), MetersToTheFourthTolerance); }
/// <inheritdoc cref="AreaMomentOfInertia.FromInchesToTheFourth(double)"/> public static AreaMomentOfInertia InchesToTheFourth(this decimal value) => AreaMomentOfInertia.FromInchesToTheFourth(Convert.ToDouble(value));
public void CompareToThrowsOnTypeMismatch() { AreaMomentOfInertia metertothefourth = AreaMomentOfInertia.FromMetersToTheFourth(1); Assert.Throws <ArgumentException>(() => metertothefourth.CompareTo(new object())); }
/// <inheritdoc cref="AreaMomentOfInertia.FromMillimetersToTheFourth(double?)"/> public static AreaMomentOfInertia?MillimetersToTheFourth(this double?value) => AreaMomentOfInertia.FromMillimetersToTheFourth(value);
public void CompareToThrowsOnNull() { AreaMomentOfInertia metertothefourth = AreaMomentOfInertia.FromMetersToTheFourth(1); Assert.Throws <ArgumentNullException>(() => metertothefourth.CompareTo(null)); }
/// <inheritdoc cref="AreaMomentOfInertia.FromCentimetersToTheFourth(double)"/> public static AreaMomentOfInertia CentimetersToTheFourth(this double value) => AreaMomentOfInertia.FromCentimetersToTheFourth(value);
public void EqualsReturnsFalseOnTypeMismatch() { AreaMomentOfInertia metertothefourth = AreaMomentOfInertia.FromMetersToTheFourth(1); Assert.False(metertothefourth.Equals(new object())); }
/// <inheritdoc cref="AreaMomentOfInertia.FromCentimetersToTheFourth(double)"/> public static AreaMomentOfInertia CentimetersToTheFourth(this decimal value) => AreaMomentOfInertia.FromCentimetersToTheFourth(Convert.ToDouble(value));
public void EqualsReturnsFalseOnNull() { AreaMomentOfInertia metertothefourth = AreaMomentOfInertia.FromMetersToTheFourth(1); Assert.False(metertothefourth.Equals(null)); }
/// <inheritdoc cref="AreaMomentOfInertia.FromDecimetersToTheFourth(double)"/> public static AreaMomentOfInertia DecimetersToTheFourth(this int value) => AreaMomentOfInertia.FromDecimetersToTheFourth(value);
public void Convert_ToInt16_EqualsValueAsSameType() { var quantity = AreaMomentOfInertia.FromMetersToTheFourth(1.0); Assert.Equal((short)quantity.Value, Convert.ToInt16(quantity)); }