我一直在使用JustMock进行C#中的单元测试.我面临的问题是我无法断言内部调用的函数Parallel.Foreach.但是,可以断言内部完成的分配.
Parallel.ForEach(aList, entity =>
{
//Can be asserted using Assert(5,parameter.value) in the test
parameter.value = 5;
//Cannot be asserted, assertion fails Mock.Assert(parameter) in the test
//is arranged using MustBeCalled
parameter.call();
})
Run Code Online (Sandbox Code Playgroud)
我在其他测试用例中也发现了同样的问题.这是JustMock的一些错误行为吗?