public void ReturnsInstance() { // Arrange -> Act var worker = new EmptyWorkerRoleBase(); // Assert Assert.IsAssignableFrom <WorkerRoleBase <ISettings> >(worker); }
public void StopsService() { // Arrange var worker = new EmptyWorkerRoleBase(); worker.Start(); // Act -> Assert worker.Stop(); }
public async Task WritesTimeRemaining() { // Arrange var worker = new EmptyWorkerRoleBase(); // Act await worker.RunAsyncCore(idle, cancellationToken); // Assert mockIdle.Verify(i => i.WriteTimeRemaining(), Times.Once); }
public async Task DelaysForTimeRemaining() { // Arrange var worker = new EmptyWorkerRoleBase(); // Act await worker.RunAsyncCore(idle, cancellationToken); // Assert mockIdle.Verify(i => i.DelayAsync(It.IsAny <CancellationToken>()), Times.Once); }
public async Task ReloadsSettings() { // Arrange var mockSettings = new Mock <ISettings>(); var settings = mockSettings.Object; var worker = new EmptyWorkerRoleBase(settings); // Act await worker.RunAsyncCore(idle, cancellationToken); // Assert mockSettings.Verify(s => s.Reload(), Times.Once); }