Skip to content

Instantly share code, notes, and snippets.

@theresajayne
Created October 2, 2014 04:40
Show Gist options
  • Select an option

  • Save theresajayne/b21d9c7e273f956e9c33 to your computer and use it in GitHub Desktop.

Select an option

Save theresajayne/b21d9c7e273f956e9c33 to your computer and use it in GitHub Desktop.
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
/**
* Created by Theresa on 02/10/2014.
*/
public class ValidInputTest {
private ValidInput validInput;
@Before
public void setUp()
{
validInput = new ValidInput();
}
@Test
public void testNegative()
{
assertThat(validInput.isValidInput(-1),is(false));
}
@Test
public void testPositive()
{
assertThat(validInput.isValidInput(101),is(false));
}
@Test
public void testMiddle()
{
assertThat(validInput.isValidInput(50),is(true));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment