public void Test_IEquatable() { MagickColor first = new MagickColor(MagickColors.Red); Assert.IsFalse(first == null); Assert.IsFalse(first.Equals(null)); Assert.IsTrue(first.Equals(first)); Assert.IsTrue(first.Equals((object)first)); MagickColor second = new MagickColor(Quantum.Max, 0, 0); Assert.IsTrue(first == second); Assert.IsTrue(first.Equals(second)); Assert.IsTrue(first.Equals((object)second)); second = new MagickColor(MagickColors.Green); Assert.IsTrue(first != second); Assert.IsFalse(first.Equals(second)); }
public void ShouldReturnTrueWhenMagickColorIsConstructedWithTransparentStringAndColorIsTransparent() { MagickColor transparent = new MagickColor("transparent"); Assert.IsTrue(transparent.Equals(Color.Transparent)); }
public void ShouldReturnFalseWhenMagickColorAndColorAreDifferent() { MagickColor transparent = MagickColors.CadetBlue; Assert.IsFalse(transparent.Equals(Color.AliceBlue)); }
public void ShouldReturnTrueWhenMagickColorAndColorAreTransparent() { MagickColor transparent = MagickColors.Transparent; Assert.IsTrue(transparent.Equals(Color.Transparent)); }
public void Test_IEquatable() { MagickColor first = new MagickColor(Color.Red); Assert.IsFalse(first == null); Assert.IsFalse(first.Equals(null)); Assert.IsTrue(first.Equals(first)); Assert.IsTrue(first.Equals((object)first)); MagickColor second = new MagickColor(Quantum.Max, 0, 0); Assert.IsTrue(first == second); Assert.IsTrue(first.Equals(second)); Assert.IsTrue(first.Equals((object)second)); second = new MagickColor(Color.Green); Assert.IsTrue(first != second); Assert.IsFalse(first.Equals(second)); }