minicover doesn't work with init properties

Viewed 19

Steps to reproduce:

Create project in rootDir\src\ProjectToTest with class

public class Entity
{
    public string Property {get;init;}
}

Create unit test project in rootDir\test\TestProject with test

public class UnitTest1
{
     [Fact]
     public void Test1()
     {
        var fixture = new Fixture();
        var instance = fixture.Build<Entity>().With(x => x.Property, "1").Create();            
     }
}

Run in cmd:

dotnet clean
dotnet restore
dotnet build
dotnet minicover instrument 
dotnet test --no-build

on last command occurs exception

System.InvalidProgramException : Common Language Runtime detected an invalid program

0 Answers
Related