/ea System.CodeDom.Compiler.GeneratedCodeAttribute
Or in case there that isn't an option to do that... do you know of
another way to exclude the (.Designer.cs) files generated by Visual
Studio when editing resource files that doesn't involve the
CoverageExclude attribute?
Thanks.
> Is there a way to pass extra command line arguments to NCover?
>
I'm afraid there isn't an option to do this at the moment. I will add
it to my issue tracker as a feature request.
I don't think there is a way to exclude methods based on their source
file in NCoverExplorer. Perhaps this could be added in a future
version. I've CCed Grant Drake with the suggestion.
Regards,
Jamie.
--
http://www.testdriven.net
http://weblogs.asp.net/nunitaddin
On Aug 28, 12:55 pm, "Jamie Cansdale" <jcansd...@gmail.com> wrote:
> Hi Julio,
>
> > Is there a way to pass extra command line arguments to NCover?
>
> I'm afraid there isn't an option to do this at the moment. I will add
> it to my issue tracker as a feature request.
That would help me a lot. Thank you.
If you can please make it a per project configuration setting. I
wouldn't mind if I can add a config file to my subversion repository
so people on my team share those settings.
> I don't think there is a way to exclude methods based on their source
> file in NCoverExplorer. Perhaps this could be added in a future
> version. I've CCed Grant Drake with the suggestion.
This would be another great solution because NCoverExplorer could
automatically exclude files generated by Visual Studio. Those aren't
usually tested either.
> Regards,
> Jamie.
>
> --http://www.testdriven.nethttp://weblogs.asp.net/nunitaddin
Yes but this problem is different. Let me explain it a little bit:
You can create an attribute like this:
sealed class CoverageExcludeAttribute : System.Attribute
{
}
and apply it to classes that don't need testing, but the problem here
is only visible with classes generated by Visual Studio because if you
add the attribute it will get overwritten on the next modification.
When the generated class is partial (Like with Settings classes) you
can add the attribute in other file, but with resources the class is
declared like this:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder",
"2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
The only solution I found was to use command line arguments to exclude
all classes that have the GeneratedCode attribute above, but it can't
be used from TestDriven.NET.
I'm hopping Jamie will be able to add this feature in a future
version.
Thanks