Exemplo n.º 1
0
        public void TestPatternCheckerZ()
        {
            var pattern = new CheckersPattern(Color.White, Color.Black);

            Assert.AreEqual(pattern.PatternAt(Point.Zero), Color.White);
            Assert.AreEqual(pattern.PatternAt(new Point(0, 0, 0.99)), Color.White);
            Assert.AreEqual(pattern.PatternAt(new Point(0, 0, 1.01)), Color.Black);
        }
        public void CheckersShouldExtendInZ()
        {
            var pattern = new CheckersPattern(Color.WHITE, Color.BLACK);

            Assert.AreEqual(Color.WHITE, pattern.PatternAt(new Point(0, 0, 0)));
            Assert.AreEqual(Color.WHITE, pattern.PatternAt(new Point(0, 0, 0.99)));
            Assert.AreEqual(Color.BLACK, pattern.PatternAt(new Point(0, 0, 1.01)));
        }
Exemplo n.º 3
0
        public void T08_3DChecker()
        {
            Pattern pattern = new CheckersPattern(new SolidColorPattern(Color.white),
                                                  new SolidColorPattern(Color.black));

            Assert.AreEqual(Color.white, pattern.PatternAt(new Point(0, 0, 0)));
            Assert.AreEqual(Color.white, pattern.PatternAt(new Point(0.99, 0, 0)));
            Assert.AreEqual(Color.black, pattern.PatternAt(new Point(1.01, 0, 0)));

            Assert.AreEqual(Color.white, pattern.PatternAt(new Point(0, 0, 0)));
            Assert.AreEqual(Color.white, pattern.PatternAt(new Point(0, 0.99, 0)));
            Assert.AreEqual(Color.black, pattern.PatternAt(new Point(0, 1.01, 0)));

            Assert.AreEqual(Color.white, pattern.PatternAt(new Point(0, 0, 0)));
            Assert.AreEqual(Color.white, pattern.PatternAt(new Point(0, 0, 0.99)));
            Assert.AreEqual(Color.black, pattern.PatternAt(new Point(0, 0, 1.01)));
        }