public void Test_IComparable() { MagickImage first = new MagickImage(Color.Red, 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); MagickImage second = new MagickImage(Color.Green, 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 MagickImage(Color.Red, 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); first.Dispose(); second.Dispose(); }
public void Test_IComparable() { MagickImage first = new MagickImage(Color.Red, 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); MagickImage second = new MagickImage(Color.Green, 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 MagickImage(Color.Red, 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); first.Dispose(); second.Dispose(); }