views:

207

answers:

1

I am trying out the .net Code Contracts fro .net 3.5 I have some unit test that I am running PartCover over to calculate the code coverage.

PartCover keeps including the System.Diagnostics.Contracts in my report. Here are the rules I am using to include MyProject and exclude everything else.

  <Rule>+[MyProject.DomainModel]*</Rule>
  <Rule>-[System]*</Rule>
  <Rule>-[System.Diagnostics]*</Rule>
  <Rule>-[System.Diagnostics.Contracts]*</Rule>

Any suggestions?

A: 

PartCover's rule syntax is [assemblyname]namespace, the contracts come from the Microsoft.Contracts assembly and therefore the configuration has to look like this:

<Rule>+[MyProject.DomainModel]*</Rule>
<Rule>-[Microsoft.Contracts]*</Rule>

Read the PartCover Console Manual that is installed with PartCover for more details.

David Schmitt