Skip to content

Instantly share code, notes, and snippets.

@TrevorS
Created July 8, 2014 01:52
Show Gist options
  • Save TrevorS/aed5f749eff4cc22671a to your computer and use it in GitHub Desktop.
Save TrevorS/aed5f749eff4cc22671a to your computer and use it in GitHub Desktop.
public class Example {
private Api api;
@BeforeClass
public static void setupApi() {
api = new Api();
}
@Before
public static void createUsers() {
api.addUsers(getTestUsers());
}
@Test
public void testAddUsers() {
response = api.AddUsers(getTestUsers());
AssertTrue("test", response.isTest());
}
@Test
public void testGetUsers() {
response = api.getUsers();
AssertTrue(getTestUsers(), response.getUsers());
}
@Test
public void testDeleteUsers() {
response = api.deleteUsers();
AssertTrue(getTestUsers(), response.deleteUsers(getTestUsers));
}
@Test
public void testDeleteAllUsers() {
response = api.deleteAllUsers();
AssertTrue(getTestUsers(), response.deleteAllUsers());
AssertTrue(0, response.listUsers().size());
}
@AfterClass
public void cleanUpUsers() {
api.deleteAllUsers();
}
private List<Users> getTestUsers() {
// make users
return new List<Users>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment