The Arrange-Act-Assert (A-A-A) convention is widely used when creating unit tests to ensure organization and clarity. Probably most developers have worked with this convention. But even though it is a great convention, we need to be careful about how...

Markdown supported · ⌘↵ to post
Exactly Anthony Fung, it already falls in frontend cases in specific situations where it was necessary to perform two actions. In most cases this was not necessary. When I began to apply a critical eye more frequently to unit tests, I began to observe that the more actions in a single test method, the more easily it broke.
Anthony Fung
Angular/.NET Web developer. I write insights, thoughts, and stories to help software developers build a solid foundation for their skills
Completely agree that a single-line Act is preferable in most cases.
There are occasionally exceptions to this. One example is when unit testing Observables, it might be necessary to manually advance the test scheduler clock.