Skip to content

Commit

Permalink
Add tests for HowManyTimesRotated (TheAlgorithms#3669)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshalkh authored Oct 26, 2022
1 parent 3aadb9d commit 0a5ee18
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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));
}
}

0 comments on commit 0a5ee18

Please sign in to comment.