This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimpleLog extends AndroidTestCase { | |
private static final String TAG = "test"; | |
@Override | |
protected void setUp() throws Exception { | |
super.setUp(); | |
Log.d(TAG, "setUp"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DatabaseControllerTest extends AndroidTestCase{ | |
private DatabaseController databaseController; | |
@Override | |
protected void setUp() throws Exception { | |
super.setUp(); | |
final String prefixContext = "test_"; | |
RenamingDelegatingContext mockContext = new RenamingDelegatingContext(getContext(),prefixContext); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void test_check_insert_object() { | |
final String fakeRg = "0000000"; | |
Contact contact = new Contact(fakeRg); | |
contact.setAge(30); | |
contact.setEmail("[email protected]"); | |
contact.setName("Lopes"); | |
boolean result = databaseController.insertContact(contact); | |
Assert.assertEquals(true, result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("[email protected]"); | |
contact.setName("Lopes"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void test_remove_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("[email protected]"); | |
contact.setName("Lopes"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void test_remove_invalid_content() { | |
final String invalidRg = "12345678"; | |
//1 | |
//Check if a invalid content was not deleted | |
boolean result = databaseController.deleteContactByRg(invalidRg); | |
Assert.assertEquals(false, result); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void test_update_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("[email protected]"); | |
contact.setName("Lopes"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirstTest extends AndroidTestCase { | |
public void test_first_test_1() { | |
String firstObject = "Lopes"; | |
//This step won´t fail because it is not null | |
Assert.assertNotNull(firstObject); | |
String secondObject = "Lopes"; | |
//Check the content of object. This test won´t fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Check if the given object is not null | |
public void assertNotNull(Object object) | |
//Check if the given object is equals with actual value | |
public void assertEquals(Object expected, Object actual) | |
//Fail the current Test if any check was failed | |
public void fail(String message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
productFlavors { | |
production { | |
} | |
development { | |
} | |
} |
OlderNewer