Skip to content

Commit 5b18e37

Browse files
committed
Add a couple tests
1 parent 914dded commit 5b18e37

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

RubberduckTests/Inspections/ImplicitActiveSheetReferenceInspectionTests.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@ End Sub
5353
Assert.AreEqual(1, inspectionResults.Count());
5454
}
5555

56+
[TestMethod]
57+
[TestCategory("Inspections")]
58+
public void InspectionType()
59+
{
60+
var builder = new MockVbeBuilder();
61+
var project = builder.ProjectBuilder("TestProject1", "TestProject1", vbext_ProjectProtection.vbext_pp_none)
62+
.AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, string.Empty)
63+
.AddReference("Excel", "C:\\Program Files\\Microsoft Office\\Root\\Office 16\\EXCEL.EXE", true)
64+
.Build();
65+
var vbe = builder.AddProject(project).Build();
66+
67+
var inspection = new ImplicitActiveSheetReferenceInspection(vbe.Object, null);
68+
Assert.AreEqual(CodeInspectionType.MaintainabilityAndReadabilityIssues, inspection.InspectionType);
69+
}
70+
71+
[TestMethod]
72+
[TestCategory("Inspections")]
73+
public void InspectionName()
74+
{
75+
var builder = new MockVbeBuilder();
76+
var project = builder.ProjectBuilder("TestProject1", "TestProject1", vbext_ProjectProtection.vbext_pp_none)
77+
.AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, string.Empty)
78+
.AddReference("Excel", "C:\\Program Files\\Microsoft Office\\Root\\Office 16\\EXCEL.EXE", true)
79+
.Build();
80+
var vbe = builder.AddProject(project).Build();
81+
82+
const string inspectionName = "ImplicitActiveSheetReferenceInspection";
83+
var inspection = new ImplicitActiveSheetReferenceInspection(vbe.Object, null);
84+
85+
Assert.AreEqual(inspectionName, inspection.Name);
86+
}
87+
5688
private List<Declaration> GetExcelRangeDeclarations()
5789
{
5890
var excelDeclaration = new ProjectDeclaration(new QualifiedMemberName(new QualifiedModuleName("Excel",

0 commit comments

Comments
 (0)