Пример #1
0
        public void Test_IComparable()
        {
            MagickGeometry first = new MagickGeometry(10, 5);

            Assert.AreEqual(0, first.CompareTo(first));
            Assert.AreEqual(1, first.CompareTo(null));
            Assert.IsFalse(first < null);
            Assert.IsFalse(first <= null);
            Assert.IsTrue(first > null);
            Assert.IsTrue(first >= null);
            Assert.IsTrue(null < first);
            Assert.IsTrue(null <= first);
            Assert.IsFalse(null > first);
            Assert.IsFalse(null >= first);

            MagickGeometry second = new MagickGeometry(5, 5);

            Assert.AreEqual(1, first.CompareTo(second));
            Assert.IsFalse(first < second);
            Assert.IsFalse(first <= second);
            Assert.IsTrue(first > second);
            Assert.IsTrue(first >= second);

            second = new MagickGeometry(5, 10);

            Assert.AreEqual(0, first.CompareTo(second));
            Assert.IsFalse(first == second);
            Assert.IsFalse(first < second);
            Assert.IsTrue(first <= second);
            Assert.IsFalse(first > second);
            Assert.IsTrue(first >= second);
        }
Пример #2
0
            public void ShouldReturnZeroWhenInstancesAreNotEqual()
            {
                var first  = new MagickGeometry(10, 5);
                var second = new MagickGeometry(5, 5);

                Assert.AreEqual(1, first.CompareTo(second));
            }
Пример #3
0
            public void ShouldReturnZeroWhenInstancesAreTheSame()
            {
                var first = new MagickGeometry(10, 5);

                Assert.AreEqual(0, first.CompareTo(first));
            }
Пример #4
0
            public void ShouldReturnOneWhenInstancesIsNull()
            {
                var first = new MagickGeometry(10, 5);

                Assert.AreEqual(1, first.CompareTo(null));
            }
		public void Test_IComparable()
		{
			MagickGeometry first = new MagickGeometry(10, 5);

			Assert.AreEqual(0, first.CompareTo(first));
			Assert.AreEqual(1, first.CompareTo(null));
			Assert.IsFalse(first < null);
			Assert.IsFalse(first <= null);
			Assert.IsTrue(first > null);
			Assert.IsTrue(first >= null);
			Assert.IsTrue(null < first);
			Assert.IsTrue(null <= first);
			Assert.IsFalse(null > first);
			Assert.IsFalse(null >= first);

			MagickGeometry second = new MagickGeometry(5, 5);

			Assert.AreEqual(1, first.CompareTo(second));
			Assert.IsFalse(first < second);
			Assert.IsFalse(first <= second);
			Assert.IsTrue(first > second);
			Assert.IsTrue(first >= second);

			second = new MagickGeometry(5, 10);

			Assert.AreEqual(0, first.CompareTo(second));
			Assert.IsFalse(first == second);
			Assert.IsFalse(first < second);
			Assert.IsTrue(first <= second);
			Assert.IsFalse(first > second);
			Assert.IsTrue(first >= second);
		}