예제 #1
0
        public async Task Start_Then_Stop_Should_Finish_OnDemandClientChannel()
        {
            //Arrange
            await MessagingHubConnection.ConnectAsync();

            // Act
            await MessagingHubConnection.DisconnectAsync();

            // Assert
            OnDemandClientChannel.ReceivedWithAnyArgs(1).FinishAsync(CancellationToken.None).Wait();
        }
        public async Task Add_CommandReceiver_Process_Command_And_Stop_With_Success()
        {
            //Arrange
            MessagingHubListener.AddCommandReceiver(_commandReceiver);

            await MessagingHubConnection.ConnectAsync();

            await MessagingHubListener.StartAsync();

            DispatchCommand();
            await Task.Delay(TIME_OUT);

            //Act
            await MessagingHubListener.StopAsync();

            await MessagingHubConnection.DisconnectAsync();

            //Assert
            _commandReceiver.ReceivedWithAnyArgs().ReceiveAsync(null, CancellationToken.None);
        }
예제 #3
0
 public void Stop_Without_Start_Should_Not_Throw_Exception()
 {
     // Act // Assert
     Should.NotThrow(async() => await MessagingHubConnection.DisconnectAsync());
 }