Brian Gardner

Mocking Basics

Brian Gardner | Mar 19, 2018

Let's learn the basics of using mocking in your tests. Unit testing your classes helps ensure that they work correctly based on controlled inputs but doing the setup can be painful if you have a lot of dependencies.

In this video, we’ll show you how to create mock objects using Mockito to simplify your testing setup and improve the readability of your tests.

Basic knowledge or experience building Android applications is recommended. Viewers should be familiar with running unit tests and mock objects

For the More Curious...

Mock vs. Spy - Part 2
Building Effective Unit Tests
Mockito | GitHub
BNR Guide to Android
Android & Kotlin Courses

Subscribers Only

Transcripts are for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Subscribers Only

Project files are only available for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Need Help?

If you get stuck, try starting a discussion with Big Nerd Ranch experts in the community tab.

Related Screencasts

Explore other screencasts related to this topic.

ConstraintLayout

12 minutes

In this video you will learn about ConstraintLayout. It will cover how to use the graphical editor, how to add constraints to your views and tweak their attributes to position them on screen, and it has an example of converting an existing layout to use ConstraintLayout.

Implementing Adaptive Icons in Android

6 minutes

Android Oreo introduces Adaptive Icons which allow device manufacturers to choose the outline, or mask, of all app icons on the device. This guarantees that all app icons will be uniform on each device, whether they be square, rounded, or circular. In this screencast, part 2 of the series, we'll now show you how to generate your icon to take advantage of this new Android O feature.

Firebase Cloud Storage

10 minutes

Firebase Cloud Storage provides an easy way to store files remotely and fetch them when needed. In this video learn the basics of the cloud storage api to upload, download, and delete files.

Android BiometricPrompt

10 minutes

As of Android P, the FingerprintManager is deprecated in favor of the BiometricPrompt API. In this screencast, we’ll quickly review a previous FingerprintManager implementation and then dive into setting up your application to use BiometricPrompt.

App Shortcuts in Android

7 minutes

App shortcuts give you the ability to provide convenient shortcuts to specific actions in your application. They provide an entry point to different parts of your application. In this video learn how to implement app shortcuts and give your users quick access to the functionality they want.

Autosizing TextView

5 minutes

Android O has the ability to change the size of text in a TextView based on the size of the view. In this screencast learn how to add the autosizing and the different modes available.