Esempio n. 1
0
            public void ReturnsInstance()
            {
                // Arrange -> Act
                var worker = new EmptyWorkerRoleBase();

                // Assert
                Assert.IsAssignableFrom <WorkerRoleBase <ISettings> >(worker);
            }
Esempio n. 2
0
            public void StopsService()
            {
                // Arrange
                var worker = new EmptyWorkerRoleBase();

                worker.Start();

                // Act -> Assert
                worker.Stop();
            }
Esempio n. 3
0
            public async Task WritesTimeRemaining()
            {
                // Arrange
                var worker = new EmptyWorkerRoleBase();

                // Act
                await worker.RunAsyncCore(idle, cancellationToken);

                // Assert
                mockIdle.Verify(i => i.WriteTimeRemaining(), Times.Once);
            }
Esempio n. 4
0
            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);
            }
Esempio n. 5
0
            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);
            }