S
S
Skoleev2021-08-26 00:31:41
Java
Skoleev, 2021-08-26 00:31:41

Am I naming the tests correctly?

I use the naming shouldBehavoir_whenStateUnderTest.
But when I need to test a banal update in the service, what would be the right name for the test then?
shouldUpdateEntity_whenUpdate sounds silly.
Or return all Entities then shouldGetAllEntities_whenGetAll?
The question seems stupid and obvious, but for several days now I have been thinking that something is wrong with my naming and I would be happy to help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-08-26
Hasanly @azerphoenix

Good afternoon.
The question is not stupid. After all, how well your code will be readable depends on the correct naming.
Here, information about the test naming convention.
https://dzone.com/articles/7-popular-unit-test-naming

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question