Exemple #1
0
        public void DailyTime_CompareTo()
        {
            var zoo = new DailyTime(0, 0, 0);
            var foo = new DailyTime(1, 1, 1);
            var moo = new DailyTime(1, 1, 1);
            var bar = new DailyTime(2, 2, 2);

            Assert.True(foo.CompareTo(bar) == -1);
            Assert.True(foo.CompareTo(moo) == 0);
            Assert.True(foo.CompareTo(zoo) == 1);
        }
Exemple #2
0
        public void DailyTime_CompareToInvalid()
        {
            var did_throw = false;
            var zoo       = new DailyTime(0, 0, 0);
            var boo       = new object();

            try
            {
                zoo.CompareTo(boo);
            }
            catch (ArgumentException)
            {
                did_throw = true;
            }
            Assert.True(did_throw);
        }