“Arrange-Act-Assert” a pattern for arranging code in UnitTest

Each method should group code into these functional sections, separated by blank lines: Arrange all necessary preconditions and inputs.Act on the object or method under test.Assert that the expected results have occurred. Examples Benefits Clearly separates what is being tested from the setup and verification steps. Clarifies and focuses attention on a historically successful and generally necessary set of test steps. Makes some Test-Smells more obvious Assertions intermixed with “Act” …

“Arrange-Act-Assert” a pattern for arranging code in UnitTest Read More »

Test Double

Gerard Meszaros is working on a book to capture patterns for using the various Xunit frameworks. One of the awkward things he’s run into is the various names for stubs, mocks, fakes, dummies, and other things that people use to stub out parts of a system for testing. To deal with this he’s come up with his own vocabulary which I think is worth spreading further. The generic term he uses is a Test Double (think …

Test Double Read More »

Scroll to Top