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)); }
public void CreateSphere() { Sphere s = new Sphere(0); foreach (var polygon in s.Polygons) { Assert.IsTrue(polygon.Plane.D < 0); } }
public void SphereDescription() { Sphere s = new Sphere(1); Assert.AreEqual(2, s.Description.Count()); Assert.AreEqual("sphere", s.Description.First()); var v = s.Description.Skip(1).First(); Assert.AreEqual((uint)1, v); }
public void CreateSphereWithFactory() { Sphere s = new Sphere(2, (a, b) => new VertexTest(a, b)); Assert.IsTrue(s.Polygons.SelectMany(a => a.Vertices).All(a => a is VertexTest)); }