Commit 03cec760 authored by Tony Alas's avatar Tony Alas
Browse files

added multiple more negative test cases

parent e3b935fb
......@@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test;
public class TrigTest {
//Variable Decleration
//Variable Declaration
Trig t;
double x;
double x1;
......@@ -17,6 +17,9 @@ public class TrigTest {
double x4;
double x5;
double x6;
double x7;
double x8;
double x9;
static double negPI = -3.1415926535;
static double PI = 3.1415926535;
......@@ -31,9 +34,12 @@ public class TrigTest {
x4 = 45;
x5 = 180;
x6 = negPI;
x7 = negPI/4;
x8 = 2*negPI;
x9 = 2*negPI/3;
}
//Tests to ensure that the Cos funciton in Trig works properly
//Tests to ensure that the Cos function in Trig works properly
@Test
void testTrigCos() {
// to do... write test cases for cosine
......@@ -42,9 +48,12 @@ public class TrigTest {
assertEquals(t.trigCos(x2), Math.cos(x2), 0.000005);
assertEquals(t.trigCos(x3), Math.cos(x3), 0.000005);
assertEquals(t.trigCos(x6), Math.cos(x6), 0.000005);
assertEquals(t.trigCos(x7), Math.cos(x7), 0.000005);
assertEquals(t.trigCos(x8), Math.cos(x8), 0.000005);
assertEquals(t.trigCos(x9), Math.cos(x9), 0.000005);
}
//Tests to ensure that the Sin funciton in Trig works properly
//Tests to ensure that the Sin function in Trig works properly
@Test
void testTrigSin() {
assertEquals(t.trigSin(x), Math.sin(x), 0.000005);
......@@ -52,9 +61,12 @@ public class TrigTest {
assertEquals(t.trigSin(x2), Math.sin(x2), 0.000005);
assertEquals(t.trigSin(x3), Math.sin(x3), 0.000005);
assertEquals(t.trigSin(x6), Math.sin(x6), 0.000005);
assertEquals(t.trigSin(x7), Math.sin(x7), 0.000005);
assertEquals(t.trigSin(x8), Math.sin(x8), 0.000005);
assertEquals(t.trigSin(x9), Math.sin(x9), 0.000005);
}
//Tests to ensure that the Tan funciton in Trig works properly
//Tests to ensure that the Tan function in Trig works properly
@Test
void testTrigTan() {
assertEquals(t.trigTan(x), Math.tan(x), 0.000005);
......@@ -62,9 +74,12 @@ public class TrigTest {
assertEquals(t.trigTan(x2), Math.tan(x2), 0.000005);
assertEquals(t.trigTan(x3), Math.tan(x3), 0.000005);
assertEquals(t.trigTan(x6), Math.tan(x6), 0.000005);
assertEquals(t.trigTan(x7), Math.tan(x7), 0.000005);
assertEquals(t.trigTan(x8), Math.tan(x8), 0.000005);
assertEquals(t.trigTan(x9), Math.tan(x9), 0.000005);
}
//Tests to ensure that the degree to rad funciton in Trig works properly
//Tests to ensure that the degree to rad function in Trig works properly
@Test
void testDegToRad()
{
......@@ -75,7 +90,7 @@ public class TrigTest {
assertEquals(t.convertDegreesToRadians(x5), Math.toRadians(x5), 0.000005);
}
//Tests to ensure that the rad to degree funciton in Trig works properly
//Tests to ensure that the rad to degree function in Trig works properly
@Test
void testRadToDeg()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment