forked from nidhidhamnani/markdown-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkdownParseTest.java
More file actions
54 lines (51 loc) · 1.76 KB
/
MarkdownParseTest.java
File metadata and controls
54 lines (51 loc) · 1.76 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import static org.junit.Assert.*;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import org.junit.*;
public class MarkdownParseTest {
@Test
public void addition() {
assertEquals(2, 1 + 1);
}
@Test
public void test1() throws IOException{
ArrayList<String> links = new ArrayList<>();
Path fileName = Path.of("test-file.md");
String content = Files.readString(fileName);
links.add("https://something.com");
links.add("some-thing.html");
assertEquals(links, MarkdownParse.getLinks(content));
}
@Test
public void test2() throws IOException{
ArrayList<String> links = new ArrayList<>();
Path fileName = Path.of("test-file3.md");
String content = Files.readString(fileName);
assertEquals(links, MarkdownParse.getLinks(content));
}
@Test
public void test3() throws IOException{
ArrayList<String> links = new ArrayList<>();
Path fileName = Path.of("test-file2.md");
String content = Files.readString(fileName);
assertEquals(links, MarkdownParse.getLinks(content));
}
@Test
public void test4() throws IOException{
ArrayList<String> links = new ArrayList<>();
Path fileName = Path.of("test-file4.md");
String content = Files.readString(fileName);
links.add("https://something.com");
assertEquals(links, MarkdownParse.getLinks(content));
}
@Test
public void test5() throws IOException{
ArrayList<String> links = new ArrayList<>();
Path fileName = Path.of("test-file5.md");
String content = Files.readString(fileName);
assertEquals(links, MarkdownParse.getLinks(content));
}
}
//comment