public void AddingAChildToAGroup()
        {
            var g = new Group();
            var s = new TestShape();

            g.Add(s);

            Assert.AreNotEqual(0, g.Count);
            Assert.IsTrue(g.Contains(s));
            Assert.AreEqual(g, s.Parent);
        }
        public void IntersectingRayAndGroupDoesntTestChildrenIfBoxIsMissed()
        {
            var child = new TestShape();
            var shape = new Group();

            shape.Add(child);
            var r  = new Ray(new Point(0, 0, -5), new Vector(0, 1, 0));
            var xs = shape.Intersects(r);

            Assert.IsNull(child.SavedRay);
        }
        public void IntersectingRayGroupTestsChildrenIfBoxIsHit()
        {
            var child = new TestShape();
            var shape = new Group();

            shape.Add(child);
            var r  = new Ray(new Point(0, 0, -5), new Vector(0, 0, 1));
            var xs = shape.Intersects(r);

            Assert.IsNotNull(child.SavedRay);
        }
        public void IntersectingRayAndCsgTestsChildrenIfBoxIsHit()
        {
            var left  = new TestShape();
            var right = new TestShape();
            var shape = new CSG(Operation.DIFFERENCE, left, right);
            var r     = new Ray(new Point(0, 0, -5), new Vector(0, 0, 1));
            var xs    = shape.Intersects(r);

            Assert.IsNotNull(left.SavedRay);
            Assert.IsNotNull(right.SavedRay);
        }