コード例 #1
0
            public void ShouldUseThePercentage()
            {
                var first  = new ColorRGB(Quantum.Max, Quantum.Max, Quantum.Max);
                var second = new ColorRGB(Quantum.Max, (QuantumType)(Quantum.Max / 2.0), Quantum.Max);

                Assert.False(first.FuzzyEquals(second, (Percentage)0));
                Assert.False(first.FuzzyEquals(second, (Percentage)10));
                Assert.False(first.FuzzyEquals(second, (Percentage)20));
                Assert.True(first.FuzzyEquals(second, (Percentage)30));
            }
コード例 #2
0
            public void ShouldReturnTrueWhenOtherIsEqual()
            {
                var      first  = new ColorRGB(Quantum.Max, Quantum.Max, Quantum.Max);
                ColorRGB second = new MagickColor(Quantum.Max, Quantum.Max, Quantum.Max);

                Assert.True(first.FuzzyEquals(second, (Percentage)0));
            }
コード例 #3
0
            public void ShouldReturnTrueWhenOtherIsSame()
            {
                var color = new ColorRGB(Quantum.Max, Quantum.Max, Quantum.Max);

                Assert.True(color.FuzzyEquals(color, (Percentage)0));
            }
コード例 #4
0
            public void ShouldReturnFalseWhenOtherIsNull()
            {
                var color = new ColorRGB(Quantum.Max, Quantum.Max, Quantum.Max);

                Assert.False(color.FuzzyEquals(null, (Percentage)0));
            }