Exemple #1
0
        public void CompareToIsImplemented()
        {
            MassMomentOfInertia kilogramsquaremeter = MassMomentOfInertia.FromKilogramSquareMeters(1);

            Assert.Equal(0, kilogramsquaremeter.CompareTo(kilogramsquaremeter));
            Assert.True(kilogramsquaremeter.CompareTo(MassMomentOfInertia.Zero) > 0);
            Assert.True(MassMomentOfInertia.Zero.CompareTo(kilogramsquaremeter) < 0);
        }
Exemple #2
0
        public void CompareToThrowsOnNull()
        {
            MassMomentOfInertia kilogramsquaremeter = MassMomentOfInertia.FromKilogramSquareMeters(1);

            Assert.Throws <ArgumentNullException>(() => kilogramsquaremeter.CompareTo(null));
        }
Exemple #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            MassMomentOfInertia kilogramsquaremeter = MassMomentOfInertia.FromKilogramSquareMeters(1);

            Assert.Throws <ArgumentException>(() => kilogramsquaremeter.CompareTo(new object()));
        }