private static StatLightConfiguration CreateStatLightConfiguration(SilverlightTask silverlightTask, DebugLogger logger, MethodTask[] testMethods)
        {
            var configurationFactory = new StatLightConfigurationFactory(logger);

            return silverlightTask.HasXapPath() ?
                CreateStatLightConfigurationForXap(configurationFactory, testMethods, silverlightTask.GetXapPath()) :
                CreateStatLightConfigurationForDll(configurationFactory, testMethods, silverlightTask.GetDllPath());
        }
        private static InputOptions CreateInputOptions(SilverlightTask silverlightTask, MethodTask[] testMethods)
        {
            var inputOptions = new InputOptions()
                .SetMethodsToTest(testMethods.Select(m => m.GetFullMethodName()))
                ;

            if (silverlightTask.HasXapPath())
                inputOptions.SetXapPaths(new[] {silverlightTask.GetXapPath()});
            else
                inputOptions.SetDllPaths(new[] {silverlightTask.GetDllPath()});
            return inputOptions;
        }
        private void Execute(SilverlightTask silverlightTask)
        {
            var testMethods = silverlightTask.Node.GetMethodTasks().ToArray();
            var testClasses = silverlightTask.Node.GetClassTasks().ToArray();

            var logger = CreateStatLightLogger();
            var eventAggregator = CreateStatLightEventAggregator(testClasses, testMethods, logger);
            var configuration = CreateStatLightConfiguration(silverlightTask, logger, testMethods);
            var runner = CreateStatLightRunner(configuration, logger, eventAggregator);

            var testReport = runner.Run();
        }
        private void Execute(SilverlightTask silverlightTask)
        {
            var testMethods = silverlightTask.Node.GetMethodTasks().ToArray();
            var testClasses = silverlightTask.Node.GetClassTasks().ToArray();

            var logger = CreateStatLightLogger();

            var inputOptions = CreateInputOptions(silverlightTask, testMethods);

            // Bootstrap StatLight and load up needed dependencies.
            TinyIoCContainer ioc = StatLight.Core.BootStrapper.Initialize(inputOptions, logger);
            var eventSubscriptionManager = ioc.Resolve<IEventSubscriptionManager>();
            var statLightConfigurationFactory = ioc.Resolve<StatLightConfigurationFactory>();
            var statLightRunnerFactory = ioc.Resolve<StatLightRunnerFactory>();

            // Create the AgUnit specific test result handler and include it with the StatLight event aggregator.
            var eventsHandler = new SilverlightResultsHandler(testClasses, testMethods);
            eventSubscriptionManager.AddListener(eventsHandler);

            StatLightConfiguration statLightConfiguration = statLightConfigurationFactory.GetConfigurations().Single();
            IRunner onetimeConsoleRunner = statLightRunnerFactory.CreateOnetimeConsoleRunner(statLightConfiguration);
            var testReport = onetimeConsoleRunner.Run();
        }