public void WhenSubscribingToEventAndNotConnectedToRabbitShouldConnect() { _rabbitMqPersistentConnection.IsConnected.Returns(false); _sut.Subscribe <Event>(); _rabbitMqPersistentConnection.Received(1).TryConnect(); }
public async Task WhenInitializingConsumerChannelShouldTryConnectIfNotConnectedToRabbit() { _rabbitMqPersistentConnection.IsConnected.Returns(false); await _sut.InitializeConsumersChannelsAsync(); _rabbitMqPersistentConnection.Received(1).TryConnect(); }