コード例 #1
0
        protected void Execute(UnitTestSessionTestImpl session, List<IList<UnitTestTask>> sequences, Lifetime lt, TextWriter output, IUnitTestLaunch launch)
        {
            var msgListener = Solution.GetComponent<TestRemoteChannelMessageListener>();
            msgListener.Output = output;
            session.Sequences = sequences;
            msgListener.Run = session;
            msgListener.Strategy = new OutOfProcessUnitTestRunStrategy(GetRemoteTaskRunnerInfo());

            var runController = CreateTaskRunnerHostController(Solution.GetComponent<IUnitTestLaunchManager>(), Solution.GetComponent<IUnitTestResultManager>(), Solution.GetComponent<IUnitTestAgentManager>(), launch, Solution.GetComponent<IUnitTestSessionManager>(), GetServerPortNumber());
            msgListener.RunController = runController;
            var finished = new AutoResetEvent(false);
            session.OnFinish(() =>
            {
                var channel = GetRemoteChannel();
                if (channel != null)
                    channel.OnFinish(() => finished.Set());
                else
                    finished.Set();
            });
            session.Run(lt, runController, msgListener.Strategy);
            finished.WaitOne(30000);
        }
コード例 #2
0
 protected abstract void Execute(IProjectFile projectFile, UnitTestSessionTestImpl session,
     List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch);
コード例 #3
0
 private IList<XElement> ExecuteWithCapture(UnitTestSessionTestImpl session,
     List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch)
 {
     using (var output = new StringWriter())
     {
         Execute(session, sequences, lt, output, launch);
         var messages = output.ToString();
         System.Console.WriteLine(messages);
         return CaptureMessages(messages);
     }
 }
コード例 #4
0
        private void ExecuteWithGold(IProjectFile projectFile, UnitTestSessionTestImpl session,
            List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch)
        {
            ExecuteWithGold(projectFile.Location.FullPath, output =>
            {
                using (var stringWriter = new StringWriter())
                {
                    Execute(session, sequences, lt, stringWriter, launch);

                    // ReSharper 8.2 uses CDATA, but ReSharper 9.0 doesn't. Normalise by removing
                    var text = stringWriter.ToString();
                    text = text.Replace("<![CDATA[", string.Empty).Replace("]]>", string.Empty);
                    output.Write(text);
                }
            });
        }
コード例 #5
0
 protected override void Execute(IProjectFile projectFile, UnitTestSessionTestImpl session, List<IList<UnitTestTask>> sequences, Lifetime lt, IUnitTestLaunch launch)
 {
     execute(projectFile, session, sequences, lt, launch);
 }