How to detect whether a test passes or fails
In this chapter, the tests we’ll be creating are different enough from the creation tests that they should have their own file. When writing your own tests, you’ll want to organize them into multiple files, too.
Let’s create a new file called Confirm.cpp
and place it inside the tests
folder. With the new file, the project structure will look like the following:
MereTDD project root folder
Test.h
tests folder
main.cpp
Confirm.cpp
Creation.cpp
Then, add a single test to the new file so that it looks like this:
#include "../Test.h"
TEST("Test will pass without any confirms")
{
}
We already have an empty test in Creation.cpp
, which looks like this:
TEST("Test can be created")
{
}
The...