package com.geth1b.coding.skills.lc;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;

/**
 * @author geth1b
 */
public class _403_FrogJump_Test {
  private _403_FrogJump solution;
  
  @Before public void setUp() {
    solution = new _403_FrogJump();
  }
  
  @Test public void canCross_1() {
    assertTrue(solution.canCross(new int[]{0,1,3,4,5,7,9,10,12}));
    assertTrue(solution.canCross(new int[]{0,1,3,5,6,8,12,17}));
    assertFalse(solution.canCross(new int[]{0,1,2,3,4,8,9,11}));
  }
  
  @Test public void canCross_edgeCase1() {
    int[] stones = new int[]{0,1,3,6,10,11}; // cannot jump from 10->11
    assertFalse(solution.canCross(stones));
  }
  
  @Test public void canCross_edgeCase2() {
    int[] stones = new int[]{0,1,3,6,10,11,15}; // fail 10->11; but ok for 10->15
    assertTrue(solution.canCross(stones));
  }  
}
