1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class TrigFunctionsTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class TrigFunctionsTest
- {
- @Test
- public void sinTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = -0.95;
- double actual = trigFunctions.sin(5);
- assertEquals(expected,actual,0.01);
-
- }
-
- @Test
- public void cosTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = 0.28;
- double actual = trigFunctions.cos(5);
- assertEquals(expected,actual, 0.01);
- }
-
- @Test
- public void tanTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = -3.38;
- double actual = trigFunctions.tan(5);
- assertEquals(expected,actual, 0.01);
- }
-
- @Test
- public void invsinTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = 1.57;
- double actual = trigFunctions.invsin(1);
- assertEquals(expected,actual, 0.01);
- }
-
- @Test
- public void invcosTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = 0;
- double actual = trigFunctions.invcos(1);
- assertEquals(expected,actual, 0.01);
- }
-
- @Test
- public void invtanTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = 0.79;
- double actual = trigFunctions.invtan(1);
- assertEquals(expected,actual, 0.01);
- }
-
- @Test
- public void degTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = 286.48;
- double actual = trigFunctions.deg(5);
- assertEquals(expected,actual, 0.01);
- }
-
- @Test
- public void radTest(){
- TrigFunctions trigFunctions = new TrigFunctions();
- double expected = 0.87;
- double actual = trigFunctions.rad(50);
- assertEquals(expected,actual, 0.01);
- }
- }
|