123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class ScientificOperationsTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class ScientificOperationsTest
- {
-
- ScientificOperations soObject = new ScientificOperations ();
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Test
- public void sine()
- { double expected = 1.0;
- double actual = soObject.sine(90.0);
- double delta = 1.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void cosine()
- { double expected = 1.0;
- double actual = soObject.cosine(0.0);
- double delta = 1.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void invCosine()
- { double expected = 0.0;
- double actual = soObject.invCosine(1.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void invSine()
- { double expected = 0.0;
- double actual = soObject.invSine(0.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void tangent()
- { double expected = 0.0;
- double actual = soObject.tangent(0.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void invTangent()
- { double expected = 0.0;
- double actual = soObject.invTangent(0.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void log()
- { double expected = 0.0;
- double actual = soObject.log(1.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void log10()
- { double expected = 0.0;
- double actual = soObject.log10(1.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void square()
- { double expected = 4.0;
- double actual = soObject.square(2.0);
- double delta = 4.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void squareRoot()
- { double expected = 5.0;
- double actual = soObject.squareRoot(25.0);
- double delta = 5.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void degree()
- { double expected = 0.0;
- double actual = soObject.degree(0.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- @Test
- public void radian()
- { double expected = 0.0;
- double actual = soObject.sine(0.0);
- double delta = 0.0;
- assertEquals(actual, expected, delta);
- }
-
- }
|