Summary
In this chapter, we discussed what unit tests are and saw some easy unit tests in action. We learned about the different assert functions available in XCTest
, the testing framework provided by Apple. By writing our own assert function, we learned to improve the log output and what needs to be done to make it behave like built-in functions. This chapter concluded with other kinds of tests and how they differ from unit tests.
In the next chapter, we will learn what TDD is, and what its advantages and disadvantages are.