public RabbitMqBus(IBusHost host) { var factory = new ConnectionFactory { HostName = host.Host, UserName = host.UserName, Password = host.Password }; _connection = factory.CreateConnection(); _channel = _connection.CreateModel(); _handlers = new List <Tuple <string, Func <IModel, EventingBasicConsumer> > >(); }
public ShutdownHook(IBusHost host) { this.host = host; }
public void OnStop_stops_the_host(TestStartup sut, IBusHost busHost, HostControl control) { sut.OnStop(busHost, control); Mock.Get(busHost).Verify(p => p.StopAsync(), Times.Once); }
public NybusHostedService(IBusHost host, ILogger <NybusHostedService> logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _host = host ?? throw new ArgumentNullException(nameof(host)); }
public override bool OnStop(IBusHost host, HostControl control) { return(base.OnStop(host, control)); }
public virtual bool OnStop(IBusHost host, HostControl control) { host.StopAsync().GetAwaiter().GetResult(); return(true); }
public async Task StopAsync_stops_host([Frozen] IBusHost host, NybusHostedService sut, CancellationToken cancellationToken) { await sut.StopAsync(cancellationToken); Mock.Get(host).Verify(p => p.StopAsync()); }
public IBusBootstrapper Init(IBusHost host) { Bus = new RabbitMqBus(host); return(this); }