Esempio n. 1
0
 public void Injector_MonitorAssemblyLoading_SetsPropertyOk()
 {
     using (var wrapper = new TestDomainWrapper <SonarAnalyzerLegacyConnectedWorkflowTests>())
     {
         wrapper.RemoteObject.Execute_MonitorAssemblyLoading_SetsPropertyOk();
     }
 }
Esempio n. 2
0
 public void Injector_ErrorsSettingPropertyAreSuppressed()
 {
     using (var wrapper = new TestDomainWrapper <SonarAnalyzerLegacyConnectedWorkflowTests>())
     {
         wrapper.RemoteObject.Execute_ErrorsSettingPropertyAreSuppressed();
     }
 }
Esempio n. 3
0
 public void Injector_OldSonarAnalyzerWithoutProperty_NoError()
 {
     using (var wrapper = new TestDomainWrapper <SonarAnalyzerLegacyConnectedWorkflowTests>())
     {
         wrapper.RemoteObject.Execute_OldSonarAnalyzerWithoutProperty_NoError();
     }
 }
Esempio n. 4
0
 public void Injector_WrongAssemblyName_NoErrorAndPropertyNotSet()
 {
     using (var wrapper = new TestDomainWrapper <SonarAnalyzerLegacyConnectedWorkflowTests>())
     {
         wrapper.RemoteObject.Execute_WrongAssemblyName_NoErrorAndPropertyNotSet();
     }
 }
        private static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)
        {
            CheckIsInTestDomain();

            TestDomainWrapper <T> resolver = AppDomain.CurrentDomain.GetData(AppDomainDataKey) as TestDomainWrapper <T>;

            if (resolver == null)
            {
                throw new Exception("Test setup error: failed to obtain the remote domain wrapper");
            }

            string asmLocation = resolver.GetAssemblyLocation(args.Name);

            if (asmLocation != null)
            {
                Assembly asm = Assembly.LoadFrom(asmLocation);
                return(asm);
            }
            return(null);
        }