Ejemplo n.º 1
0
 public AsynchronousWorkerTests()
 {
     WpfTestCase.RequireWpfFact($"Tests are testing {nameof(AsynchronousSerialWorkQueue)} which is designed to run methods on the UI thread");
     TestWorkspace.ResetThreadAffinity();
     _foregroundSyncContext = SynchronizationContext.Current;
     Assert.NotNull(_foregroundSyncContext);
 }
 public AsynchronousWorkerTests()
 {
     TestWorkspace.ResetThreadAffinity();
     SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());
     _foregroundSyncContext = SynchronizationContext.Current;
     Assert.NotNull(_foregroundSyncContext);
 }
Ejemplo n.º 3
0
        public static IWpfTextView CreateView(
            string contentType,
            ExportProvider exportProvider,
            params string[] lines)
        {
            TestWorkspace.ResetThreadAffinity();

            var buffer = CreateBuffer(contentType, exportProvider, lines);

            return(exportProvider.GetExportedValue <ITextEditorFactoryService>().CreateTextView(buffer));
        }
Ejemplo n.º 4
0
        public static DisposableTextView CreateView(
            string contentType,
            ExportProvider exportProvider,
            params string[] lines)
        {
            TestWorkspace.ResetThreadAffinity();
            WpfTestCase.RequireWpfFact($"Creates an IWpfTextView through {nameof(EditorFactory)}.{nameof(CreateView)}");

            var buffer = CreateBuffer(contentType, exportProvider, lines);

            return(exportProvider.GetExportedValue <ITextEditorFactoryService>().CreateDisposableTextView(buffer));
        }
 public ForegroundNotificationServiceTests()
 {
     TestWorkspace.ResetThreadAffinity();
     _service = new ForegroundNotificationService();
 }
 public ForegroundNotificationServiceTests()
 {
     TestWorkspace.ResetThreadAffinity();
     _service = TestExportProvider.ExportProviderWithCSharpAndVisualBasic.GetExportedValue <IForegroundNotificationService>();
 }