if you use the C# using declaration and have JustMock advanced (elevated) mode enabled, the runtime will throw an InvalidProgramException.
Find below the sample code that demonstrates the issue:
public class TestClass : IDisposable
{
public void Dispose()
{
}
}
[TestClass]
public class Fixture
{
public interface ITest { }
[TestMethod]
public async Task Test()
{
ITest mock = Mock.Create<ITest>();
using TestClass test = new();
}
}