summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-03-16 15:01:59 -0400
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-03-16 15:01:59 -0400
commit62a80fed0bf3bce2a66f9b786561a1389cd95f16 (patch)
tree9830eb90a9e8961d9534a81f457890deed8c12be
parentb20cd4223b4ffc03e334627a82ca4eff9738912c (diff)
Configured tests and moved them to src/test/java
-rwxr-xr-xsrc/test/java/UnitDimensionTest.java (renamed from src/org/unitConverter/dimension/UnitDimensionTest.java)12
-rwxr-xr-xsrc/test/java/UnitTest.java (renamed from src/org/unitConverter/unit/UnitTest.java)11
-rw-r--r--src/test/java/package-info.java23
3 files changed, 37 insertions, 9 deletions
diff --git a/src/org/unitConverter/dimension/UnitDimensionTest.java b/src/test/java/UnitDimensionTest.java
index 3b09610..0b5055b 100755
--- a/src/org/unitConverter/dimension/UnitDimensionTest.java
+++ b/src/test/java/UnitDimensionTest.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-package org.unitConverter.dimension;
+package test.java;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -28,6 +28,8 @@ import static org.unitConverter.dimension.StandardDimensions.TIME;
import static org.unitConverter.dimension.StandardDimensions.VOLUME;
import org.junit.Test;
+import org.unitConverter.dimension.SIBaseDimension;
+import org.unitConverter.dimension.UnitDimension;
/**
* Tests for {@link UnitDimension}.
@@ -36,7 +38,7 @@ import org.junit.Test;
* @since 2018-12-12
* @since v0.1.0
*/
-class UnitDimensionTest {
+public class UnitDimensionTest {
/**
* Tests {@link UnitDimension#equals}
*
@@ -44,7 +46,7 @@ class UnitDimensionTest {
* @since v0.1.0
*/
@Test
- void testEquals() {
+ public void testEquals() {
assertEquals(LENGTH, LENGTH);
assertFalse(LENGTH.equals(QUANTITY));
}
@@ -56,7 +58,7 @@ class UnitDimensionTest {
* @since v0.1.0
*/
@Test
- void testExponents() {
+ public void testExponents() {
assertEquals(1, LENGTH.getExponent(SIBaseDimension.LENGTH));
assertEquals(3, VOLUME.getExponent(SIBaseDimension.LENGTH));
}
@@ -68,7 +70,7 @@ class UnitDimensionTest {
* @since v0.1.0
*/
@Test
- void testMultiplicationAndDivision() {
+ public void testMultiplicationAndDivision() {
assertEquals(AREA, LENGTH.times(LENGTH));
assertEquals(MASS_DENSITY, MASS.dividedBy(VOLUME));
assertEquals(ENERGY, AREA.times(MASS).dividedBy(TIME).dividedBy(TIME));
diff --git a/src/org/unitConverter/unit/UnitTest.java b/src/test/java/UnitTest.java
index 931cc57..45f890f 100755
--- a/src/org/unitConverter/unit/UnitTest.java
+++ b/src/test/java/UnitTest.java
@@ -14,12 +14,15 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-package org.unitConverter.unit;
+package test.java;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.unitConverter.dimension.StandardDimensions;
+import org.unitConverter.unit.BaseUnit;
+import org.unitConverter.unit.SI;
+import org.unitConverter.unit.Unit;
/**
* Testing the various Unit classes
@@ -27,9 +30,9 @@ import org.unitConverter.dimension.StandardDimensions;
* @author Adrien Hopkins
* @since 2018-12-22
*/
-class UnitTest {
+public class UnitTest {
@Test
- void testConversion() {
+ public void testConversion() {
final BaseUnit metre = SI.METRE;
final Unit inch = metre.times(0.0254);
@@ -37,7 +40,7 @@ class UnitTest {
}
@Test
- void testEquals() {
+ public void testEquals() {
final BaseUnit metre = SI.METRE;
final Unit meter = SI.SI.getBaseUnit(StandardDimensions.LENGTH);
diff --git a/src/test/java/package-info.java b/src/test/java/package-info.java
new file mode 100644
index 0000000..9f2e1d6
--- /dev/null
+++ b/src/test/java/package-info.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright (C) 2019 Adrien Hopkins
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+/**
+ * All of the Unit Converter tests.
+ *
+ * @author Adrien Hopkins
+ * @since 2019-03-16
+ */
+package test.java; \ No newline at end of file