Exemplo n.º 1
0
        public void DistanceTest()
        {
            //Arrange
            var c   = new Cube(100);
            var s   = new Sphere(35);
            var sub = new Subtraction(c, s);
            var p   = new Vec3(20, 30, 50);

            //Act
            var dist = sub.Distance(p);

            //Assert
            Assert.Equal(0, dist, 5);
        }
Exemplo n.º 2
0
        public void DistanceTestInsideCloseToCube()
        {
            //Arrange
            var c   = new Cube(100);
            var s   = new Sphere(35);
            var sub = new Subtraction(c, s);
            var p   = new Vec3(15, 20, 45);

            //Act
            var dist = sub.Distance(p);

            //Assert
            Assert.Equal(-5, dist, 5);
        }