In this movie, you'll learn about the JUnit Assertion class and static methods, JUnit best practices, and the Hamcrest library for assertions.
- [Voiceover] Earlier in this course,…I introduced the concept of assert statement…to check the correctness of results produced…by the methods and codes you are testing.…J unit provides an assert class org J unit assert,…containing many assertions,…that is the collective name given to the set…of static methods in the assert class.…Like the java lang math class,…the assert class is a class with only static methods.…As shown by this representative sample here,…assert holds static methods to validate the result return…is true or false, equal to an expected result,…is null or not null,…does the array of a specific type like byte, care, int,…long match the expected array and more.…
Most of the assert methods take two parameters.…With the first parameter, the expected value,…and the second parameter being the value returned…by the method under test to be compared…against the expected value.…All the assert methods also come with an overloaded method,…that is a second signature as well.…The alternate methods, the overloaded methods,…
AuthorJames P White
- Why unit test?
- Unit testing tools
- Local testing with JUnit
- Working with JUnit assertions, rules, and categories
- Executing instrumented tests
- Filtering tests
- Testing with UI Automator and other testing tools
Skill Level Intermediate
Foundations of UX: Usability Testingwith Chris Nodder1h 29m Beginner
1. Getting Started
2. Local Tests
3. Instrumented Tests
4. Other Android SDK Testing Tools
5. Mocking objects
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.