Adding Test Cases
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
Purplumbi504 2024-06-29 16:05:11 +02:00
parent 27f50b9c66
commit dccd34db73
17 changed files with 316 additions and 0 deletions

View File

@ -48,4 +48,129 @@ class AstBuilderTest {
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Commments Ignore Test")
public void commmentsIgnoreTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Constructor Paramerter Test")
public void constructorParameterTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("This Dot Test")
public void thisDotTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Constructor This Dot Test")
public void constructorThisDotTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Void Methoden Test")
public void voidMethodenTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Constructor Method call Test")
public void constructorMethodCallTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Constructor Method call Parameters Test")
public void constructorMethodCallParametersTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Char Test")
public void charTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Null Test")
public void nullTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Self Reference Test")
public void selfReferneceTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Variable Compare Test")
public void variableCompareTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Variable Calculation Test")
public void variableCalculationTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Main Method Test")
public void mainMethodTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("While Test")
public void whileTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("Do While Test")
public void doWhileTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
@Test
@DisplayName("For Test")
public void forTest(){
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
}
}

View File

@ -0,0 +1,12 @@
class TestClass{
char a;
public TestClass(char a){
this.a = testMethod(a);
}
char testMethod(char a){
return a;
}
}

View File

@ -0,0 +1,8 @@
/*
Mutliple Line Comment. Ignore
*/
class TestClass{
private int a; // Ignore
}

View File

@ -0,0 +1,12 @@
class TestClass {
int a;
public TestClass(int a){
this.a = testMethod(a);
}
int testMethod(int a){
return a;
}
}

View File

@ -0,0 +1,12 @@
class TestClass {
int a;
public TestClass(){
this.a = testMethod();
}
int testMethod(){
return 1;
}
}

View File

@ -0,0 +1,5 @@
class TestClass {
public TestClass(int a, int b){
}
}

View File

@ -0,0 +1,8 @@
class TestClass{
private int a;
public TestClass(int a){
this.a = a;
}
}

View File

@ -0,0 +1,10 @@
class TestClass{
public TestClass(){
int i = 0;
do{
i++
}while(i < 10);
}
}

View File

@ -0,0 +1,8 @@
class TestClass{
public TestClass(){
for(int i = 0; i < 10; i++){
int a;
}
}
}

View File

@ -0,0 +1,5 @@
class TestClass{
public static void main(String[] args) {
}
}

View File

@ -0,0 +1,8 @@
class TestClass{
int a;
public TestClass(){
this.a = null;
}
}

View File

@ -0,0 +1,18 @@
class TestClass{
TestClass testClass;
int testMethod1() {
return this.testMethod2()
}
int testMethod2() {
return 1;
}
int testMehtod3(){
TestClass testClass1 = new TestClass();
return testClass1.testClass.testMethod1();
}
}

View File

@ -0,0 +1,8 @@
class TestClass{
public int a;
public TestClass{
this.a = 1;
}
}

View File

@ -0,0 +1,3 @@
class TestClass{
void test(){}
}

View File

@ -0,0 +1,10 @@
class TestClass{
public TestClass(){
int i = 10;
while ( i > 0){
i--;
}
}
}

View File

@ -0,0 +1,34 @@
class TestClass{
int aPlusB(int a, int b){
return a + b;
}
int aMinusB(int a, int b){
return a - b;
}
int aTimeB(int a, int b){
return a * b;
}
int aDivB(int a, int b){
return a / b;
}
int colmplexCalc (int a, int b){
return a * (b / 1);
}
boolean aSmallerB (int a, int b){
return a < b;
}
boolean aGreaterB (int a, int b){
return a > b;
}
boolean aEqualsB (int a, int b){
return a == b;
}
}

View File

@ -0,0 +1,30 @@
class TestClass{
boolean true(){
return true;
}
boolean false(){
return false();
}
boolean trueAndTrue(){
return true && true;
}
boolean trueAndFalse(){
return true && true;
}
boolean falseAndFalse(){
return false && false;
}
boolean trueOrFalse(){
return true || false;
}
boolean falseOrFalse(){
return false || false;
}
}