1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import org.junit.Assert;
- import org.junit.Test;
-
- /**
- * The test class CoreFunctionsTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class CoreFunctionsTest
- { CoreFunctions coreFunctionsTest = new CoreFunctions();
- /**
- * Default constructor for test class CoreFunctionsTest
- */
- public CoreFunctionsTest()
- {
- }
-
- @Test
- public void testAdd(){
- double actual = CoreFunctions.add(1,2);
- double expected = 3;
- Assert.assertEquals(expected,actual,1e-8);
- }
-
- @Test
- public void testSubtract(){
- double actual = CoreFunctions.subtract(2,1);
- double expected = 1;
- Assert.assertEquals(expected,actual,1e-8);
- }
-
- @Test
- public void testMultiply(){
- double actual = CoreFunctions.multiply(2,1);
- double expected = 2;
- Assert.assertEquals(expected,actual,1e-8);
- }
-
- @Test
- public void testDivide(){
- double actual = CoreFunctions.multiply(2,1);
- double expected = 2;
- Assert.assertEquals(expected,actual,1e-8);
- }
-
-
- @Test
- public void vtestExp(){
- double actual = CoreFunctions.exp(2, 2);
- double expected = 4;
- Assert.assertEquals(expected,actual,1e-8);
- }
-
-
- }
|