How to mock the following method:
public class TimeService : ITimeService { public void SetDelyEvent(int interval, bool reset, Action action) { var timer = new Timer {Interval = interval, AutoReset = reset}; timer.Elapsed += (sender, args) => action(); timer.Start(); } }
I want to call this ACTION.
var stub = new Mock<ITimeService>(); stub .Setup(m => m.SetDelyEvent(100, false, ACTION));
source share