Skip to content

Commit df121ba

Browse files
committed
Add more tests.
1 parent 68d737f commit df121ba

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

RubberduckTests/Inspections/ImplicitActiveWorkbookReferenceInspectionTests.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@ Debug.Print book.Worksheets.Count
111111
Assert.AreEqual(expected, actual);
112112
}
113113

114+
[Test]
115+
[Category("Inspections")]
116+
public void ImplicitActiveWorkbookReference_DimAsTypeWorksheets_NotReported()
117+
{
118+
const string inputCode =
119+
@"
120+
Sub foo()
121+
Dim allSheets As Worksheets
122+
End Sub";
123+
124+
const int expected = 0;
125+
var actual = ArrangeAndGetInspectionCount(inputCode);
126+
127+
Assert.AreEqual(expected, actual);
128+
}
129+
114130
[Test]
115131
[Category("Inspections")]
116132
public void ImplicitActiveWorkbookReference_DimAsTypeSheets_NotReported()
@@ -127,6 +143,22 @@ Dim allSheets As Sheets
127143
Assert.AreEqual(expected, actual);
128144
}
129145

146+
[Test]
147+
[Category("Inspections")]
148+
public void ImplicitActiveWorkbookReference_DimAsTypeNames_NotReported()
149+
{
150+
const string inputCode =
151+
@"
152+
Sub foo()
153+
Dim allNames As Names
154+
End Sub";
155+
156+
const int expected = 0;
157+
var actual = ArrangeAndGetInspectionCount(inputCode);
158+
159+
Assert.AreEqual(expected, actual);
160+
}
161+
130162
[Test]
131163
[Category("Inspections")]
132164
public void ImplicitActiveWorkbookReference_Ignored_DoesNotReportRange()

0 commit comments

Comments
 (0)