---
title: "Discussion on \"Keeping Tests Valuable: Avoid Problems In The Act Blocks\" | Hashnode"
description: "Discussion on \"Keeping Tests Valuable: Avoid Problems In The Act Blocks\". Unit testing is like a microscope that allows you to examine the smallest details of your code"
url: "https://hashnode.com/posts/keeping-tests-valuable-avoid-problems-in-the-act-blocks/6404ee122504533242704d70"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Keeping Tests Valuable: Avoid Problems In The Act Blocks](https://thepragmaticengineer.hashnode.dev/keeping-tests-valuable-avoid-problems-in-the-act-blocks?utm_source=hashnode&utm_medium=feed)

Unit testing is like a microscope that allows you to examine the smallest details of your code

Mar 5, 2023 · 12 min read · thepragmaticengineer.hashnode.dev  
Read the article

-   [#web-development](https://hashnode.com/tag/web-development)
-   [#developer](https://hashnode.com/tag/developer)
-   [#unit-testing](https://hashnode.com/tag/unit-testing)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#csharp](https://hashnode.com/tag/csharp)

## Written by

[Rafael dos Santos Miguel Filho](https://hashnode.com/@ThePragmaticEngineer)

@ThePragmaticEngineer · Brazil

  
[View profile](https://hashnode.com/@ThePragmaticEngineer)

Software Engineer

Hi, I'm Rafael, but you can call me Rafa! 😄 I'm a software engineer passionate about everything that involves technology, with more than 5 years of experience in the market. Throughout my career, I worked in banking institutions, developing innovative solutions and contributing to the digital transformation of the financial sector. With a strong interest in software architecture and testing, I am constantly looking to specialize and improve my skills in this area. Here, you will find tips, tutorials and discussions on the most varied topics related to architecture, good practices and software testing, always with the aim of sharing knowledge and learning from other developers. I value the exchange of experiences and I am always willing to listen and learn from my professional colleagues. Feel free to get in contact, leave your comments and share your own experiences and knowledge. Together, we can build a stronger, more collaborative community in the software development world.

## Responses 1

Markdown supported · ⌘↵ to post

[Anthony Fung](https://hashnode.com/@anthonyf)

[Mar 14, 2023](https://hashnode.com/posts/keeping-tests-valuable-avoid-problems-in-the-act-blocks/6404ee122504533242704d70/comment/6410f0f0d0ccf16ed81830b0)

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.

[Rafael dos Santos Miguel Filho](https://hashnode.com/@ThePragmaticEngineer)

[Mar 16, 2023](https://hashnode.com/posts/keeping-tests-valuable-avoid-problems-in-the-act-blocks/6404ee122504533242704d70/comment/6410f0f0d0ccf16ed81830b0#reply-641296650dd7cb923f69468d)

Exactly [Anthony Fung](https://hashnode.com/@anthonyf), 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.
