public void StartNewWithZeroPeriodShoultThrowArgumentException(int period) { // Arrange var timeLoop = new TimeLoop(); // Act // Assert Assert.Throws(typeof(ArgumentException), () => { timeLoop.StartNew(id => { }, period); }); }
public void StartNewWithNullActionShoultThrowArgumentNullException() { // Arrange var timeLoop = new TimeLoop(); // Act // Assert Assert.Throws(typeof(ArgumentNullException), () => { timeLoop.StartNew(null, 10); }); }
public void StartNewWithValidActionAndPeriodShouldReturnGuid() { // Arrange var timeLoop = new TimeLoop(); // Act var result = timeLoop.StartNew(id => { }, 10); // Assert Assert.Equal(typeof(Guid), result.GetType()); }
public void StopWithTimerShouldReturnTrue() { // Arrange var timeLoop = new TimeLoop(); // Act var loopId = timeLoop.StartNew(id => { }, 10); var result = timeLoop.Stop(loopId); // Assert Assert.Equal(true, result); }