-
Notifications
You must be signed in to change notification settings - Fork 389
Coverlet fails with "Index was out of range" when assembly under test has no public methods #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
Something isn't working
Comments
We encountered a similar situation, but this time the test project itself contained a class that had no public methods in it. Adding a simple public property getter-setter fixed it. |
@andrewtyped I cannot repro, can you help me to understand what I'm missing?
|
Never mind...found it, I missed cobertura format. |
Close because fixed with newer version...works with 2.6.2
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is related to @csharpsi 's and @vikasillumina 's comments in #179 . Coverlet fails with the index out of range error when the assembly under test (not the test assembly itself) has no public methods. Adding a single public method to the assembly under test allows coverlet's report generation to succeed.
I have a minimal repository at https://github.com/andrewtyped/Coverlet.EmptyProjectIssue which demonstrates the issue - just run the
build.ps1
script to see the error during the Task_Test_My_Test_Project_net461 step. This runs a Cake script which in turn runsdotnet test
against the My.Test.Project.Test project. Sample output:The text was updated successfully, but these errors were encountered: