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
Autoplay

Up next

Previous

About

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.

Links
- Robolectric

Comments

This shouldNotBeNull was failing for me.

So I took a look at this link:
http://robolectric.org/getting-started/

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:
https://stackoverflow.com/questions/52883747/robolectric-runtimeenvironment-application-is-deprecated-where-is-applicationpr
http://robolectric.org/migrating/

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

>
You need to go PRO to post comments.

Lessons in Robolectric 3