コード例 #1
0
 public static void VerifyFix(
     string source,
     string newSource,
     DiagnosticAnalyzer analyzer,
     CodeFixProvider fixProvider,
     bool allowNewCompilerDiagnostics = false)
 {
     CodeFixVerifier.VerifyFix(
         source: source,
         newSource: newSource,
         analyzer: analyzer,
         fixProvider: fixProvider,
         language: LanguageNames.CSharp,
         allowNewCompilerDiagnostics: allowNewCompilerDiagnostics);
 }
コード例 #2
0
 /// <summary>
 ///     Called to test a VB codefix when applied on the inputted string as a source
 /// </summary>
 /// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it</param>
 /// <param name="newSource">A class in the form of a string after the CodeFix was applied to it</param>
 /// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple</param>
 /// <param name="allowNewCompilerDiagnostics">
 ///     A bool controlling whether or not the test will fail if the CodeFix
 ///     introduces other warnings after being applied
 /// </param>
 protected void VerifyFix(string oldSource, string newSource, int?codeFixIndex = null, bool allowNewCompilerDiagnostics = false)
 {
     _codeFixVerifier.VerifyFix(CodeFixProvider, DiagnosticAnalyzer, LanguageNames.VisualBasic, oldSource, newSource, codeFixIndex, allowNewCompilerDiagnostics);
 }