예제 #1
0
        public static void AddSilverlightUnitTestTask(this IList<UnitTestTask> sequence, IProject silverlightProject, UnitTestProviders providers)
        {
            var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
            var element = new SilverlightUnitTestElement(provider);

            var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath());
            sequence.Insert(0, new UnitTestTask(element, remoteTask));
        }
 public XunitTestFileExplorer(XunitTestProvider provider, UnitTestProviders providers, 
                              UnitTestElementFactory unitTestElementFactory, 
                              SearchDomainFactory searchDomainFactory)
 {
     this.provider = provider;
     this.unitTestElementFactory = unitTestElementFactory;
     this.searchDomainFactory = searchDomainFactory;
     this.providers = providers;
 }
예제 #3
0
        /// <summary>
        /// Enqueue a test assembly from a simple Assembly reference.
        /// </summary>
        /// <param name="assembly">The test assembly.</param>
        /// <param name="runFilter">The run filter settings for the test assembly's run.</param>
        public void EnqueueTestAssembly(Assembly assembly, TestRunFilter runFilter)
        {
            IAssembly testAssembly = UnitTestProviders.GetAssemblyWrapper(this, assembly);

            if (testAssembly != null)
            {
                EnqueueTestAssembly(testAssembly, runFilter);
            }
        }
        private static void CreateSilverlightSequence(IList<UnitTestTask> sequence, IUnitTestLaunch launch, UnitTestProviders providers, IProject silverlightProject)
        {
            var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID);

            sequence.AddSilverlightUnitTestTask(silverlightProject, providers);
            sequence.RemoveAssemblyLoadTasks();

            silverlightRun.AddTaskSequence(sequence);
        }
예제 #5
0
 public XunitTestFileExplorer(XunitTestProvider provider, UnitTestProviders providers,
                              UnitTestElementFactory unitTestElementFactory,
                              SearchDomainFactory searchDomainFactory)
 {
     this.provider = provider;
     this.unitTestElementFactory = unitTestElementFactory;
     this.searchDomainFactory    = searchDomainFactory;
     this.providers = providers;
 }
        public SilverlightXunitTestFileExplorer(UnitTestProviders providers)
        {
            provider = providers.GetProvider(ProviderId);

            if (provider == null)
            {
                xUnitInstalled = false;
                provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
            }
        }
예제 #7
0
        public SilverlightXunitTestFileExplorer(UnitTestProviders providers)
        {
            provider = providers.GetProvider(ProviderId);

            if (provider == null)
            {
                xUnitInstalled = false;
                provider       = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
            }
        }
        private static void ConvertToSilverlightSequenceIfNecessary(IList<UnitTestTask> sequence, UnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject();
                if (silverlightProject != null)
                {
                    run.GetSequences().Remove(sequence);

                    CreateSilverlightSequence(sequence, launch, providers, silverlightProject);
                }
            }
        }
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.Select(r => r.Value).ToArray())
            {
                foreach (var sequence in run.GetRootTasks().ToArray())
                {
                    ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers, hostController);
                }
            }

            launch.RemoveEmptyRuns();
        }
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.ToArray())
            {
                foreach (var sequence in run.GetSequences().ToArray())
                {
                    ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers);
                }
            }

            launch.RemoveEmptyRuns();
        }
        private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, IUnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject(run);
                if (silverlightProject != null)
                {
                    var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, providers, hostController);

                    var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
                    var silverlightElement = new SilverlightUnitTestElement(provider, silverlightRun.Key.RunStrategy);

                    var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath());

                    var silverlightSequence = new RemoteTaskPacket(remoteTask) { TaskPackets = { sequence } };

                    run.GetRootTasks().Remove(sequence);
                    silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run);
                }
            }
        }
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.Select(r => r.Value).ToArray())
            {
                foreach (var sequence in run.GetRootTasks().ToArray())
                {
                    if (run.Elements.FirstOrDefault() is SilverlightUnitTestElement)
                    {
                        continue;
                    }

                    IUnitTestRun localRun = run;
                    var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
                    ConvertToSilverlightSequenceIfNecessary(sequence, ref localRun, launch, provider, hostController);
                }
            }

            launch.RemoveEmptyRuns();
        }
