Search⌘ K

Our First Passing Test

Explore how to write your first passing unit test for a Java class using JUnit. Learn about the ScoreCollection class and how JUnit executes tests from top to bottom, passing tests if no assertions fail. This lesson helps you grasp foundational concepts of test execution and basic test writing in JUnit.

We'll cover the following...

For our first example, we’ll write tests against a small class named ScoreCollection. Its goal is to return the mean (average) for a collection of scoreable objects (things that answer with a ...