0

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?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Alex Jeffery
  • 187
  • 3
  • 12

1 Answers1

0

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
  • 58,259
  • 26
  • 121
  • 165