Exemplo n.º 1
0
        private static async Task MainAsync()
        {
            Scheduler = new SynchronizationContextScheduler(SynchronizationContext.Current);
            SpinWait.SpinUntil(() => Debugger.IsAttached, TimeSpan.FromSeconds(5));
            var data = new Dictionary <string, object> {
                { "foo", 10 }, { "bar", "hello" }
            };

            using (XUnitService.StartWithDefaultRunner(new TestServiceConfiguration(Id, data)))
            {
                Console.WriteLine("Press <Enter> to exit . . .");
                await Task.Run(() => Console.ReadLine());
            }
        }
 private IDisposable StartTestService()
 {
     try
     {
         var data = new Dictionary <string, object> {
             { nameof(ISldWorks), SwApp }
         };
         return(XUnitService.StartWithCustomRunner <ScheduledRunner>(new TestServiceConfiguration(TestSettings.Id, data)));
     }
     catch (TestServiceException e)
     {
         MessageBox.Show(e.ToString());
         return(Disposable.Empty);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString());
         return(Disposable.Empty);
     }
 }