示例#1
0
        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));
        }
示例#2
0
            public void ShouldReturnTrueWhenMagickColorIsConstructedWithTransparentStringAndColorIsTransparent()
            {
                MagickColor transparent = new MagickColor("transparent");

                Assert.IsTrue(transparent.Equals(Color.Transparent));
            }
示例#3
0
            public void ShouldReturnFalseWhenMagickColorAndColorAreDifferent()
            {
                MagickColor transparent = MagickColors.CadetBlue;

                Assert.IsFalse(transparent.Equals(Color.AliceBlue));
            }
示例#4
0
            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));
		}