algorithm: volume of sphere (#1249)

* Added sphere volume

* Fixed indentation

* Added PR Suggestions
This commit is contained in:
Lcvieira2001
2022-10-31 13:39:41 -03:00
committed by GitHub
parent b634aa581c
commit 014a38b2d4
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import Sphere from '../Sphere'
const sphere = new Sphere(3)
test('The Volume of a sphere with base radius equal to 3 and height equal to 5', () => {
expect(parseFloat(sphere.volume().toFixed(2))).toEqual(113.1)
})
test('The Surface Area of a sphere with base radius equal to 3 and height equal to 5', () => {
expect(parseFloat(sphere.surfaceArea().toFixed(2))).toEqual(113.1)
})