Blog
Tag: Test

YAGNI - 'Poor-mans CQRS' sample application with Entity Framework

by Daniel Palme 1 Comments

Entity FrameworkThis week Daniel Lang published an interesting article about unnecessary overhead in simple applications.
In a nutshell he proposes an architecture called "Poor-mans CQRS". In his sample he uses an ASP.NET MVC application. The controllers retrieve their required data directly from the database (Query), and updates are performed in service layer (Command).
In this post I will provide a (simple) application, which is based on the Entity Framework. It shows the principle and explains how unit tests can be written without querying a real database.

Continue reading ...

Code Coverage - Testing with OpenCover and PartCover

by Daniel Palme 9 Comments

CoverageJust some days ago, a new code coverage tool was released for the first time. It's called OpenCover. Shaun Wilde created this tool, since PartCover 4 has some issues that are difficult to resolve with the current code base. He describes some of them on his blog.
In this post I will do a comparison between OpenCover and PartCover and show how these tools can be used to get the coverage of unit tests.

Continue reading ...

PartCover - Coverage of unexecuted methods - Part 2

by Daniel Palme 3 Comments

Coverage A few weeks ago I blogged about a problem concerning coverage of unexecuted code in PartCover. The problem was that the report generated by PartCover does not contain any coverage information about uncovered methods. That implicated, that my tool ReportGenerator calculated a wrong coverage quota, since the lines of unexecuted method were considered to be 'not visitable'.
I claimed that it would not be easy to create a workaround for the problem, but actually it isn't that difficult, if you use the right tools.

Continue reading ...

PartCover - Coverage of unexecuted methods

by Daniel Palme 5 Comments

Coverage During the last weeks I received several emails pointing me to a potential issue in my tool ReportGenerator. The problem is that methods that have not been executed during a test run using PartCover, are marked as 'not visitable'.
I decided to take a closer look at the problem. In this post I will explain how ReportGenerator works and why it is not easy to create a workaround for the deficiency of PartCover.

Continue reading ...