Introduction to convention tests in .net

In one of our project we are using RabbitMQ queue for communication. In C# there is a popular library called MassTransit that (besides other things) allows you to use RabbitMQ. It is non trivial to test communication through external queue. At the same time there are many things that you need to remember in order to see message sent by a publisher later received by a consumer. That makes testing even more difficult, so we tried to unit-test as much things as possible to minimize scope of manual testing. One of the many things that you need to remember is that event class should have correct serialization attributes on each of property that we want to send. So we wrote the test that takes all implementations of our marker interface and for each of them we’ve checked if proper attribute is set on properties.
Continue reading “Introduction to convention tests in .net”