コード例 #1
0
ファイル: SystemLifecycle.cs プロジェクト: larsw/storyteller
        public void ExecuteContext(ITestContext context, Action action)
        {
            ensureEnvironmentInitialized();
            _system.RegisterServices(context);

            try
            {
                _system.Setup();

                var startups = context.StartupActionTypes.Select(x => _system.GetAction(x));

                startups.Each(x => x.Startup(context));

                action();

                // TODO -- this might need to go to system teardown
                startups.Each(x => x.Teardown(context));
            }
            finally
            {
                _system.Teardown();
            }
        }