File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments