There are topics about tests that can sometimes go unnoticed, but when we analyze them carefully and dive into the studies to understand how much value we can extract from a certain topic, we are amazed. In this article, we will talk about branch in ...

Markdown supported · ⌘↵ to post
Good points made about the number of branches and complexity. I think it's important to consider that some branches could be guard statements at the beginning of methods, and it's important to keep those in place.
It looks like xUnit is being used in the PhoneTest example. I know it's possible to parameterise tests in NUnit for different inputs to quickly test various scenarios (e.g. input length); I think this is possible with xUnit too, so we don't have to write a test for each input.
I completely agree that we should try to simplify code where possible though, and that breaking it into smaller modules can help. I usually break long methods into separate service classes where possible and inject them using dependency injection. A bonus of this is that the logic can be tested independently, and test setup does not have to include code that would otherwise be used to navigate to the code that needs testing.
Rahul Shinde
hustling
Thanks for sharing Rafael dos Santos Miguel Filho