public interface IMouseTraits
{
void ForceCursor(Cursor cursor);
void SetCursor(Cursor cursor);
}
1) How do I verify that the last call to SetCursor was with Cursors.Arrow (multiple calls to SetCursor and ForceCursor with varying arguments allowed).
2) How do I verify that the last call of both SetCursor and ForceCursor was SetCursor (multiple calls to SetCursor and ForceCursor with varying arguments allowed).
[Test]
public void AfterOperationCursorIsArrow()
{
var mock = new Mock<IMouseTraits>();
varw = new WindowOperation(mock.Object);
w.Execute();
mock.Verify(traits => traits.SetCursor(Cursors.Arrow)); // ?
}
You can use Callbacks to capture calls: