Esempio n. 1
0
        public void When_configuring_a_control_bus()
        {
            _controlBus = _busReceiverBuilder.Build(_hostName);

            //_should_have_a_configuration_channel
            Assert.True(_controlBus.Connections.Any(cn => cn.Name == _hostName + "." + ControlBusReceiverBuilder.CONFIGURATION));
            //_should_have_a_heartbeat_channel
            Assert.True(_controlBus.Connections.Any(cn => cn.Name == _hostName + "." + ControlBusReceiverBuilder.HEARTBEAT));
            //_should_have_a_command_processor
            Assert.NotNull(_controlBus.CommandProcessor);
        }
        public void When_configuring_a_control_bus()
        {
            _controlBus = _busReceiverBuilder.Build(_hostName);

            //_should_have_a_configuration_channel
            _controlBus.Connections.Should().Contain(cn => cn.Name == $"{_hostName}.{ControlBusReceiverBuilder.CONFIGURATION}");
            //_should_have_a_heartbeat_channel
            _controlBus.Connections.Should().Contain(cn => cn.Name == $"{_hostName}.{ControlBusReceiverBuilder.HEARTBEAT}");
            //_should_have_a_command_processor
            _controlBus.CommandProcessor.Should().NotBeNull();
        }
        public ControlBusTests()
        {
            _dispatcher = A.Fake <IDispatcher>();
            var messageProducerFactory = A.Fake <IAmAMessageProducerFactory>();

            _busReceiverBuilder = (ControlBusReceiverBuilder)ControlBusReceiverBuilder
                                  .With()
                                  .Dispatcher(_dispatcher)
                                  .ProducerFactory(messageProducerFactory)
                                  .ChannelFactory(new InMemoryChannelFactory());

            _controlBus = _busReceiverBuilder.Build("tests");

            _configurationCommand = new ConfigurationCommand(ConfigurationCommandType.CM_STARTALL);
        }