Skip to content

Commit a6f7c26

Browse files
Update BridgesTest.java
1 parent 423cc3a commit a6f7c26

1 file changed

Lines changed: 9 additions & 36 deletions

File tree

‎src/test/java/com/thealgorithms/graph/BridgesTest.java‎

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -95,88 +95,61 @@ void testCycleWithTail() {
9595

9696
@Test
9797
void testNegativeVertexCountThrowsException() {
98-
assertThrows(
99-
IllegalArgumentException.class,
100-
() -> Bridges.findBridges(-1, new int[0][])
101-
);
98+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(-1, new int[0][]));
10299
}
103100

104101
@Test
105102
void testNullEdgesThrowsException() {
106-
assertThrows(
107-
IllegalArgumentException.class,
108-
() -> Bridges.findBridges(2, null)
109-
);
103+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, null));
110104
}
111105

112106
@Test
113107
void testMalformedEdgeThrowsException() {
114108
int[][] edges = {{0}};
115109

116-
assertThrows(
117-
IllegalArgumentException.class,
118-
() -> Bridges.findBridges(2, edges)
119-
);
110+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, edges));
120111
}
121112

122113
@Test
123114
void testEdgeWithTooManyVerticesThrowsException() {
124115
int[][] edges = {{0, 1, 2}};
125116

126-
assertThrows(
127-
IllegalArgumentException.class,
128-
() -> Bridges.findBridges(3, edges)
129-
);
117+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(3, edges));
130118
}
131119

132120
@Test
133121
void testNullEdgeThrowsException() {
134122
int[][] edges = {null};
135123

136-
assertThrows(
137-
IllegalArgumentException.class,
138-
() -> Bridges.findBridges(2, edges)
139-
);
124+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, edges));
140125
}
141126

142127
@Test
143128
void testNegativeFirstVertexThrowsException() {
144129
int[][] edges = {{-1, 1}};
145130

146-
assertThrows(
147-
IllegalArgumentException.class,
148-
() -> Bridges.findBridges(2, edges)
149-
);
131+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, edges));
150132
}
151133

152134
@Test
153135
void testNegativeSecondVertexThrowsException() {
154136
int[][] edges = {{0, -1}};
155137

156-
assertThrows(
157-
IllegalArgumentException.class,
158-
() -> Bridges.findBridges(2, edges)
159-
);
138+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, edges));
160139
}
161140

162141
@Test
163142
void testFirstVertexOutOfRangeThrowsException() {
164143
int[][] edges = {{2, 1}};
165144

166-
assertThrows(
167-
IllegalArgumentException.class,
168-
() -> Bridges.findBridges(2, edges)
169-
);
145+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, edges));
170146
}
171147

172148
@Test
173149
void testSecondVertexOutOfRangeThrowsException() {
174150
int[][] edges = {{0, 2}};
175151

176-
assertThrows(
177-
IllegalArgumentException.class,
178-
() -> Bridges.findBridges(2, edges)
179-
);
152+
assertThrows(IllegalArgumentException.class, () -> Bridges.findBridges(2, edges));
180153
}
181154

182155
@Test

0 commit comments

Comments
 (0)