/// <summary> /// Initializes a new instance of the <see cref="UITestCase" /> class. /// </summary> /// <param name="synchronizationContextType">The type of <see cref="SynchronizationContext" /> to use.</param> /// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param> /// <param name="defaultMethodDisplay">Default method display to use (when not customized).</param> /// <param name="testMethod">The test method this test case belongs to.</param> /// <param name="testMethodArguments">The arguments for the test method.</param> public UITestCase( SyncContextType synchronizationContextType, IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod, object[] testMethodArguments = null) : base(diagnosticMessageSink, defaultMethodDisplay, testMethod, testMethodArguments) { this.synchronizationContextType = synchronizationContextType; }
/// <summary> /// Initializes a new instance of the <see cref="UITestCase"/> class. /// </summary> /// <param name="synchronizationContextType">The type of <see cref="SynchronizationContext"/> to use.</param> /// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param> /// <param name="defaultMethodDisplay">Default method display to use (when not customized).</param> /// <param name="testMethod">The test method this test case belongs to.</param> /// <param name="testMethodArguments">The arguments for the test method.</param> public UITestCase( SyncContextType synchronizationContextType, IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod, object[] testMethodArguments = null) : base(diagnosticMessageSink, defaultMethodDisplay, TestMethodDisplayOptions.None, testMethod, testMethodArguments) { this.synchronizationContextType = synchronizationContextType; }
internal static SyncContextAdapter GetAdapter(SyncContextType syncContextType) { switch (syncContextType) { case SyncContextType.None: return(NullAdapter.Default); case SyncContextType.Portable: return(UISynchronizationContext.Adapter.Default); #if NETFRAMEWORK || NETCOREAPP case SyncContextType.WPF: return(DispatcherSynchronizationContextAdapter.Default); case SyncContextType.WinForms: return(WinFormsSynchronizationContextAdapter.Default); #endif default: throw new NotSupportedException("Unsupported type of SynchronizationContext."); } }
public override void Deserialize(IXunitSerializationInfo data) { base.Deserialize(data); this.synchronizationContextType = (SyncContextType)data.GetValue(nameof(this.synchronizationContextType), typeof(SyncContextType)); }