Skip to content

Commit 9980969

Browse files
committed
added test
1 parent 4f8603e commit 9980969

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/test/java/com/fishercoder/_2Test.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,38 @@
1010

1111
public class _2Test {
1212
private static _2.Solution1 solution1;
13+
private static _2.Solution2 solution2;
1314
private static ListNode l1;
1415
private static ListNode l2;
1516
private static ListNode expected;
1617

1718
@BeforeClass
1819
public static void setup() {
1920
solution1 = new _2.Solution1();
21+
solution2 = new _2.Solution2();
2022
}
2123

2224
@Test
2325
public void test1() {
2426
l1 = LinkedListUtils.contructLinkedList(new int[]{2, 4, 3});
2527
l2 = LinkedListUtils.contructLinkedList(new int[]{5, 6, 4});
2628
expected = LinkedListUtils.contructLinkedList(new int[]{7, 0, 8});
27-
assertEquals(expected, solution1.addTwoNumbers(l1, l2));
29+
assertEquals(expected, solution2.addTwoNumbers(l1, l2));
2830
}
2931

3032
@Test
3133
public void test2() {
3234
l1 = LinkedListUtils.contructLinkedList(new int[]{1, 8});
3335
l2 = LinkedListUtils.contructLinkedList(new int[]{0});
3436
expected = LinkedListUtils.contructLinkedList(new int[]{1, 8});
35-
assertEquals(expected, solution1.addTwoNumbers(l1, l2));
37+
assertEquals(expected, solution2.addTwoNumbers(l1, l2));
3638
}
3739

3840
@Test
3941
public void test3() {
4042
l1 = LinkedListUtils.contructLinkedList(new int[]{5});
4143
l2 = LinkedListUtils.contructLinkedList(new int[]{5});
4244
expected = LinkedListUtils.contructLinkedList(new int[]{0, 1});
43-
assertEquals(expected, solution1.addTwoNumbers(l1, l2));
45+
assertEquals(expected, solution2.addTwoNumbers(l1, l2));
4446
}
4547
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy