Skip to content

Commit cbc177d

Browse files
Added main test file
1 parent 67a7ca7 commit cbc177d

File tree

1 file changed

+26
-0
lines changed
  • src/test/java/com/cmpe202/individualproject/main

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.cmpe202.individualproject.main;
2+
3+
import org.junit.Assert;
4+
import org.junit.jupiter.api.Test;
5+
6+
class AppTest {
7+
8+
@Test
9+
void checkforValidFileType() {
10+
// Test case for checking a valid file type
11+
String inputFile = "src/test/java/sampleFiles/inputxmlcopy.xml";
12+
App appObj = new App();
13+
String result = appObj.getFileType(inputFile);
14+
Assert.assertEquals(result, "xml");
15+
}
16+
17+
@Test
18+
void checkforInvalidFileType() {
19+
// Test case for checking an invalid file type
20+
String inputFile = "src/test/java/sampleFiles/inputxmlcopy.xml";
21+
App appObj = new App();
22+
String result = appObj.getFileType(inputFile);
23+
Assert.assertNotEquals(result, "json");
24+
}
25+
26+
}

0 commit comments

Comments
 (0)