private void MarkAllMethodsAsNotValid(Match match, InstrumentationReport instrumentationReport) { // Did not match so marking all methods as false - can be changed by later validation attempts foreach (var exactMethodMatcher in match.ExactMethodMatchers) { instrumentationReport.AddMethodValidation(match.ClassName, exactMethodMatcher, false); } }
private void CheckExactMethodMatchers(InstrumentationReport instrumentationReport, Match match, ClassModel classModel) { foreach (var exactMethodMatcher in match.ExactMethodMatchers) { // check if method exists in MethodModels and get MethodModel back if (classModel.MethodModels.TryGetValue(exactMethodMatcher.MethodName, out var methodModel)) { // Check if exactMethodMatcher.Parameters is empty or popluated if (string.IsNullOrWhiteSpace(exactMethodMatcher.Parameters)) { // exactMethodMatcher has NO params, checking of MethodModel has an empty ParameterSets value if (methodModel.ParameterSets.Contains(string.Empty)) { instrumentationReport.AddMethodValidation(match.ClassName, exactMethodMatcher, true); continue; } instrumentationReport.AddMethodValidation(match.ClassName, exactMethodMatcher, false); continue; } // exactMethodMatcher HAS params to check if (methodModel.ParameterSets.Contains(exactMethodMatcher.Parameters)) { instrumentationReport.AddMethodValidation(match.ClassName, exactMethodMatcher, true); continue; } // param was not found instrumentationReport.AddMethodValidation(match.ClassName, exactMethodMatcher, false); continue; } // Did not find method in classmodel, amrking method as false instrumentationReport.AddMethodValidation(match.ClassName, exactMethodMatcher, false); } }