Ejemplo n.º 1
0
        public void AddingChildToGroup_ShouldWork()
        {
            var g = new Group();
            var s = new TestShape();

            g.AddShape(s);
            Assert.Equal(1, g.Count);
            Assert.Contains(s, g.Shapes);
            Assert.Equal(s.Parent, g);
        }
Ejemplo n.º 2
0
        public void IntersectingGroupWithRay_ShouldTestChildrenIfBoxIsHit()
        {
            var child = new TestShape();
            var group = new Group();

            group.AddShape(child);
            var r  = new Ray(new Point(0, 0, -5), new Vector(0, 0, 1));
            var xs = group.Intersect(r);

            Assert.NotNull(child.SavedRay);
        }
Ejemplo n.º 3
0
        public void Shape_ShouldHaveParentMember()
        {
            var s = new TestShape();

            Assert.True(s.Parent == null);
        }