Skip to content

Commit 0a5ee18

Browse files
authored
Add tests for HowManyTimesRotated (TheAlgorithms#3669)
1 parent 3aadb9d commit 0a5ee18

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.thealgorithms.searches;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
public class HowManyTimesRotatedTest {
8+
9+
@Test
10+
public void testHowManyTimesRotated() {
11+
int[] arr1 = {5, 1,2,3,4};
12+
assertEquals(1, HowManyTimesRotated.rotated(arr1));
13+
int[] arr2 = {15,17,2,3,5};
14+
assertEquals(2, HowManyTimesRotated.rotated(arr2));
15+
}
16+
}
17+

0 commit comments

Comments
 (0)