If there are more that one mock objects existing in the test, Mock.Assert wrongly succeeds while evaluating arrangements for each mock, but not the very first one. This is a regression compared to an older version from 2012. The following sample demonstrates the case:
public interface IFoo
{
void Bar();
}
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var bar = Mock.Create<IFoo>();
Mock.Arrange(() => bar.Bar()).OccursOnce();
var foo = Mock.Create<IFoo>();
Mock.Arrange(() => foo.Bar()).OccursOnce();
Mock.Assert(foo); // Would wrongly succeed
Mock.Assert(bar); // Would fail as expected
}
}