1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
-
-
- import org.junit.Assert;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class scienticFunctionsTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class scienticFunctionsTest
- {
- private scienticFunctions scientificFunctions;
-
- @Before
- public void setUp(){
- scientificFunctions = new scienticFunctions();
- }
-
- @Test
- public void sineTest(){
- // :Given
- Double expected = 0.0;
-
- // :When
- Double actual = scientificFunctions.sine(0.0);
-
- // :Then
- Assert.assertEquals(expected, actual);
- }
-
- @Test
- public void cosineTest(){
- // :Given
- Double expected = 1.0;
-
- // :When
- Double actual = scientificFunctions.cosine(0);
-
- // :Then
- Assert.assertEquals(expected, actual);
- }
-
- @Test
- public void tangentTest(){
- // :Given
- Double expected = 0.0;
-
- // :When
- Double actual = scientificFunctions.tangent(0);
-
- // :Then
- Assert.assertEquals(expected, actual);
- }
-
- @Test
- public void inverseTangentTest(){
- // :Given
- Double expected = 45.0;
-
- // :When
- Double actual = scientificFunctions.inverseTangent(1);
-
- // :Then
- Assert.assertEquals(expected, actual);
- }
-
- @Test
- public void inverseCosineTest(){
- // :Given
- Double expected = 90.0;
-
- // :When
- Double actual = scientificFunctions.inverseCosine(0.0);
-
- // :Then
- Assert.assertEquals(expected, actual);
- }
-
- @Test
- public void inverseSineTest(){
- // :Given
- Double expected = 0.0;
-
- // :When
- Double actual = scientificFunctions.inverseSine(0.0);
-
- // :Then
- Assert.assertEquals(expected, actual);
- }
- }
|