Add tests for HowManyTimesRotated (#3669)

This commit is contained in:
Harshal
2022-10-26 12:46:02 +05:30
committed by GitHub
parent 3aadb9da1e
commit 0a5ee18079

View File

@ -0,0 +1,17 @@
package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
public class HowManyTimesRotatedTest {
@Test
public void testHowManyTimesRotated() {
int[] arr1 = {5, 1,2,3,4};
assertEquals(1, HowManyTimesRotated.rotated(arr1));
int[] arr2 = {15,17,2,3,5};
assertEquals(2, HowManyTimesRotated.rotated(arr2));
}
}