public void ToString_NullArgs_ThrowsArgumentNullException() { var quantity = VitaminA.FromInternationalUnits(1.0); Assert.Throws <ArgumentNullException>(() => quantity.ToString(null, "g", null)); }
public void EqualsReturnsFalseOnTypeMismatch() { VitaminA internationalunit = VitaminA.FromInternationalUnits(1); Assert.False(internationalunit.Equals(new object())); }
public void EqualsReturnsFalseOnNull() { VitaminA internationalunit = VitaminA.FromInternationalUnits(1); Assert.False(internationalunit.Equals(null)); }
public void CompareToThrowsOnNull() { VitaminA internationalunit = VitaminA.FromInternationalUnits(1); Assert.Throws <ArgumentNullException>(() => internationalunit.CompareTo(null)); }
public void Equals_NegativeRelativeTolerance_ThrowsArgumentOutOfRangeException() { var v = VitaminA.FromInternationalUnits(1); Assert.Throws <ArgumentOutOfRangeException>(() => v.Equals(VitaminA.FromInternationalUnits(1), -1, ComparisonType.Relative)); }
public void CompareToThrowsOnTypeMismatch() { VitaminA internationalunit = VitaminA.FromInternationalUnits(1); Assert.Throws <ArgumentException>(() => internationalunit.CompareTo(new object())); }
public void ConversionRoundTrip() { VitaminA internationalunit = VitaminA.FromInternationalUnits(1); AssertEx.EqualTolerance(1, VitaminA.FromInternationalUnits(internationalunit.InternationalUnits).InternationalUnits, InternationalUnitsTolerance); }
public void As() { var internationalunit = VitaminA.FromInternationalUnits(1); AssertEx.EqualTolerance(InternationalUnitsInOneInternationalUnit, internationalunit.As(VitaminAUnit.InternationalUnit), InternationalUnitsTolerance); }
public void FromInternationalUnits_WithNanValue_CreateQuantityAndAffectNaNValue() { var nanQuantity = VitaminA.FromInternationalUnits(double.NaN); Assert.True(double.IsNaN(nanQuantity.Value)); }
public void InternationalUnitToVitaminAUnits() { VitaminA internationalunit = VitaminA.FromInternationalUnits(1); AssertEx.EqualTolerance(InternationalUnitsInOneInternationalUnit, internationalunit.InternationalUnits, InternationalUnitsTolerance); }