Пример #1
0
        public async Task UpdateStateAndDownloadProgress_ShouldNotifyWebClients()
        {
            // Arrange
            var service = new ConnectionStateService(_serviceProviderMock.Object);

            // Act
            await service.UpdateStateAndDownloadProgress(ConnectionState.Downloading, 12);

            // Assert
            _clientProxyMock.Verify(x => x.SendCoreAsync("Changed", It.IsAny <object[]>(), It.IsAny <CancellationToken>()), Times.Once);
        }
Пример #2
0
        public async Task UpdateStateAndDownloadProgress_ShouldUpdateStateAndDownloadProgress()
        {
            // Arrange
            var service = new ConnectionStateService(_serviceProviderMock.Object);

            // Act
            await service.UpdateStateAndDownloadProgress(ConnectionState.Downloading, 12);

            // Assert
            service.GetState().Should().Be(ConnectionState.Downloading);
            service.GetDownloadProgressInPercent().Should().Be(12);
        }