Esempio n. 1
0
        public void CompareToIsImplemented()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

            Assert.Equal(0, newtonpermeter.CompareTo(newtonpermeter));
            Assert.True(newtonpermeter.CompareTo(ForcePerLength.Zero) > 0);
            Assert.True(ForcePerLength.Zero.CompareTo(newtonpermeter) < 0);
        }
Esempio n. 2
0
        public void CompareToIsImplemented()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

            Assert.AreEqual(0, newtonpermeter.CompareTo(newtonpermeter));
            Assert.Greater(newtonpermeter.CompareTo(ForcePerLength.Zero), 0);
            Assert.Less(ForcePerLength.Zero.CompareTo(newtonpermeter), 0);
        }
Esempio n. 3
0
        public void CompareToThrowsOnNull()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            newtonpermeter.CompareTo(null);
        }
Esempio n. 4
0
        public void CompareToThrowsOnTypeMismatch()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            newtonpermeter.CompareTo(new object());
        }
Esempio n. 5
0
        public void CompareToThrowsOnNull()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

            Assert.Throws <ArgumentNullException>(() => newtonpermeter.CompareTo(null));
        }
Esempio n. 6
0
        public void CompareToThrowsOnTypeMismatch()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

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