|
1 | 1 | import * as volume from '../Volume' |
2 | 2 |
|
3 | | -describe('Testing on volCuboid', () => { |
4 | | - it('with correct args', () => { |
| 3 | +test('Testing on volCuboid', () => { |
5 | 4 | const volCuboid = volume.volCuboid(2.0, 5.0, 3) |
6 | 5 | expect(volCuboid).toBe(30.0) |
7 | | - }) |
8 | | - it('with incorrect args', () => { |
9 | | - expect(() => volume.volCuboid(-1, 5.0, 3)).toThrow() |
10 | | - expect(() => volume.volCuboid(2.0, -1, 3)).toThrow() |
11 | | - expect(() => volume.volCuboid(2.0, 5.0, -1)).toThrow() |
12 | | - expect(() => volume.volCuboid('2.0', 5.0, 3)).toThrow() |
13 | | - expect(() => volume.volCuboid(2.0, '5.0', 3)).toThrow() |
14 | | - expect(() => volume.volCuboid(2.0, 5.0, '3')).toThrow() |
15 | | - expect(() => volume.volCuboid(2000000000000000, 5.0, 3)).toThrow() |
16 | | - expect(() => volume.volCuboid(2.0, 500000000000000000, 3)).toThrow() |
17 | | - expect(() => volume.volCuboid(2.0, 5.0, 30000000000000000000)).toThrow() |
18 | | - }) |
19 | 6 | }) |
20 | 7 |
|
21 | | -describe('Testing on volCube', () => { |
22 | | - it('with correct args', () => { |
| 8 | +test('Testing on volCube', () => { |
23 | 9 | const volCube = volume.volCube(2.0) |
24 | 10 | expect(volCube).toBe(8.0) |
25 | | - }) |
26 | | - it('with incorrect args', () => { |
27 | | - expect(() => volume.volCube(-2.0)).toThrow() |
28 | | - expect(() => volume.volCube('2.0')).toThrow() |
29 | | - expect(() => volume.volCube(2000000000000000000000000)).toThrow() |
30 | | - }) |
31 | 11 | }) |
32 | 12 |
|
33 | | -describe('Testing on volCone', () => { |
34 | | - it('with correct args', () => { |
| 13 | +test('Testing on volCone', () => { |
35 | 14 | const volCone = volume.volCone(2.0, 8.0) |
36 | 15 | expect(volCone).toBe(33.5103) |
37 | | - }) |
38 | | - it('with incorrect args', () => { |
39 | | - expect(() => volume.volCone(-2.0, 8.0)).toThrow() |
40 | | - expect(() => volume.volCone(2.0, -8.0)).toThrow() |
41 | | - expect(() => volume.volCone('2.0', 8.0)).toThrow() |
42 | | - expect(() => volume.volCone(2.0, '8.0')).toThrow() |
43 | | - expect(() => volume.volCone(2000000000000000000000000, 8.0)).toThrow() |
44 | | - expect(() => volume.volCone(2.0, 8000000000000000000000000000)).toThrow() |
45 | | - }) |
46 | 16 | }) |
47 | 17 |
|
48 | | -describe('Testing on volPyramid', () => { |
49 | | - it('with correct args', () => { |
| 18 | +test('Testing on volPyramid', () => { |
50 | 19 | const volPyramid = volume.volPyramid(2.0, 3.0, 8.0) |
51 | 20 | expect(volPyramid).toBe(16.0) |
52 | | - }) |
53 | | - it('with incorrect args', () => { |
54 | | - expect(() => volume.volPyramid(-2.0, 3.0, 8.0)).toThrow() |
55 | | - expect(() => volume.volPyramid(2.0, -3.0, 8.0)).toThrow() |
56 | | - expect(() => volume.volPyramid(2.0, 3.0, -8.0)).toThrow() |
57 | | - expect(() => volume.volPyramid('2.0', 3.0, 8.0)).toThrow() |
58 | | - expect(() => volume.volPyramid(2.0, '3.0', 8.0)).toThrow() |
59 | | - expect(() => volume.volPyramid(2.0, 3.0, '8.0')).toThrow() |
60 | | - expect(() => volume.volPyramid(2000000000000000000000000, 3.0, 8.0)).toThrow() |
61 | | - expect(() => volume.volPyramid(2.0, 3000000000000000000000000000, 8.0)).toThrow() |
62 | | - expect(() => volume.volPyramid(2.0, 3.0, 8000000000000000000000000000)).toThrow() |
63 | | - }) |
64 | 21 | }) |
65 | 22 |
|
66 | | -describe('Testing on volCylinder', () => { |
67 | | - it('with correct args', () => { |
| 23 | +test('Testing on volCylinder', () => { |
68 | 24 | const volCylinder = volume.volCylinder(2.0, 8.0) |
69 | 25 | expect(volCylinder).toBe(100.5310) |
70 | | - }) |
71 | | - it('with incorrect args', () => { |
72 | | - expect(() => volume.volCylinder(-2.0, 8.0)).toThrow() |
73 | | - expect(() => volume.volCylinder(2.0, -8.0)).toThrow() |
74 | | - expect(() => volume.volCylinder('2.0', 8.0)).toThrow() |
75 | | - expect(() => volume.volCylinder(2.0, '8.0')).toThrow() |
76 | | - expect(() => volume.volCylinder(2000000000000000000000000, 8.0)).toThrow() |
77 | | - expect(() => volume.volCylinder(2.0, 8000000000000000000000000000)).toThrow() |
78 | | - }) |
79 | 26 | }) |
80 | 27 |
|
81 | | -describe('Testing on volTriangularPrism', () => { |
82 | | - it('with correct args', () => { |
| 28 | +test('Testing on volTriangularPrism', () => { |
83 | 29 | const volTriangularPrism = volume.volTriangularPrism(3.0, 6.0, 8.0) |
84 | 30 | expect(volTriangularPrism).toBe(72.0) |
85 | | - }) |
86 | | - it('with incorrect args', () => { |
87 | | - expect(() => volume.volTriangularPrism(-3.0, 6.0, 8.0)).toThrow() |
88 | | - expect(() => volume.volTriangularPrism(3.0, -6.0, 8.0)).toThrow() |
89 | | - expect(() => volume.volTriangularPrism(3.0, 6.0, -8.0)).toThrow() |
90 | | - expect(() => volume.volTriangularPrism('3.0', 6.0, 8.0)).toThrow() |
91 | | - expect(() => volume.volTriangularPrism(3.0, '6.0', 8.0)).toThrow() |
92 | | - expect(() => volume.volTriangularPrism(3.0, 6.0, '8.0')).toThrow() |
93 | | - expect(() => volume.volTriangularPrism(3000000000000000000000000, 6.0, 8.0)).toThrow() |
94 | | - expect(() => volume.volTriangularPrism(3.0, 6000000000000000000000000000, 8.0)).toThrow() |
95 | | - expect(() => volume.volTriangularPrism(3.0, 6.0, 8000000000000000000000000000)).toThrow() |
96 | | - }) |
97 | 31 | }) |
98 | 32 |
|
99 | | -describe('Testing on volPentagonalPrism', () => { |
100 | | - it('with correct args', () => { |
| 33 | +test('Testing on volPentagonalPrism', () => { |
101 | 34 | const volPentagonalPrism = volume.volPentagonalPrism(1.0, 4.0, 8.0) |
102 | 35 | expect(volPentagonalPrism).toBe(80.0) |
103 | | - }) |
104 | | - it('with incorrect args', () => { |
105 | | - expect(() => volume.volPentagonalPrism(-1.0, 4.0, 8.0)).toThrow() |
106 | | - expect(() => volume.volPentagonalPrism(1.0, -4.0, 8.0)).toThrow() |
107 | | - expect(() => volume.volPentagonalPrism(1.0, 4.0, -8.0)).toThrow() |
108 | | - expect(() => volume.volPentagonalPrism('1.0', 4.0, 8.0)).toThrow() |
109 | | - expect(() => volume.volPentagonalPrism(1.0, '4.0', 8.0)).toThrow() |
110 | | - expect(() => volume.volPentagonalPrism(1.0, 4.0, '8.0')).toThrow() |
111 | | - expect(() => volume.volPentagonalPrism(1000000000000000000000000, 4.0, 8.0)).toThrow() |
112 | | - expect(() => volume.volPentagonalPrism(1.0, 4000000000000000000000000000, 8.0)).toThrow() |
113 | | - expect(() => volume.volPentagonalPrism(1.0, 4.0, 8000000000000000000000000000)).toThrow() |
114 | | - }) |
115 | 36 | }) |
116 | 37 |
|
117 | | -describe('Testing on volSphere', () => { |
118 | | - it('with correct args', () => { |
| 38 | +test('Testing on volSphere', () => { |
119 | 39 | const volSphere = volume.volSphere(4.0) |
120 | 40 | expect(volSphere).toBe(268.0826) |
121 | | - }) |
122 | | - it('with incorrect args', () => { |
123 | | - expect(() => volume.volSphere(-4.0)).toThrow() |
124 | | - expect(() => volume.volSphere('4.0')).toThrow() |
125 | | - expect(() => volume.volSphere(4000000000000000000000000)).toThrow() |
126 | | - }) |
127 | 41 | }) |
128 | 42 |
|
129 | | -describe('Testing on volHemisphere', () => { |
130 | | - it('with correct args', () => { |
| 43 | +test('Testing on volHemisphere', () => { |
131 | 44 | const volHemisphere = volume.volHemisphere(4.0) |
132 | 45 | expect(volHemisphere).toBe(134.0413) |
133 | | - }) |
134 | | - it('with incorrect args', () => { |
135 | | - expect(() => volume.volHemisphere(-4.0)).toThrow() |
136 | | - expect(() => volume.volHemisphere('4.0')).toThrow() |
137 | | - expect(() => volume.volHemisphere(4000000000000000000000000)).toThrow() |
138 | | - }) |
139 | 46 | }) |
0 commit comments