Inheritance: IProcesses
        public void Whole()
        {
            string ConsolePath =
                @"C:\USERS\AREGO\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\12.0EXP\EXTENSIONS\PIOTRTRZPIL\VISUALMUTATOR\2.0.8\xunitconsole\xunit.console.exe";
            string BasePath = @"C:\PLIKI\VisualMutator\testprojects\Automapper-Integration-Tests\";
            string unitestspath = BasePath + @"AutoMapper.dll";
            string unitestsdestination = BasePath + @"Debug\AutoMapper.dll";
            string unitestsdestinationPdb = BasePath + @"Debug\AutoMapper.pdb";
            string unitests = BasePath + @"Debug\AutoMapper.UnitTests.Net4.dll";
            var cci = new CciModuleSource(unitestspath);

          //  var rewr = new XRewriter(cci.Host);
           // rewr.Rewrite(cci.Module.Module);


            File.Delete(unitestsdestination);
            File.Delete(unitestsdestinationPdb);
            using (var file = File.OpenWrite(unitestsdestination))
            {
                cci.WriteToStream(cci.Module, file, unitestsdestination);
            }

      
            _log.Info("Running: " + ConsolePath.InQuotes() + " " + (unitests).InQuotes());
  
            var procResult = new Processes().RunHiddenAsync(ConsolePath, unitests);

            _log.Debug(procResult.Result.StandardOutput.Concat(procResult.Result.StandardError).Aggregate((a,b)=>a+"\n"+b));


//
//            var cci2 = new CciModuleSource(unitestspath);
//            var rewr = new XRewriter(cci2.Host);
//            
//            rewr.Rewrite(cci2.Module.Module);
//
//            File.Delete(unitestsdestination);
//            File.Delete(unitestsdestinationPdb);
//            using (var file = File.OpenWrite(unitestsdestination))
//            {
//                cci2.WriteToStream(cci2.Module, file, unitestsdestination);
//            }
//
//
//            _log.Info("Running: " + ConsolePath.InQuotes() + " " + arg);
//           
//            var procResult2 = new Processes().RunHiddenAsync(ConsolePath, unitestsdestination);
//            _log.Debug(procResult2.Result.StandardOutput.Concat(procResult2.Result.StandardError).Aggregate((a, b) => a + "\n" + b));

        }
Example #2
0
        public void Test1()
        {
            var processes = new Processes();
            var p = new ProcessStartInfo("mspaint.exe");
           // p.
            var s = new CancellationTokenSource();
            processes.RunAsync(p, s).ContinueWith(t =>
            {
                if(t.IsCanceled)
                {
                    Console.WriteLine("cancelled");
                 }
            });

            Observable.Timer(TimeSpan.FromSeconds(3)).Subscribe( a => s.Cancel());

            Thread.Sleep(10000);
        }