예제 #1
0
        public void CompareToWithUnequalObjectTypes()
        {
            var first  = new ValueAtTime <int>(new TimeMarker(10), 10);
            var second = new object();

            Assert.Throws <ArgumentException>(() => first.CompareTo(second));
        }
예제 #2
0
        public void CompareToOperatorWithEqualObjects()
        {
            var    first  = new ValueAtTime <int>(new TimeMarker(10), 10);
            object second = new ValueAtTime <int>(new TimeMarker(10), 10);

            Assert.AreEqual(0, first.CompareTo(second));
        }
예제 #3
0
        public void CompareToWithSmallerFirstObject()
        {
            var    first  = new ValueAtTime <int>(new TimeMarker(10), 10);
            object second = new ValueAtTime <int>(new TimeMarker(20), 10);

            Assert.IsTrue(first.CompareTo(second) < 0);
        }
예제 #4
0
        public void CompareToWithNullObject()
        {
            var    first  = new ValueAtTime <int>(new TimeMarker(10), 10);
            object second = null;

            Assert.AreEqual(1, first.CompareTo(second));
        }