From 0ad253bc88d526f14e4e98ea815216619f59e8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:06:47 +0100 Subject: [PATCH] refact: move main to test --- .../dataSmoothing/DataSmoother.java | 17 ----------------- .../datasmoothing/DataSmootherTest.java | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java diff --git a/src/main/java/neqsim/statistics/dataAnalysis/dataSmoothing/DataSmoother.java b/src/main/java/neqsim/statistics/dataAnalysis/dataSmoothing/DataSmoother.java index 9268922734..613d500c02 100644 --- a/src/main/java/neqsim/statistics/dataAnalysis/dataSmoothing/DataSmoother.java +++ b/src/main/java/neqsim/statistics/dataAnalysis/dataSmoothing/DataSmoother.java @@ -159,21 +159,4 @@ public void setSmoothedNumbers() { public double[] getSmoothedNumbers() { return smoothedNumbers; } - - /** - *
- * main. - *
- * - * @param args an array of {@link java.lang.String} objects - */ - public static void main(String[] args) { - double[] numbers = {10, 11, 12, 13, 14, 15, 15.5, 15, 19, 14, 14, 13, 12, 12, 11, 10, 9, 8}; - DataSmoother test = new DataSmoother(numbers, 3, 3, 0, 4); - Matrix data = new Matrix(test.getSmoothedNumbers(), 1); - data.print(10, 2); - test.runSmoothing(); - data = new Matrix(test.getSmoothedNumbers(), 1); - data.print(10, 2); - } } diff --git a/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java b/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java new file mode 100644 index 0000000000..c7e2736131 --- /dev/null +++ b/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java @@ -0,0 +1,18 @@ +package neqsim.statistics.dataanalysis.datasmoothing; + +import org.junit.jupiter.api.Test; +import Jama.Matrix; + +public class DataSmootherTest { + + @Test + void testgetSmoothedNumbers(String[] args) { + double[] numbers = {10, 11, 12, 13, 14, 15, 15.5, 15, 19, 14, 14, 13, 12, 12, 11, 10, 9, 8}; + DataSmoother test = new DataSmoother(numbers, 3, 3, 0, 4); + Matrix data = new Matrix(test.getSmoothedNumbers(), 1); + data.print(10, 2); + test.runSmoothing(); + data = new Matrix(test.getSmoothedNumbers(), 1); + data.print(10, 2); + } +}