Skip to content

Commit 9abc482

Browse files
committed
Fix tests mad inconclusive because of bad code in a recent PR
1 parent b2d883a commit 9abc482

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

RubberduckTests/Inspections/ParameterCanBeByValInspectionTests.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,24 @@ public void ParameterCanBeByVal_NoResultForByValObject()
8888
const string inputCode =
8989
@"Sub Foo(ByVal arg1 As Collection)
9090
End Sub";
91-
Assert.AreEqual(0, InspectionResultsForStandardModule(inputCode).Count());
91+
var inspectionResults = InspectionResultsForStandardModule(inputCode);
92+
93+
Assert.AreEqual(0, inspectionResults.Count());
9294
}
9395

9496
[TestCase("Sub Foo(ByVal arg1 As Collection)\r\nEnd Sub", 0)]
95-
[TestCase("Sub Foo(arg1 As String\r\nEnd Sub", 1)]
97+
[TestCase("Sub Foo(arg1 As String)\r\nEnd Sub", 1)]
9698
[TestCase("Sub Foo(ByRef arg1 As String)\r\nEnd Sub", 1)]
9799
[TestCase("Sub Foo(arg1 As String, arg2 As Date)\r\nEnd Sub", 2)]
98-
[TestCase("Sub Sub Foo(ByVal arg1 As String)\r\nEnd Sub", 0)]
100+
[TestCase("Sub Foo(ByVal arg1 As String)\r\nEnd Sub", 0)]
99101
[TestCase("Sub Foo(arg1 As String, ByVal arg2 As Integer)\r\nEnd Sub", 1)]
100-
[TestCase("Foo(ByRef arg1() As Variant)\r\nEnd Sub", 0)]
102+
[TestCase("Sub Foo(ByRef arg1() As Variant)\r\nEnd Sub", 0)]
101103
[Category("Inspections")]
102104
public void ParameterCanBeByVal_NoResultForByValObject(string inputCode, int expectedCount)
103105
{
104-
Assert.AreEqual(expectedCount, InspectionResultsForStandardModule(inputCode).Count());
106+
var inspectionResults = InspectionResultsForStandardModule(inputCode);
107+
108+
Assert.AreEqual(expectedCount, inspectionResults.Count());
105109
}
106110

107111
[Test]

0 commit comments

Comments
 (0)