有没有办法让 rhino.mocks 在 .NET 6 平台的测试项目中工作?
调用下面的代码时(在 .NET 6 项目下),我总是遇到异常。
例外:
Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.'
代码:
public interface IFoo
{
void Go();
int Run();
}
[TestFixture]
public class UnixTest
{
private MockRepository _repo;
[SetUp]
public void Setup()
{
_repo = new MockRepository();
}
[Test]
public void Test()
{
var stub = _repo.StrictMock<IFoo>();
Assert.NotNull(stub);
}
}