Example #1
0
        public void LargerThanOperatorWithFirstObjectNull()
        {
            ImportRegistrationId first  = null;
            ImportRegistrationId second = new ImportRegistrationId(typeof(string), 0, "a");

            Assert.IsFalse(first > second);
        }
Example #2
0
        public void CompareToWithSmallerFirstObject()
        {
            var first  = new ImportRegistrationId(typeof(string), 0, "a");
            var second = new ImportRegistrationId(typeof(string), 0, "b");

            Assert.IsTrue(first.CompareTo(second) < 0);
        }
Example #3
0
        public void CompareToWithUnequalObjectTypes()
        {
            ImportRegistrationId first = new ImportRegistrationId(typeof(string), 0, "a");
            object second = new object();

            Assert.Throws <ArgumentException>(() => first.CompareTo(second));
        }
Example #4
0
        public void CompareToWithNullObject()
        {
            ImportRegistrationId first = new ImportRegistrationId(typeof(string), 0, "a");
            object second = null;

            Assert.AreEqual(1, first.CompareTo(second));
        }
Example #5
0
        public void CompareToOperatorWithEqualObjects()
        {
            var    first  = new ImportRegistrationId(typeof(string), 0, "a");
            object second = first.Clone();

            Assert.AreEqual(0, first.CompareTo(second));
        }
Example #6
0
        public void Clone()
        {
            ImportRegistrationId first  = new ImportRegistrationId(typeof(string), 0, "a");
            ImportRegistrationId second = first.Clone();

            Assert.AreEqual(first, second);
        }
Example #7
0
        public void SmallerThanOperatorWithFirstObjectSmaller()
        {
            var first  = new ImportRegistrationId(typeof(string), 0, "a");
            var second = new ImportRegistrationId(typeof(string), 0, "b");

            Assert.IsTrue(first < second);
        }
Example #8
0
        public void SmallerThanOperatorWithEqualObjects()
        {
            var first  = new ImportRegistrationId(typeof(string), 0, "a");
            var second = first.Clone();

            Assert.IsFalse(first < second);
        }
Example #9
0
        public void SmallerThanOperatorWithBothObjectsNull()
        {
            ImportRegistrationId first  = null;
            ImportRegistrationId second = null;

            Assert.IsFalse(first < second);
        }
Example #10
0
        public void SmallerThanOperatorWithSecondObjectNull()
        {
            ImportRegistrationId first  = new ImportRegistrationId(typeof(string), 0, "a");
            ImportRegistrationId second = null;

            Assert.IsFalse(first < second);
        }