Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Getting to 100%1:46 with Alena Holligan
Getting to 100%
Great, now you'll see that our last method is this toString method.
Let's see if we can add a test for that.
Give a little room.
And we're going to add a test,
We're gonna add a new recipe.
And we're going to AssertStringContainsString.
The following methods are available.
And the $recipe.
Let's run our test.
Great, we have 100% code coverage on our Recipe class.
But remember, that doesn't mean we're testing all scenarios.
For example, we are not testing that our title is transformed to title case,
even when entering all lowercase letters.
Some of the use cases may come to us in the form of a bug report.
If we add tests that test for those bugs, we can be sure that we will not
reintroduce them once we have fixed those bugs.
Why don't you practice your test skills by adding tests for
our other classes, the RecipeCollection and the Renderer.
You need to sign up for Treehouse in order to download course files.Sign up