Skip to content

Commit 332470c

Browse files
committed
Remove erronous test for ObjectVariableNotSetInspection
The case under test does not require a set assignment because of a default member access on the RHS.
1 parent edb6c67 commit 332470c

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

RubberduckTests/Inspections/ObjectVariableNotSetInspectionTests.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,6 @@ Private Sub TestSub(ByRef testParam As Variant)
155155
AssertInputCodeYieldsExpectedInspectionResultCount(input, expectResultCount, "VBA.4.2.xml");
156156
}
157157

158-
[Test]
159-
[Category("Inspections")]
160-
public void ObjectVariableNotSet_GivenVariantVariableAssignedRange_ReturnsResult()
161-
{
162-
var expectResultCount = 1;
163-
var input =
164-
@"
165-
Private Sub TestSub(ByRef testParam As Variant)
166-
testParam = Range(""A1:C1"")
167-
End Sub";
168-
AssertInputCodeYieldsExpectedInspectionResultCount(input, expectResultCount, "Excel.1.8.xml");
169-
}
170-
171158
[Test]
172159
[Category("Inspections")]
173160
public void ObjectVariableNotSet_GivenVariantVariableAssignedDeclaredRange_ReturnsResult()
@@ -498,7 +485,7 @@ Dim bar As Collection
498485
bar.Add ""x"", ""x""
499486
foo = ""Test"" & bar.Item(""x"")
500487
End Sub";
501-
AssertInputCodeYieldsExpectedInspectionResultCount(input, expectResultCount, new[]{"VBA.4.2"});
488+
AssertInputCodeYieldsExpectedInspectionResultCount(input, expectResultCount, "VBA.4.2");
502489
}
503490

504491
[Test]
@@ -517,7 +504,7 @@ Dim bar As Long
517504
bar = 42
518505
foo = bar
519506
End Sub";
520-
AssertInputCodeYieldsExpectedInspectionResultCount(input, expectResultCount, new[] { "VBA.4.2" });
507+
AssertInputCodeYieldsExpectedInspectionResultCount(input, expectResultCount);
521508
}
522509

523510
[Test]

0 commit comments

Comments
 (0)