Пример #1
0
 public void CloneCylinderDescription()
 {
     BSP cyl = new Cylinder(3);
     BSP cyl2 = cyl.Clone();
     Assert.AreEqual(cyl.Description.Count(), cyl2.Description.Count());
     Assert.IsTrue(cyl.Description.Zip(cyl2.Description, (a, b) => a.Equals(b)).Aggregate((a, b) => a & b));
 }
Пример #2
0
        public void CylinderDescription()
        {
            Cylinder c = new Cylinder(3);

            Assert.AreEqual(2, c.Description.Count());
            Assert.AreEqual("cylinder", c.Description.First());
            Assert.AreEqual((uint)3, c.Description.Skip(1).First());
        }
Пример #3
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]);
        }
Пример #4
0
        public void CreateCylinderWithFactory()
        {
            Cylinder s = new Cylinder(7, (a, b) => new VertexTest(a, b));

            Assert.IsTrue(s.Polygons.SelectMany(a => a.Vertices).All(a => a is VertexTest));
        }