Skip to content

Commit fd5e7d4

Browse files
committed
Added tests for task 224 and 231.
1 parent 8555b7c commit fd5e7d4

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/test/java/g0201_0300/s0224_basic_calculator/SolutionTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,14 @@ public class SolutionTest {
1010
public void calculate() {
1111
assertThat(new Solution().calculate("1 + 1"), equalTo(2));
1212
}
13+
14+
@Test
15+
public void calculate2() {
16+
assertThat(new Solution().calculate(" 2-1 + 2 "), equalTo(3));
17+
}
18+
19+
@Test
20+
public void calculate3() {
21+
assertThat(new Solution().calculate("(1+(4+5+2)-3)+(6+8)"), equalTo(23));
22+
}
1323
}

src/test/java/g0201_0300/s0231_power_of_two/SolutionTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,24 @@ public class SolutionTest {
1010
public void isPowerOfTwo() {
1111
assertThat(new Solution().isPowerOfTwo(1), equalTo(true));
1212
}
13+
14+
@Test
15+
public void isPowerOfTwo2() {
16+
assertThat(new Solution().isPowerOfTwo(16), equalTo(true));
17+
}
18+
19+
@Test
20+
public void isPowerOfTwo3() {
21+
assertThat(new Solution().isPowerOfTwo(3), equalTo(false));
22+
}
23+
24+
@Test
25+
public void isPowerOfTwo4() {
26+
assertThat(new Solution().isPowerOfTwo(4), equalTo(true));
27+
}
28+
29+
@Test
30+
public void isPowerOfTwo5() {
31+
assertThat(new Solution().isPowerOfTwo(5), equalTo(false));
32+
}
1333
}

0 commit comments

Comments
 (0)