4 votes
Accepted

In testing is making asserts in cleanup bad?

I am less concerned about DRY code in unit tests, and more concerned about the test clearly stating the intended behavior. Doc Brown has sensible advice, but I would prefer the assert in each test. If ...
user avatar
3 votes

Mock a bean with 10 methods when I only use one?

A number of options come to mind: Decompose ServiceTwo into an additional interface that ServiceTwo inherits from. This new parent interface would define the two methods that ServiceOne needs, or a ...
user avatar
3 votes
Accepted

Is it worth testing simple details?

Does worth testing simple details? Maybe? I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence -- Kent Beck, 2008 ...
user avatar
2 votes

In testing is making asserts in cleanup bad?

This is ok as long as your test runner lets you still see easily which specific test caused the assertion to fail the failing assertion does not prevent the cleanup of the resources up to the point ...
user avatar
  • 184k
2 votes

Is it worth testing simple details?

Every unit of implementation code is an asset. Every unit test is a line in your insurance policy. You get to decide which assets are protected and how exactly how they're fixed or replaced when they ...
user avatar
  • 13.1k
1 vote
Accepted

What is a good way to call a unit-tested function provided by a library/package?

Encapsulating library functions makes most sense when your "own" interface main offers simplified access to the library, or at least provides a more precise or more readable name (assuming ...
user avatar
  • 184k
1 vote

How to properly isolate tests for dataframes with grouping?

More generally what you are describing is a Data-Driven Test. To echo Kilian Foth's comment, each data frame is not a separate test case. Each data frame represents a different input to the same test ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible