Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #3
0
        public void CompareToThrowsOnNull()
        {
            ForcePerLength newtonpermeter = ForcePerLength.FromNewtonsPerMeter(1);

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

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

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

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