示例#1
0
        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()));
        }
        public CurrentStatLightConfiguration(StatLightConfigurationFactory statLightConfigurationFactory)
        {
            if (statLightConfigurationFactory == null)
            {
                throw new ArgumentNullException("statLightConfigurationFactory");
            }

            _configurations = statLightConfigurationFactory.GetConfigurations().ToList();

            Reset();
        }
示例#3
0
 private static StatLightConfiguration CreateStatLightConfigurationForDll(StatLightConfigurationFactory configurationFactory, IEnumerable <MethodTask> testMethods, string dllPath)
 {
     return(configurationFactory.GetStatLightConfigurationForDll(
                unitTestProviderType: UnitTestProviderType.Undefined, // Let StatLight figure it out
                dllPath: dllPath,
                microsoftTestingFrameworkVersion: null,               // Let StatLight figure it out
                methodsToTest: new Collection <string>(testMethods.Select(m => m.GetFullMethodName()).ToList()),
                tagFilters: null,
                numberOfBrowserHosts: 1, // Maybe you spin up 3 or 4 here if you know you're running a ton of tests
                isRemoteRun: false,
                queryString: "",         // This is passed to the browser host page (say your test need some configuration - could be passed here - probably not a use case in ReSharper runner)
                webBrowserType: WebBrowserType.SelfHosted,
                forceBrowserStart: false,
                showTestingBrowserHost: false // If you need UI support this needs to be true
                ));
 }
        protected override void Because()
        {
            base.Because();

            var statLightConfigurationFactory = new StatLightConfigurationFactory(_testLogger);

            var statLightConfiguration = statLightConfigurationFactory.GetStatLightConfigurationForXap(
                ClientTestRunConfiguration.UnitTestProviderType,
                _pathToIntegrationTestXap,
                MSTestVersion,
                ClientTestRunConfiguration.MethodsToTest,
                ClientTestRunConfiguration.TagFilter,
                1,
                false,
                "", StatLight.Core.WebBrowser.WebBrowserType.SelfHosted,
                forceBrowserStart: true,
                showTestingBrowserHost: false);

            //bool showTestingBrowserHost = statLightConfiguration.Server.XapHostType == XapHostType.MSTestApril2010;
            _testLogger.Debug("Setting up xaphost {0}".FormatWith(statLightConfiguration.Server.XapHostType));
            Runner = _statLightRunnerFactory.CreateOnetimeConsoleRunner(statLightConfiguration);

            TestReport = Runner.Run();
        }