Files
JavaScript/Geometry/Test/Sphere.test.js
Lcvieira2001 014a38b2d4 algorithm: volume of sphere (#1249)
* Added sphere volume

* Fixed indentation

* Added PR Suggestions
2022-10-31 22:09:41 +05:30

12 lines
386 B
JavaScript

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)
})