Automatic Rollback to Integration Tests in C#

This is something that has made my integration tests better. You define a test method to run in transaction and rollback at the end of each test. This makes it possible to write integration tests that write to the database. And tests won't leave any "garbage" there because rollback at the end of the test undoes all database updates (and inserts and deletes). If this is possible in your language and testing framework I strongly recommend it. In this blog post I will explain how you can do it with NUnit in C#.

Constant or static readonly?

SonarQube has two rules about constant and static readonly:
- Public constant members should not be used and
- Static readonly constants should be const instead.
I wrote this blog post to learn these rules and their difference. Now I know when to use const and when to use static readonly.