Exemple #1
0
            public void ShouldReturnTheCorrectValueWhenOtherIsHigher()
            {
                var color = new ColorMono(true);
                var other = new ColorMono(false);

                Assert.Equal(-1, color.CompareTo(other));
            }
Exemple #2
0
            public void ShouldSetTheCorrectValue()
            {
                var color = new ColorMono(false);

                color.IsBlack = true;
                Assert.True(color.IsBlack);
            }
Exemple #3
0
            public void ShouldInitializeTheProperties()
            {
                var color     = MagickColors.Black;
                var grayColor = ColorMono.FromMagickColor(color);

                Assert.Equal(grayColor, color);
            }
            public void ShouldReturnFalseWhenOtherAsObjectIsNotEqual()
            {
                var color = new ColorMono(true);
                var other = new ColorMono(false);

                Assert.False(color.Equals((object)other));
            }
            public void ShouldReturnTrueWhenOtherIsEqual()
            {
                var color = new ColorMono(false);
                var other = new ColorMono(false);

                Assert.True(color.Equals(other));
            }
            public void ShouldReturnDifferentValueWhenChannelChanged()
            {
                var first    = new ColorMono(true);
                var hashCode = first.GetHashCode();

                first.IsBlack = false;
                Assert.NotEqual(hashCode, first.GetHashCode());
            }
Exemple #7
0
            public void ShouldReturnTheCorrectValueWhenInstancesAreNotEqual()
            {
                var first  = new ColorMono(false);
                var second = new ColorMono(true);

                Assert.False(first == second);
                Assert.True(first != second);
                Assert.False(first < second);
                Assert.False(first <= second);
                Assert.True(first > second);
                Assert.True(first >= second);
            }
Exemple #8
0
            public void ShouldReturnTheCorrectValueWhenInstanceIsNull()
            {
                var color = new ColorMono(false);

                Assert.False(color is null);
                Assert.True(color != null);
                Assert.False(color < null);
                Assert.False(color <= null);
                Assert.True(color > null);
                Assert.True(color >= null);
                Assert.False(null == color);
                Assert.True(null != color);
                Assert.True(null < color);
                Assert.True(null <= color);
                Assert.False(null > color);
                Assert.False(null >= color);
            }
Exemple #9
0
            public void ShouldReturnTheCorrectValueWhenCastedFromMagickColor()
            {
                ColorMono actual = MagickColors.White;

                Assert.False(actual.IsBlack);
            }
Exemple #10
0
            public void ShouldReturnTheCorrectValueWhenOtherIsEqual()
            {
                var color = new ColorMono(true);

                Assert.Equal(0, color.CompareTo(color));
            }
Exemple #11
0
            public void ShouldReturnNullWhenValueIsNull()
            {
                var result = ColorMono.FromMagickColor(null);

                Assert.Null(result);
            }
            public void ShouldReturnFalseWhenOtherAsObjectIsNull()
            {
                var color = new ColorMono(true);

                Assert.False(color.Equals((object)null));
            }