示例#1
0
        public void Difference_MinusOperatorCreatesDifferenceObject()
        {
            var obj = new Cube() - new Sphere();
            var diff = new Sphere().Difference(new Cube());

            Assert.IsTrue(obj.GetType() == diff.GetType());
        }
示例#2
0
        public void Union_ChainingAdditionAddsToTheSameUnion()
        {
            var obj = new Cube() + new Sphere() + new Text3D("WOW!") + new Cylinder().Translate(1, 2, 5);
            var union = new Sphere().Union(new Cube());

            var unionChildrenCount = obj.Children().Where(child => child.GetType() == union.GetType()).Count();

            Assert.AreEqual(0, unionChildrenCount);
        }
示例#3
0
        public void Difference_ChainingMinusOperationAddsToTheSameDifferenceObject()
        {
            var obj = new Cube() - new Sphere() - new Text3D("WOW!") - new Cylinder().Translate(1, 2, 5);
            var diff = new Sphere().Difference(new Cube());

            var childrenThatAreDiffs = obj.Children().Where(child => child.GetType() == diff.GetType()).Count();

            Assert.AreEqual(0, childrenThatAreDiffs);
        }