mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
algorithm: volume of sphere (#1249)
* Added sphere volume * Fixed indentation * Added PR Suggestions
This commit is contained in:
11
Geometry/Test/Sphere.test.js
Normal file
11
Geometry/Test/Sphere.test.js
Normal 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)
|
||||
})
|
Reference in New Issue
Block a user