我得到一个转换异常二维对象数组返回类型 - NSubstitute
System.InvalidCastException:无法转换类型的对象 'System.Object的[]' 为类型 'System.Object的[,]'。在TestTest.cs 在Castle.Proxies.ITestProxy.Get2DArray() 在Scratch.TestFixture.Get2DArray():17行
从下面:
[TestFixture]
public class TestFixture
{
[Test]
public void Get2DArray()
{
Substitute.For<ITest>().Get2DArray().Returns(new object[1,1]);
}
}
public interface ITest
{
object[,] Get2DArray();
}
任何人都可以扔任何光上这个?我在想这是一个NSubstitute错误?
您使用的是哪个版本的NSubstitute? – payo 2012-03-28 19:09:59
我现在远离我的工作站,所以无法检查,但今天下午我通过NuGet安装,如果有帮助的话。 – 2012-03-28 19:53:06
@MylesMcDonnell:MS声称在.NET 4中修复了SRE错误。 – leppie 2012-03-29 09:35:35