mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
algorithm class: cone (#1253)
This commit is contained in:
11
Geometry/Test/Cone.test.js
Normal file
11
Geometry/Test/Cone.test.js
Normal file
@ -0,0 +1,11 @@
|
||||
import Cone from '../Cone'
|
||||
|
||||
const cone = new Cone(3, 5)
|
||||
|
||||
test('The Volume of a cone with base radius equal to 3 and height equal to 5', () => {
|
||||
expect(parseFloat(cone.volume().toFixed(2))).toEqual(47.12)
|
||||
})
|
||||
|
||||
test('The Surface Area of a cone with base radius equal to 3 and height equal to 5', () => {
|
||||
expect(parseFloat(cone.surfaceArea().toFixed(2))).toEqual(83.23)
|
||||
})
|
Reference in New Issue
Block a user