Skip to content

Commit

Permalink
Add a couple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hosch250 committed Jul 8, 2016
1 parent 914dded commit 5b18e37
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,38 @@ End Sub
Assert.AreEqual(1, inspectionResults.Count());
}

[TestMethod]
[TestCategory("Inspections")]
public void InspectionType()
{
var builder = new MockVbeBuilder();
var project = builder.ProjectBuilder("TestProject1", "TestProject1", vbext_ProjectProtection.vbext_pp_none)
.AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, string.Empty)
.AddReference("Excel", "C:\\Program Files\\Microsoft Office\\Root\\Office 16\\EXCEL.EXE", true)
.Build();
var vbe = builder.AddProject(project).Build();

var inspection = new ImplicitActiveSheetReferenceInspection(vbe.Object, null);
Assert.AreEqual(CodeInspectionType.MaintainabilityAndReadabilityIssues, inspection.InspectionType);
}

[TestMethod]
[TestCategory("Inspections")]
public void InspectionName()
{
var builder = new MockVbeBuilder();
var project = builder.ProjectBuilder("TestProject1", "TestProject1", vbext_ProjectProtection.vbext_pp_none)
.AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, string.Empty)
.AddReference("Excel", "C:\\Program Files\\Microsoft Office\\Root\\Office 16\\EXCEL.EXE", true)
.Build();
var vbe = builder.AddProject(project).Build();

const string inspectionName = "ImplicitActiveSheetReferenceInspection";
var inspection = new ImplicitActiveSheetReferenceInspection(vbe.Object, null);

Assert.AreEqual(inspectionName, inspection.Name);
}

private List<Declaration> GetExcelRangeDeclarations()
{
var excelDeclaration = new ProjectDeclaration(new QualifiedMemberName(new QualifiedModuleName("Excel",
Expand Down

0 comments on commit 5b18e37

Please sign in to comment.