public void SetUp() { exchangeDeclareCount = 0; publishExchangeDeclareStrategy = new PublishExchangeDeclareStrategy(); advancedBus = MockRepository.GenerateStub <IAdvancedBus>(); advancedBus .Stub(x => x.ExchangeDeclare(exchangeName, "topic")) .Return(exchange) .WhenCalled(x => exchangeDeclareCount++); }
public void SetUp() { exchangeDeclareCount = 0; publishExchangeDeclareStrategy = new PublishExchangeDeclareStrategy(); advancedBus = MockRepository.GenerateStub<IAdvancedBus>(); advancedBus .Stub(x => x.ExchangeDeclare(exchangeName, "topic")) .Return(exchange) .WhenCalled(x => exchangeDeclareCount++); }
public void SetUp() { exchangeDeclareCount = 0; publishExchangeDeclareStrategy = new PublishExchangeDeclareStrategy(); advancedBus = MockRepository.GenerateStub <IAdvancedBus>(); exchange = new Exchange(exchangeName); exchangeTask = TaskHelpers.FromResult(exchange); advancedBus .Stub(x => x.ExchangeDeclareAsync(exchangeName, "topic")) .Return(exchangeTask) .WhenCalled(x => exchangeDeclareCount++); }
public void SetUp() { exchangeDeclareCount = 0; publishExchangeDeclareStrategy = new PublishExchangeDeclareStrategy(); advancedBus = MockRepository.GenerateStub<IAdvancedBus>(); exchange = new Exchange(exchangeName); exchangeTask = TaskHelpers.FromResult(exchange); advancedBus .Stub(x => x.ExchangeDeclareAsync(exchangeName, "topic")) .Return(exchangeTask) .WhenCalled(x => exchangeDeclareCount++); }
public void SetUp() { bus = MockRepository.GenerateStub <IBus>(); advancedBus = MockRepository.GenerateStub <IAdvancedBus>(); channel = MockRepository.GenerateStub <IAdvancedPublishChannel>(); bus.Stub(x => x.IsConnected).Return(true); bus.Stub(x => x.Advanced).Return(advancedBus); advancedBus.Stub(x => x.OpenPublishChannel()).Return(channel); scheduleRepository = MockRepository.GenerateStub <IScheduleRepository>(); schedulerService = new SchedulerService( bus, new ConsoleLogger(), scheduleRepository, new SchedulerServiceConfiguration { PublishIntervalSeconds = 1, PurgeIntervalSeconds = 1 }); }
public void SetUp() { bus = MockRepository.GenerateStub<IBus>(); advancedBus = MockRepository.GenerateStub<IAdvancedBus>(); channel = MockRepository.GenerateStub<IAdvancedPublishChannel>(); bus.Stub(x => x.IsConnected).Return(true); bus.Stub(x => x.Advanced).Return(advancedBus); advancedBus.Stub(x => x.OpenPublishChannel()).Return(channel); scheduleRepository = MockRepository.GenerateStub<IScheduleRepository>(); schedulerService = new SchedulerService( bus, MockRepository.GenerateStub<IEasyNetQLogger>(), scheduleRepository, new SchedulerServiceConfiguration { PublishIntervalSeconds = 1, PurgeIntervalSeconds = 1 }); }