public void EstablishContext()
        {
            using (var startEvent = new ManualResetEvent(false))
            {
                _srv = new TestService();

                _channelAdaptor = new ChannelAdapter();
                _hostChannel = WellknownAddresses.GetServiceCoordinatorHost(_channelAdaptor);

                using (_channelAdaptor.Connect(config => config.AddConsumerOf<ServiceStarted>().UsingConsumer(msg => startEvent.Set())))
                {

                    ServiceConfigurator<TestService> c = new ServiceConfigurator<TestService>();
                    c.WhenStarted(s => s.Start());
                    c.WhenStopped(s => s.Stop());
                    c.WhenPaused(s => { _wasPaused = true; });
                    c.WhenContinued(s => { _wasContinued = true; });
                    c.HowToBuildService(name => _srv);

                    _serviceController = c.Create(WellknownAddresses.GetServiceCoordinatorProxy());
                    _serviceController.Start();

                    startEvent.WaitOne(5.Seconds());

                    _serviceController.State.ShouldEqual(ServiceState.Started);
                }
            }
        }
Пример #2
0
        public void EstablishContext()
        {
            _srv = new TestService();

            ServiceConfigurator<TestService> c = new ServiceConfigurator<TestService>();
            c.WhenStarted(s => s.Start());
            c.WhenStopped(s => s.Stop());
            c.WhenPaused(s => { _wasPaused = true; });
            c.WhenContinued(s => { _wasContinued = true; });
            c.HowToBuildService((name)=> _srv);
            _serviceController = c.Create();
            _serviceController.Start();
        }
Пример #3
0
 public void WhenContinued(Action <TService> continueAction)
 {
     _configurator.WhenContinued(continueAction);
 }