예제 #13
0
        public static KeyValuePair<UnitTestRunProperties, UnitTestRun> GetOrCreateSilverlightRun(this IUnitTestLaunch launch, PlatformID silverlightPlatform, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            var runs = launch.GetRuns();
            var silverlightRun = runs.Values.FirstOrDefault(run => run.Value.GetSilverlightPlatformVersion() == silverlightPlatform.Version);

            if (silverlightRun.Value == null)
            {
                var runtimeEnvironment = new RuntimeEnvironment { PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0 };

                var run = new UnitTestRun((UnitTestLaunch)launch, runtimeEnvironment);
                var runStrategy = new OutOfProcessUnitTestRunStrategy(SilverlightUnitTestProvider.GetTaskRunnerInfo(launch));

                var unitTestProvider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
                var runProperties = new UnitTestRunProperties(unitTestProvider, null, runStrategy, runtimeEnvironment);
                runProperties.RunController = hostController;

                silverlightRun = new KeyValuePair<UnitTestRunProperties, UnitTestRun>(runProperties, run);

                runs.Add(run.ID, silverlightRun);
            }

            return silverlightRun;
        }
예제 #14
0
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.Select(r => r.Value).ToArray())
            {
                foreach (var sequence in run.GetRootTasks().ToArray())
                {
                    ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers, hostController);
                }
            }

            launch.RemoveEmptyRuns();
        }
        private static void ConvertToSilverlightSequenceIfNecessary(IList <UnitTestTask> sequence, UnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject();
                if (silverlightProject != null)
                {
                    run.GetSequences().Remove(sequence);

                    CreateSilverlightSequence(sequence, launch, providers, silverlightProject);
                }
            }
        }
예제 #16
0
        public static KeyValuePair <UnitTestRunProperties, UnitTestRun> GetOrCreateSilverlightRun(this IUnitTestLaunch launch, PlatformID silverlightPlatform, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            var runs           = launch.GetRuns();
            var silverlightRun = runs.Values.FirstOrDefault(run => run.Value.GetSilverlightPlatformVersion() == silverlightPlatform.Version);

            if (silverlightRun.Value == null)
            {
                var runtimeEnvironment = new RuntimeEnvironment {
                    PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0
                };

                var run         = new UnitTestRun((UnitTestLaunch)launch, runtimeEnvironment);
                var runStrategy = new OutOfProcessUnitTestRunStrategy(SilverlightUnitTestProvider.GetTaskRunnerInfo(launch));

                var unitTestProvider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
                var runProperties    = new UnitTestRunProperties(unitTestProvider, null, runStrategy, runtimeEnvironment);
                runProperties.RunController = hostController;

                silverlightRun = new KeyValuePair <UnitTestRunProperties, UnitTestRun>(runProperties, run);

                runs.Add(run.ID, silverlightRun);
            }

            return(silverlightRun);
        }
예제 #17
0
        private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, IUnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
        {
            if (!sequence.IsSilverlightSequence())
            {
                var silverlightProject = sequence.GetSilverlightProject(run);
                if (silverlightProject != null)
                {
                    var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, providers, hostController);

                    var provider           = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
                    var silverlightElement = new SilverlightUnitTestElement(provider, silverlightRun.Key.RunStrategy);

                    var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath());

                    var silverlightSequence = new RemoteTaskPacket(remoteTask)
                    {
                        TaskPackets = { sequence }
                    };

                    run.GetRootTasks().Remove(sequence);
                    silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run);
                }
            }
        }
예제 #18
0
        public static void AddSilverlightUnitTestTask(this IList <UnitTestTask> sequence, IProject silverlightProject, UnitTestProviders providers)
        {
            var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId);
            var element  = new SilverlightUnitTestElement(provider);

            var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath());

            sequence.Insert(0, new UnitTestTask(element, remoteTask));
        }
        public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers)
        {
            var runs = launch.GetRuns();

            foreach (var run in runs.Values.ToArray())
            {
                foreach (var sequence in run.GetSequences().ToArray())
                {
                    ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers);
                }
            }

            launch.RemoveEmptyRuns();
        }
        private static void CreateSilverlightSequence(IList <UnitTestTask> sequence, IUnitTestLaunch launch, UnitTestProviders providers, IProject silverlightProject)
        {
            var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID);

            sequence.AddSilverlightUnitTestTask(silverlightProject, providers);
            sequence.RemoveAssemblyLoadTasks();

            silverlightRun.AddTaskSequence(sequence);
        }