private AnalysisResult InspectAssemblyWithAnalyzer(IAssemblyAnalyzer analyzer) { try { if (loadedAssembly == null) { throw new InvalidOperationException("No assembly is loaded. An assembly has to be loaded before inspection attempt."); } return(analyzer.Analyze(loadedAssembly)); } catch (FileLoadException) { return(new AnalysisResult(analyzer.Name) { Value = FileLoadExceptionMessage }); } catch (SecurityException) { return(new AnalysisResult(analyzer.Name) { Value = SecurityExceptionMessage }); } catch (Exception) { return(new AnalysisResult(analyzer.Name) { Value = GeneralExceptionMessage }); } }
public void SetUp() { _assemblyAnalyzerMock = MockRepository.GenerateStrictMock <IAssemblyAnalyzer>(); _analyzer = new TypeAnalyzer(_assemblyAnalyzerMock); }
public TypeAnalyzer(IAssemblyAnalyzer assemblyAnalyzer) { ArgumentUtility.CheckNotNull("assemblyAnalyzer", assemblyAnalyzer); _assemblyAnalyzer = assemblyAnalyzer; }