You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespace CoverletAsyncAwait;
public class SomeClass
{
public async Task SomeMethod()
{
await SomeInternalMethod(async () =>
{
await using var stream = new MemoryStream();
await Task.CompletedTask;
});
}
private static async Task SomeInternalMethod(Func<Task> work)
{
await work();
}
}
Test:
using System.Threading.Tasks;
using NUnit.Framework;
namespace CoverletAsyncAwait.Tests;
[TestFixture]
public class TestSomeClass
{
[Test]
public async Task SomeTest()
{
var someClass = new SomeClass();
await someClass.SomeMethod();
}
}
Expected:
Full branch coverage
Actual:
Partially covered (1 visits, 4 of 6 branches are covered)
Hi guys!
Found one more interesting case.
Code:
Test:
Expected:
Full branch coverage
Actual:
Partially covered (1 visits, 4 of 6 branches are covered)
Output:

Report:
Reproduced in .NET 6, Coverlet 3.1.1
The text was updated successfully, but these errors were encountered: