Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Unit Testing in Java!
You have completed Unit Testing in Java!
Preview
Let's explore how we actually verify, or assert, that our code works as expected.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
that help promote
the writing of good tests.
0:00
This first one you'll hear a lot, and
0:00
it's used to help you remember
how to lay out your tests.
0:02
AAA is this.
0:05
Arrange, in most cases you'll need to
get things all set up before the test.
0:07
To get things in the right
state before the test
0:11
you need to arrange your objects so
they're ready to be tested.
0:13
Act, in the act portion of test you cause
the behavior that your testing to happen,
0:17
whatever that action might be.
0:21
Assert, in the assert portion you verify
that the expected behavior occurred.
0:23
Let's go write some tests
using the AAA style.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up