-
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 tests to simplify and inline test cases (#57)
* Remove #pragmas from test data * Combine AbstractClass.Good.cs and AbstractClass.Bad.cs * Split AbstractClass tests up per-test case * Remove dead code from AbstractClass tests * Inline AbstractClass test data into test * Move duplicated AbstractClass test * Split AsAcceptOnlyInterface tests up per-test case * Remove dead code from AsAcceptOnlyInterface tests * Inline AsAcceptOnlyInterface test data into tests * Split CallbackSignatureShouldMatchMockedMethod tests up per-test case * Inline CallbackSignatureShouldMatchMockedMethod test data into tests * Simplify names for ConstructorArgumentsShouldMatch tests * Split ConstructorArgumentsShouldMatch tests up per-test case * Inline ConstructorArgumentsShouldMatch test data into tests * Simplify names for NoConstructorArgumentsForInterfaceMock tests * Split NoConstructorArgumentsForInterfaceMock_1 * Inline NoConstructorAgrumentsForInterfaceMock_1 * Add TODOs for questionable test practices in AbstractClass tests * Split NoConstructorArgumentsForInterfaceMock_2 * Inline NoConstructorAgrumentsForInterfaceMock_2 * Split NoMethodsInPropertySetup * Inline NoMethodsInPropertySetup * Simplify names for NoSealedClassMocks * Split NoSealedClassMocks * Inline NoSealedClassMocks * Simplify SetupOnForOverridableMemebers * Split SetupOnlyForOverridableMembers tests * Simplify SetupOnForOverridableMemebers tests * Inline SetupOnlyforOverridableMemebers * Simplify SetupShouldNotIncludeAsyncResult * Split SetupShouldNotIncludeAsyncResult tests * Inline SetupShouldNotIncludeAsyncResult tests
- Loading branch information
1 parent
d82c8ca
commit b33a321
Showing
74 changed files
with
1,778 additions
and
1,065 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...q.Analyzers.Test/AbstractClassTests.ShouldFailOnGenericTypesWithMismatchArgs.verified.txt
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Diagnostic 1 | ||
Id: Moq1002 | ||
Location: SourceFile(Test0.cs[608..614)) | ||
Highlight: ("42") | ||
Lines: var mock = new Mock<AbstractGenericClassWithCtor<object>>("42"); | ||
Severity: Warning | ||
Message: Parameters provided into mock do not match any existing constructors. | ||
|
||
Diagnostic 2 | ||
Id: Moq1002 | ||
Location: SourceFile(Test0.cs[788..798)) | ||
Highlight: ("42", 42) | ||
Lines: var mock1 = new Mock<AbstractGenericClassWithCtor<object>>("42", 42); | ||
Severity: Warning | ||
Message: Parameters provided into mock do not match any existing constructors. | ||
|
||
Diagnostic 3 | ||
Id: Moq1002 | ||
Location: SourceFile(Test0.cs[934..938)) | ||
Highlight: (42) | ||
Lines: var mock2 = new Mock<AbstractGenericClassDefaultCtor<object>>(42); | ||
Severity: Warning | ||
Message: Parameters provided into mock do not match any existing constructors. | ||
|
24 changes: 24 additions & 0 deletions
24
Source/Moq.Analyzers.Test/AbstractClassTests.ShouldFailOnMismatchArgs.verified.txt
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Diagnostic 1 | ||
Id: Moq1002 | ||
Location: SourceFile(Test0.cs[526..532)) | ||
Highlight: ("42") | ||
Lines: var mock = new Mock<AbstractClassWithCtor>("42"); | ||
Severity: Warning | ||
Message: Parameters provided into mock do not match any existing constructors. | ||
|
||
Diagnostic 2 | ||
Id: Moq1002 | ||
Location: SourceFile(Test0.cs[691..701)) | ||
Highlight: ("42", 42) | ||
Lines: var mock1 = new Mock<AbstractClassWithCtor>("42", 42); | ||
Severity: Warning | ||
Message: Parameters provided into mock do not match any existing constructors. | ||
|
||
Diagnostic 3 | ||
Id: Moq1002 | ||
Location: SourceFile(Test0.cs[822..826)) | ||
Highlight: (42) | ||
Lines: var mock2 = new Mock<AbstractClassDefaultCtor>(42); | ||
Severity: Warning | ||
Message: Parameters provided into mock do not match any existing constructors. | ||
|
48 changes: 0 additions & 48 deletions
48
...zers.Test/AbstractClassTests.ShouldPassIfGoodParametersAndFailOnTypeMismatch.verified.txt
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
Source/Moq.Analyzers.Test/AbstractClassTests.ShouldPassOnGenericTypesWithNoArgs.verified.txt
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
emptyString |
1 change: 1 addition & 0 deletions
1
Source/Moq.Analyzers.Test/AbstractClassTests.ShouldPassWithArgsPassed.verified.txt
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
emptyString |
1 change: 1 addition & 0 deletions
1
Source/Moq.Analyzers.Test/AbstractClassTests.ShouldPassWithNoArgs.verified.txt
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
emptyString |
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
8 changes: 8 additions & 0 deletions
8
...st/AsAcceptOnlyInterfaceAnalyzerTests.ShouldFailWhenUsingAsWithAbstractClass.verified.txt
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Diagnostic 1 | ||
Id: Moq1300 | ||
Location: SourceFile(Test0.cs[292..307)) | ||
Highlight: BaseSampleClass | ||
Lines: mock.As<BaseSampleClass>(); | ||
Severity: Error | ||
Message: Mock.As() should take interfaces only | ||
|
8 changes: 8 additions & 0 deletions
8
...st/AsAcceptOnlyInterfaceAnalyzerTests.ShouldFailWhenUsingAsWithConcreteClass.verified.txt
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Diagnostic 1 | ||
Id: Moq1300 | ||
Location: SourceFile(Test0.cs[433..443)) | ||
Highlight: OtherClass | ||
Lines: mock.As<OtherClass>(); | ||
Severity: Error | ||
Message: Mock.As() should take interfaces only | ||
|
16 changes: 0 additions & 16 deletions
16
...Analyzers.Test/AsAcceptOnlyInterfaceAnalyzerTests.ShouldPassIfGoodParameters.verified.txt
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...s.Test/AsAcceptOnlyInterfaceAnalyzerTests.ShouldPassWhenUsingAsWithInterface.verified.txt
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
emptyString |
1 change: 1 addition & 0 deletions
1
...AcceptOnlyInterfaceAnalyzerTests.ShouldPassWhenUsingAsWithInterfaceWithSetup.verified.txt
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
emptyString |
Oops, something went wrong.