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
/** | |
* Get message from web server | |
* | |
* @return The message received | |
*/ | |
@WorkerThread | |
public String GetMessageFromWebServer(@NonNull Context context) { | |
... | |
try { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="id_message_request">57806d2e1000003c1f62fd31</string> | |
</resources> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="id_message_request">57806d521000002b1f62fd33</string> | |
</resources> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="id_message_request">57806d2e1000003c1f62fd31</string> | |
</resources> |
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 { | |
} | |
} |
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
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
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 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_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"); |