Exemple #1
0
        public void CloneCubeDescription()
        {
            BSP cube = new Cube();
            BSP cube2 = cube.Clone();
            Assert.IsTrue(cube.Description.Zip(cube2.Description, (a, b) => a.Equals(b)).Aggregate((a, b) => a & b));

            BSP sphere = new Sphere(1);
            Assert.IsFalse(sphere.Description.Zip(cube2.Description, (a, b) => a.Equals(b)).Aggregate((a, b) => a & b));
        }
Exemple #2
0
        public void UnionDescription()
        {
            Cube cube = new Cube();
            Cylinder cyl = new Cylinder(3);

            var shape = cube.Clone();
            shape.Union(cyl);

            var desc = shape.Description.ToArray();
            Assert.AreEqual(4, desc.Length);
            Assert.AreEqual("union", desc[0]);
            Assert.AreEqual("cube", desc[1]);
            Assert.AreEqual("cylinder", desc[2]);
            Assert.AreEqual((uint)3, desc[3]);
        }