Skip to content

Instantly share code, notes, and snippets.

@thiagoolsilva
Created May 19, 2016 15:44
Show Gist options
  • Save thiagoolsilva/0b722077553680bad989ea58361dd8c2 to your computer and use it in GitHub Desktop.
Save thiagoolsilva/0b722077553680bad989ea58361dd8c2 to your computer and use it in GitHub Desktop.
public void test_check_fetch_content() {
//1.
//Insert the content and check if the test was successfully
final String fakeRg = "0000000";
Contact contact = new Contact(fakeRg);
contact.setAge(30);
contact.setEmail("thiagoolsilva@gmail.com");
contact.setName("Lopes");
boolean result = databaseController.insertContact(contact);
Assert.assertEquals(true, result);
//2
//Fetch the content and check its content
Contact queryContact = databaseController.getContactByRg(fakeRg);
//3
//Check the name
Assert.assertEquals(contact.getName(), queryContact.getName());
//4
//Check the Age
Assert.assertEquals(contact.getAge(), queryContact.getAge());
//5
//Check the Email
Assert.assertEquals(contact.getEmail(), queryContact.getEmail());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment