コード例 #1
0
        public void CompareToWithSmallerFirstObject()
        {
            MockId first  = new MockId(10);
            object second = new MockId(11);

            Assert.IsTrue(first.CompareTo(second) < 0);
        }
コード例 #2
0
        public void CompareToWithUnequalObjectTypes()
        {
            MockId first  = new MockId(10);
            object second = new object();

            Assert.Throws <ArgumentException>(() => first.CompareTo(second));
        }
コード例 #3
0
        public void CompareToWithNullObject()
        {
            MockId first  = new MockId(10);
            object second = null;

            Assert.AreEqual(1, first.CompareTo(second));
        }
コード例 #4
0
        public void CompareToOperatorWithEqualObjects()
        {
            MockId first  = new MockId(10);
            object second = new MockId(10);

            Assert.AreEqual(0, first.CompareTo(second));
        }
コード例 #5
0
        public void SmallerThanOperatorWithFirstObjectSmaller()
        {
            MockId first  = new MockId(9);
            MockId second = new MockId(10);

            Assert.IsTrue(first < second);
        }
コード例 #6
0
        public void Clone()
        {
            MockId first  = new MockId(10);
            MockId second = first.Clone();

            Assert.AreEqual(first, second);
        }
コード例 #7
0
        public void SmallerThanOperatorWithEqualObjects()
        {
            MockId first  = new MockId(10);
            MockId second = new MockId(10);

            Assert.IsFalse(first < second);
        }
コード例 #8
0
        public void SmallerThanOperatorWithFirstObjectLarger()
        {
            MockId first  = new MockId(11);
            MockId second = new MockId(10);

            Assert.IsFalse(first < second);
        }
コード例 #9
0
        public void SmallerThanOperatorWithBothObjectsNull()
        {
            MockId first  = null;
            MockId second = null;

            Assert.IsFalse(first < second);
        }
コード例 #10
0
        public void SmallerThanOperatorWithSecondObjectNull()
        {
            MockId first  = new MockId(10);
            MockId second = null;

            Assert.IsFalse(first < second);
        }
コード例 #11
0
        public void LargerThanOperatorWithFirstObjectLarger()
        {
            MockId first  = new MockId(11);
            MockId second = new MockId(10);

            Assert.IsTrue(first > second);
        }
コード例 #12
0
        public void LargerThanOperatorWithSecondObjectNull()
        {
            MockId first  = new MockId(10);
            MockId second = null;

            Assert.IsTrue(first > second);
        }
コード例 #13
0
        public void LargerThanOperatorWithFirstObjectNull()
        {
            MockId first  = null;
            MockId second = new MockId(10);

            Assert.IsFalse(first > second);
        }