Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@
<Match>
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS" />
</Match>
<Match>
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS" />
</Match>
<Match>
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT" />
</Match>
Expand Down
20 changes: 10 additions & 10 deletions src/test/java/com/thealgorithms/maths/VolumeTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.thealgorithms.maths;

import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

Expand All @@ -10,30 +10,30 @@ public class VolumeTest {
public void volume() {

/* test cube */
assertTrue(Volume.volumeCube(7) == 343.0);
assertEquals(Volume.volumeCube(7), 343.0);

/* test cuboid */
assertTrue(Volume.volumeCuboid(2, 5, 7) == 70.0);
assertEquals(Volume.volumeCuboid(2, 5, 7), 70.0);

/* test sphere */
assertTrue(Volume.volumeSphere(7) == 1436.7550402417319);
assertEquals(Volume.volumeSphere(7), 1436.7550402417319);

/* test cylinder */
assertTrue(Volume.volumeCylinder(3, 7) == 197.92033717615698);
assertEquals(Volume.volumeCylinder(3, 7), 197.92033717615698);

/* test hemisphere */
assertTrue(Volume.volumeHemisphere(7) == 718.3775201208659);
assertEquals(Volume.volumeHemisphere(7), 718.3775201208659);

/* test cone */
assertTrue(Volume.volumeCone(3, 7) == 65.97344572538566);
assertEquals(Volume.volumeCone(3, 7), 65.97344572538566);

/* test prism */
assertTrue(Volume.volumePrism(10, 2) == 20.0);
assertEquals(Volume.volumePrism(10, 2), 20.0);

/* test pyramid */
assertTrue(Volume.volumePyramid(10, 3) == 10.0);
assertEquals(Volume.volumePyramid(10, 3), 10.0);

/* test frustum */
assertTrue(Volume.volumeFrustumOfCone(3, 5, 7) == 359.188760060433);
assertEquals(Volume.volumeFrustumOfCone(3, 5, 7), 359.188760060433);
}
}
Loading