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

            // Act
            await service.UpdateState(ConnectionState.ConnectionLost);

            // Assert
            service.GetState().Should().Be(ConnectionState.ConnectionLost);
        }
Пример #2
0
        public async Task UpdateState_ShouldNotifyWebClients()
        {
            // Arrange
            var service = new ConnectionStateService(_serviceProviderMock.Object);

            // Act
            await service.UpdateState(ConnectionState.ConnectionLost);

            // Assert
            _clientProxyMock.Verify(x => x.SendCoreAsync("Changed", It.IsAny <object[]>(), It.IsAny <CancellationToken>()), Times.Once);
        }