Summary

Throughout this chapter, we covered in great detail the why, when, and how of writing unit tests. There's a lot of information and nuance in this chapter. However, I hope you can walk away with not only a grasp of the fundamental pattern for unit testing, but also its three subpatterns of positive, negative, and permissions-based testing. Remember as well that a test method without at least one assert method is a liability. Furthermore, it's likely not going to be useful in the long run. Use asserts liberally. Assert not only the expected response of the unit of code, but also the data you created. Once your tests are written and passing, you'll be able to deploy your code to production. We'll talk about deployment strategies in our next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.202.209