forked from vrajpurohit7/markdown-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkdownParseTest.java
More file actions
27 lines (24 loc) · 959 Bytes
/
MarkdownParseTest.java
File metadata and controls
27 lines (24 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//the below 2 lines are importing the files needed
// for the code to run correctly
import static org.junit.Assert.*;
import org.junit.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
//this class contains test cases
public class MarkdownParseTest {
@Test //here's the 1st test case
public void addition() { //it checks for addition
assertEquals(2, 1 + 1);
// the above line checks the 1st and 2nd parameters
// and returns true if they are equal and false if not.
}
@Test
public void test1() throws Exception{
Path fileName = Path.of("C:/Users/SBICGuest/OneDrive/Documents/GitHub/markdown-parser/test-file.md");
String content = Files.readString(fileName);
List<String> expected = new ArrayList<>(List.of("https://something.com", "some-thing.html"));
assertEquals(expected, MarkdownParse.getLinks(content));
}
}