我一直在使用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();
})
我在其他测试案例中也发现了相同的问题。这是JustMock的一些错误行为吗?