public static MockBridge SetUpEnvironment () { Log.ErrorHappened += OnError; Type interopProviderType = typeof (AutomationInteropProvider); // Set the bridge assembly name to a value that will // fail when the static constructor attempts to load it. Environment.SetEnvironmentVariable ("MONO_UIA_BRIDGE", "Ignore this intentional error"); // Inject a mock automation bridge into the // AutomationInteropProvider, so that we don't try // to load the UiaAtkBridge. MockBridge bridge = new MockBridge (); FieldInfo bridgeField = interopProviderType.GetField ("bridges", BindingFlags.NonPublic | BindingFlags.Static); List<IAutomationBridge> bridges = new List<IAutomationBridge> (); bridges.Add (bridge); bridgeField.SetValue (null, bridges); bridge.ClientsAreListening = true; return bridge; }
public static MockBridge SetUpEnvironment() { Log.ErrorHappened += OnError; Type interopProviderType = typeof(AutomationInteropProvider); // Set the bridge assembly name to a value that will // fail when the static constructor attempts to load it. Environment.SetEnvironmentVariable("MONO_UIA_BRIDGE", "Ignore this intentional error"); // Inject a mock automation bridge into the // AutomationInteropProvider, so that we don't try // to load the UiaAtkBridge. MockBridge bridge = new MockBridge(); FieldInfo bridgeField = interopProviderType.GetField("bridges", BindingFlags.NonPublic | BindingFlags.Static); List <IAutomationBridge> bridges = new List <IAutomationBridge> (); bridges.Add(bridge); bridgeField.SetValue(null, bridges); bridge.ClientsAreListening = true; return(bridge); }
public virtual void SetUp () { bridge = TestHelper.SetUpEnvironment (); form = new Form (); form.Show (); formProvider = (FormProvider) ProviderFactory.GetProvider (form); }