-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the PosInfoMoq2005 rule to check only the class types.
- Loading branch information
1 parent
64faf38
commit 33de2d5
Showing
2 changed files
with
19 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,8 +208,12 @@ private C(int a, object b, int c, System.IDisposable d) | |
await Verifier.VerifyAnalyzerAsync(source); | ||
} | ||
|
||
Check warning on line 210 in tests/Moq.Analyzers.Tests/Analyzers/ConstructorArgumentsMustMatchAnalyzerTest.cs
|
||
[Fact] | ||
public async Task Arguments_Match_WithNoConstructor() | ||
|
||
[Theory] | ||
[InlineData("class")] | ||
[InlineData("abstract class")] | ||
[InlineData("interface")] | ||
public async Task Arguments_Match_WithNoConstructor(string type) | ||
{ | ||
var source = @" | ||
namespace ConsoleApplication1 | ||
|
@@ -224,7 +228,7 @@ public void TestMethod() | |
} | ||
} | ||
public class ClassWithNoConstructor { } | ||
public " + type + @" ClassWithNoConstructor { } | ||
}"; | ||
|
||
await Verifier.VerifyAnalyzerAsync(source); | ||
|
@@ -272,8 +276,11 @@ public C(int a, object b, int c, System.IDisposable d) | |
await Verifier.VerifyAnalyzerAsync(source); | ||
} | ||
|
||
[Fact] | ||
public async Task Arguments_Match_WithMockBehavior_WithNoConstructor() | ||
[Theory] | ||
[InlineData("class")] | ||
[InlineData("abstract class")] | ||
[InlineData("interface")] | ||
public async Task Arguments_Match_WithMockBehavior_WithNoConstructor(string type) | ||
{ | ||
var source = @" | ||
namespace ConsoleApplication1 | ||
|
@@ -288,7 +295,7 @@ public void TestMethod() | |
} | ||
} | ||
public class ClassWithNoConstructor { } | ||
public " + type + @" ClassWithNoConstructor { } | ||
}"; | ||
|
||
await Verifier.VerifyAnalyzerAsync(source); | ||
|