public async Task Start_and_stop_should_throw_on_initialize_failed()
        {
            await SetupAndStartMultiHost();

            var identifier = ("test", "test");

            var badApplication = new VostokMultiHostApplicationSettings(new BadApplication(true), identifier, SetupMultiHostApplication);

            Action checkStart = () => vostokMultiHost.StartApplicationAsync(badApplication).GetAwaiter().GetResult();

            checkStart.Should().Throw <Exception>().WithMessage("initialize");

            Action checkStop = () => vostokMultiHost.StopApplicationAsync(identifier).GetAwaiter().GetResult();

            checkStop.Should().Throw <Exception>().WithMessage("initialize");
        }
        public async Task Start_should_wait_until_given_state_occurs(VostokApplicationState stateToAwait)
        {
            var identifier        = ("test", "test");
            var workerApplication = new VostokMultiHostApplicationSettings(new NeverEndingApplication(), identifier, SetupMultiHostApplication);

            vostokMultiHost = new VostokMultiHost(new VostokMultiHostSettings(SetupMultiHost), workerApplication);

            await vostokMultiHost.StartAsync();

            await vostokMultiHost.GetApplication(identifier).StartAsync(stateToAwait);

            vostokMultiHost.GetApplication(identifier).ApplicationState.Should().Match <VostokApplicationState>(state => state >= stateToAwait);

            await vostokMultiHost.StopApplicationAsync(identifier);

            vostokMultiHost.GetApplication(identifier).ApplicationState.IsTerminal().Should().BeTrue();

            await vostokMultiHost.StopAsync();
        }