From f7d1be086b2f00f42888108152f87c78da83861a Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 5 Aug 2017 16:57:22 -0700 Subject: [PATCH] Add tests for basic operations. --- .../nwapw/abacus/tests/CalculationTests.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/java/org/nwapw/abacus/tests/CalculationTests.java b/src/test/java/org/nwapw/abacus/tests/CalculationTests.java index bcf0305..fd1027e 100644 --- a/src/test/java/org/nwapw/abacus/tests/CalculationTests.java +++ b/src/test/java/org/nwapw/abacus/tests/CalculationTests.java @@ -2,6 +2,7 @@ package org.nwapw.abacus.tests; import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Test; import org.nwapw.abacus.Abacus; import org.nwapw.abacus.number.NumberInterface; import org.nwapw.abacus.plugin.StandardPlugin; @@ -33,4 +34,24 @@ public class CalculationTests { Assert.assertNull(abacus.evaluateTree(parsedTree)); } + @Test + public void testAddition(){ + testOutput("9.5+10", "(9.5+10)", "19.5"); + } + + @Test + public void testSubtraction(){ + testOutput("9.5-10", "(9.5-10)", "-0.5"); + } + + @Test + public void testMultiplication(){ + testOutput("9.5*10", "(9.5*10)", "95"); + } + + @Test + public void testDivision(){ + testOutput("9.5/2", "(9.5/2)", "4.75"); + } + }