Skip to Content
Unit Testing Principles, Practices, and Patterns
book

Unit Testing Principles, Practices, and Patterns

by Vladimir Khorikov
January 2020
Intermediate to advanced
304 pages
9h 8m
English
Manning Publications
Content preview from Unit Testing Principles, Practices, and Patterns

Chapter 3. The anatomy of a unit test

This chapter covers

  • The structure of a unit test
  • Unit test naming best practices
  • Working with parameterized tests
  • Working with fluent assertions

In this remaining chapter of part 1, I’ll give you a refresher on some basic topics. I’ll go over the structure of a typical unit test, which is usually represented by the arrange, act, and assert (AAA) pattern. I’ll also show the unit testing framework of my choice—xUnit—and explain why I’m using it and not one of its competitors.

Along the way, we’ll talk about naming unit tests. There are quite a few competing pieces of advice on this topic, and unfortunately, most of them don’t do a good enough job improving your unit tests. In this chapter, I describe those ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unit Testing Principles, Practices, and Patterns

Unit Testing Principles, Practices, and Patterns

Vladimir Khorikov
Design Patterns: Elements of Reusable Object-Oriented Software

Design Patterns: Elements of Reusable Object-Oriented Software

Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides

Publisher Resources

ISBN: 9781617296277Publisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link