Capturing application logging in MsTest

In a lot of projects I have been on I’ve seen the following approaches when it comes to application logging in test: The most popular option: It is completely ignored, either by pumping it into a mock or a NullLogger It is tested by verifying that the correct log messages are written. This is usually done to satisfy a ‘strict’ mocking framework. Neither of these options are ideal in my opinion. …

SQL Server integration testing using xUnit

Recently I wanted to verify that my data access layer could properly read and write to a SQL Server database, and I wanted to have these tests automated. I wanted to answer these questions: Can my DbContext roundtrip entities to the database and back? Does the schema in my migration scripts match the expected schema in my code? (follows from 1) Can my migration scripts be applied to the database correctly? …