public void Should_UpdateRunningIndicator_When_StartAndAbortTimer() { using (WuStateAsyncJobProxy state = new WuStateAsyncJobProxy(WuStateId.Downloading, "name", 10000)) { Assert.IsFalse(state.IsRunning); state.EnterState(new WuStateReady()); Assert.IsTrue(state.IsRunning); state.Abort(); Assert.IsFalse(state.IsRunning); } }
public void Should_CallRequestAbort_When_AbortJob() { var job = MoqFactory.Create <WuApiJobAdapter>(MockBehavior.Loose); job.Setup(j => j.RequestAbort()); using (WuStateAsyncJobProxy state = new WuStateAsyncJobProxy(WuStateId.Downloading, "name", 10000)) { state.Job = job.Object; state.EnterState(new WuStateReady()); state.Abort(); job.Verify(j => j.RequestAbort(), Times.Once); } }