-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Hi,
Small issue I noticed while playing around with Coverlet is that for code with no branches, 0% branch coverage is reported instead of 100%.
ConsoleApp1.csproj
Program.cs
using System;
namespace ConsoleApp1
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
ConsoleApp1.Tests.csproj
UnitTest1.cs
using System;
using Xunit;
namespace ConsoleApp1.Tests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
Program.Main(new string[] { });
}
}
}
Output
Test run for C:\src\ConsoleApp1\ConsoleApp1.Tests\bin\Debug\netcoreapp2.1\Consol
eApp1.Tests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1.7762 Seconds
Calculating coverage result...
Generating report 'C:\src\ConsoleApp1\ConsoleApp1.Tests\coverage.opencover.xml
'
+-------------+--------+--------+--------+
| Module | Line | Branch | Method |
+-------------+--------+--------+--------+
| ConsoleApp1 | 100% | 0% | 100% |
+-------------+--------+--------+--------+
Total Line: 100%
Total Branch: 0%
Total Method: 100%
Thanks!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers