Beispiel #1
0
        public void Equal(int d1, int h1, int m1, int d2, int h2, int m2)
        {
            var first  = new DayHourMinute(d1, h1, m1);
            var second = new DayHourMinute(d2, h2, m1);

            Assert.Equal(first, second);
            Assert.True(first == second);
            Assert.True(second == first);
            Assert.False(first != second);
            Assert.False(second != first);
            Assert.True(first <= second);
            Assert.True(first >= second);
            Assert.True(second <= first);
            Assert.True(second >= first);
            Assert.False(first < second);
            Assert.False(first > second);
            Assert.False(second < first);
            Assert.False(second > first);
            Assert.True(first.Equals(second));
            Assert.True(second.Equals(first));
            Assert.True(Object.Equals(first, second));
            Assert.True(Object.Equals(second, first));
            Assert.True(((object)first).Equals(second));
            Assert.True(((object)second).Equals(first));
            Assert.Equal(first.GetHashCode(), second.GetHashCode());
            Assert.Equal(0, first.CompareTo(second));
            Assert.Equal(0, second.CompareTo(first));
        }
Beispiel #2
0
        public void Greater(int d1, int h1, int m1, int d2, int h2, int m2)
        {
            var first  = new DayHourMinute(d1, h1, m1);
            var second = new DayHourMinute(d2, h2, m2);

            Assert.True(first.CompareTo(second) > 0);
            Assert.True(first > second);
            Assert.True(first >= second);
            Assert.True(((IComparable)first).CompareTo(second) > 0);
        }