<分区>
考虑函数:
public static ulong[] productFib(ulong prod)
{
ulong fib1 = 0;
ulong fib2 = 1;
while ((fib1 * fib2) < prod)
{
ulong temp = fib1;
fib1 = fib2;
fib2 = temp + fib2;
}
return new ulong[] { fib1, fib2, 1 };
}
我正在研究一个 kata,其测试如下所示:
ulong[] r = new ulong[] { 55, 89, 1 };
Assert.AreEqual(r, Kata.productFib(4895));
在立即窗口中,我可以看到返回数组不仅是 ulong
类型的但具有我期望的 3 个元素,但 MSTest 失败:
Message: Assert.AreEqual failed. Expected:<System.UInt64[]>. Actual:<System.UInt64[]>.
测试断言或我的函数是否有问题会导致此测试失败?
谢谢