Test-Driven Test Development
Writing a Red Test
Example Tests.cs
File
void TestShouldPass() {
// Do nothing
}
void TestShouldFail() {
throw new System.Exception("Kaboom!");
}
That’s it. No using
statements. Just a tiny file with 2 methods. They’re not even public
.
Now, we have two options:
- Write implementation code to run these two tests and print out the results
- Write integration test which runs these two tests and verifies the results are printed correctly.
Either approach is valid. We can treat our new Tests.cs
as a failing test, conceptually.
But let’s go ahead and setup a real integration test which we can add to during development!