Skip to content

Commit 559b4d0

Browse files
committed
fix: Readme
1 parent 6cbcd51 commit 559b4d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
- [Local Tests](#local-tests)
1616
- [JUnit basics](#junit-basics)
1717
- [Beyond JUnit basics](#beyond-junit-basics)
18-
- [Local test setup and execution](#)
19-
- [Adding local tests and failure](#)
2018
- [Assertions](#assertions)
2119
- [Hamcrest](#hamcrest)
2220
- [Assertj](#assertj)
@@ -163,9 +161,11 @@ public void testDivWithZeroDivisor() {
163161
assertEquals("Calculator is not handling division by zero correctly", 0.0, total, 0.0);
164162
}
165163
```
166-
### Local test setup and execution
167-
### Adding local tests and failure
164+
168165
### Assertions
166+
167+
JUnit provides overloaded assertion methods for all primitive types and Objects and arrays (of primitives or Objects). The parameter order is expected value followed by actual value. Optionally the first parameter can be a String message that is output on failure. There is a slightly different assertion, assertThat that has parameters of the optional failure message, the actual value, and a Matcher object. Note that expected and actual are reversed compared to the other assert methods.
168+
169169
[AssertTests.java](https://github.com/ravidsrk/android-testing-guide/blob/master/SampleApp/app/src/test/java/in/ravidsrk/sample/AssertTests.java.java)
170170

171171
```java
@@ -239,6 +239,7 @@ public class AssertTests {
239239
assertTrue("failure - should be true", true);
240240
}
241241
}
242+
```
242243

243244
### Hamcrest
244245

@@ -1012,6 +1013,7 @@ emulator.press('KEYCODE_HOME','DOWN_AND_UP')
10121013
```
10131014

10141015
## References
1016+
* <https://github.com/junit-team/junit4/wiki/assertions>
10151017
* <https://github.com/googlesamples/android-testing>
10161018
* <https://riggaroo.co.za/introduction-automated-android-testing/>
10171019
* <http://robolectric.org>

0 commit comments

Comments
 (0)