Sign in Go Pro

Robolectric 3

Testing Activity Views with RobolectricTesting Activity Views

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



In this Lesson you will learn:
- How TDD works on Android.
- How to test TextView and its attributes.
- How to create a helper for resource fetching.
- How to create a helper for view assertions.

- Robolectric




This shouldNotBeNull was failing for me.

So I took a look at this link:

And solved it.

Corey Latislaw, in order to help future students, I advise you to update this info in this video, or at least in the video description.

Well, I tried to update the Deprecated classes, adding
testImplementation 'androidx.test:core:1.0.0' instead of testImplementation 'org.robolectric:robolectric:4.2'.

Unfortunately, the app now doesn't run.

Those are the links I followed:

Also, the statements below are now red:
activity = Robolectric.buildActivity(RobolectricActivity.class);

You need to go PRO to post comments.

Lessons in Robolectric 3