axodox / AxoCover

Nice and free .Net code coverage support for Visual Studio with OpenCover.
https://marketplace.visualstudio.com/items?itemName=axodox1.AxoCover
MIT License
248 stars 60 forks source link

Adding new exclude attribute #153

Closed mkbansal145 closed 6 years ago

mkbansal145 commented 6 years ago

Hi Team,

How can I add one more parameter in Exclude Attributes in settings after System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute

and would it possible to skip mock object inside a test method.

Thanks Mayank

axodox commented 6 years ago

Just do this: MyAttribute;MyOtherAttribute

You can flag classes and methods with this, so it should help your case.

mkbansal145 commented 6 years ago

Hi Peter

My Apologies but I am working on this for the first time so need a little more help.

For e.g. my class is

[TestFixture] public class Testclass { [Test] public void TestMethod() { int b = 10; Mock.Arrange(() => foo.add(x,y).IgnoreInstance().Returns(10);

        //Act
        int a = foo.calculator();

        //Assert
        Assert.AreEqual(a, b);
    }
}

and I want to exclude the Mock.arrange part from code coverage, now how and what should I add in exclude attributes in axo settings.

Thanks Mayank

On Tue, Mar 6, 2018 at 11:06 PM, Péter Major notifications@github.com wrote:

Just do this: MyAttribute;MyOtherAttribute

You can flag classes and methods with this, so it should help your case.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/axodox/AxoCover/issues/153#issuecomment-370863730, or mute the thread https://github.com/notifications/unsubscribe-auth/AgpR0OTk4MWik7PTnfHJqg61oOBPr9wgks5tbskngaJpZM4SfH1V .