-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor test cases to matrix on Moq version (#82)
Refactor test cases so that they test with an "old" version of Moq (4.8.2) and now also a "new" version of Moq (4.18.4). Fixes #58 4.8.2 was the pre-existing test version. Any version prior to 4.13.1 works. (4.13.1 changed the internal implementation of `.As<T>()` [see devlooped/moq@b552aed]). 4.18.4 is the most downloaded version of Moq.
- Loading branch information
1 parent
dad8699
commit 5057438
Showing
13 changed files
with
181 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
using Microsoft.CodeAnalysis.CodeFixes; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using Microsoft.CodeAnalysis.Testing; | ||
|
||
namespace Moq.Analyzers.Test.Helpers; | ||
|
||
internal static class AnalyzerVerifier<TAnalyzer> | ||
where TAnalyzer : DiagnosticAnalyzer, new() | ||
{ | ||
public static async Task VerifyAnalyzerAsync(string source) | ||
public static async Task VerifyAnalyzerAsync(string source, string referenceAssemblyGroup) | ||
{ | ||
ReferenceAssemblies referenceAssemblies = ReferenceAssemblyCatalog.Catalog[referenceAssemblyGroup]; | ||
|
||
await new Test<TAnalyzer, EmptyCodeFixProvider> | ||
{ | ||
TestCode = source, | ||
FixedCode = source, | ||
ReferenceAssemblies = referenceAssemblies, | ||
}.RunAsync().ConfigureAwait(false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
using Microsoft.CodeAnalysis.CodeFixes; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using Microsoft.CodeAnalysis.Testing; | ||
|
||
namespace Moq.Analyzers.Test.Helpers; | ||
|
||
internal static class CodeFixVerifier<TAnalyzer, TCodeFixProvider> | ||
where TAnalyzer : DiagnosticAnalyzer, new() | ||
where TCodeFixProvider : CodeFixProvider, new() | ||
{ | ||
public static async Task VerifyCodeFixAsync(string originalSource, string fixedSource) | ||
public static async Task VerifyCodeFixAsync(string originalSource, string fixedSource, string referenceAssemblyGroup) | ||
{ | ||
ReferenceAssemblies referenceAssemblies = ReferenceAssemblyCatalog.Catalog[referenceAssemblyGroup]; | ||
|
||
await new Test<TAnalyzer, TCodeFixProvider> | ||
{ | ||
TestCode = originalSource, | ||
FixedCode = fixedSource, | ||
ReferenceAssemblies = referenceAssemblies, | ||
}.RunAsync().ConfigureAwait(false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.