Ejemplo n.º 1
0
        public void LargerThanOperatorWithFirstObjectNull()
        {
            PartRegistrationId first  = null;
            PartRegistrationId second = new PartRegistrationId(typeof(string).FullName, 0);

            Assert.IsFalse(first > second);
        }
Ejemplo n.º 2
0
        public void CompareToWithSmallerFirstObject()
        {
            var first  = new PartRegistrationId(typeof(string).FullName, 0);
            var second = new PartRegistrationId(typeof(string).FullName, 1);

            Assert.IsTrue(first.CompareTo(second) < 0);
        }
Ejemplo n.º 3
0
        public void CompareToWithUnequalObjectTypes()
        {
            PartRegistrationId first  = new PartRegistrationId(typeof(string).FullName, 0);
            object             second = new object();

            Assert.Throws <ArgumentException>(() => first.CompareTo(second));
        }
Ejemplo n.º 4
0
        public void CompareToWithNullObject()
        {
            PartRegistrationId first  = new PartRegistrationId(typeof(string).FullName, 0);
            object             second = null;

            Assert.AreEqual(1, first.CompareTo(second));
        }
Ejemplo n.º 5
0
        public void CompareToOperatorWithEqualObjects()
        {
            var    first  = new PartRegistrationId(typeof(string).FullName, 0);
            object second = first.Clone();

            Assert.AreEqual(0, first.CompareTo(second));
        }
Ejemplo n.º 6
0
        public void Clone()
        {
            PartRegistrationId first  = new PartRegistrationId(typeof(string).FullName, 0);
            PartRegistrationId second = first.Clone();

            Assert.AreEqual(first, second);
        }
Ejemplo n.º 7
0
        public void SmallerThanOperatorWithFirstObjectSmaller()
        {
            var first  = new PartRegistrationId(typeof(string).FullName, 0);
            var second = new PartRegistrationId(typeof(string).FullName, 1);

            Assert.IsTrue(first < second);
        }
Ejemplo n.º 8
0
        public void SmallerThanOperatorWithEqualObjects()
        {
            var first  = new PartRegistrationId(typeof(string).FullName, 0);
            var second = first.Clone();

            Assert.IsFalse(first < second);
        }
Ejemplo n.º 9
0
        public void SmallerThanOperatorWithBothObjectsNull()
        {
            PartRegistrationId first  = null;
            PartRegistrationId second = null;

            Assert.IsFalse(first < second);
        }
Ejemplo n.º 10
0
        public void SmallerThanOperatorWithSecondObjectNull()
        {
            PartRegistrationId first  = new PartRegistrationId(typeof(string).FullName, 0);
            PartRegistrationId second = null;

            Assert.IsFalse(first < second);
        }