- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloneGraphTest.java
More file actions
Latest commit
28 lines (25 loc) · 967 Bytes
/
Copy pathCloneGraphTest.java
File metadata and controls
28 lines (25 loc) · 967 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
26
27
28
importorg.example.helpers.graph.Node;
importorg.example.problems.clone_graph.Solution;
importorg.junit.jupiter.api.Assertions;
importorg.junit.jupiter.params.ParameterizedTest;
importorg.junit.jupiter.params.provider.Arguments;
importorg.junit.jupiter.params.provider.MethodSource;
importjava.util.stream.Stream;
publicclassCloneGraphTest {
privatestaticStream<Arguments> provideCases() {
returnStream.of(
Arguments.of(Node.createFromArray(newint[][]{{2, 4}, {1, 3}, {2, 4}, {1, 3}})),
Arguments.of(Node.createFromArray(newint[][]{{}})),
Arguments.of(Node.createFromArray(newint[][]{}))
);
}
@ParameterizedTest
@MethodSource("provideCases")
publicvoidtest(Nodenode) {
Solutions = newSolution();
Assertions.assertEquals(node, s.cloneGraph(node));
if (node != null) {
Assertions.assertNotSame(node, s.cloneGraph(node));
}
}
}