public void ObsoleteMemberUsedOnNonMemberDeclaration_DoesNotReturnResult() { const string inputCode = @" '@Obsolete Public s As String"; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _); using (var state = MockParser.CreateAndParse(vbe.Object)) { var inspection = new ObsoleteMemberUsageInspection(state); var inspectionResults = inspection.GetInspectionResults(CancellationToken.None); Assert.IsFalse(inspectionResults.Any()); } }
public void ObsoleteMemberUsed_ReturnsResult() { const string inputCode = @" '@Obsolete Public Sub Foo() End Sub Public Sub Bar() Foo End Sub"; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _); using (var state = MockParser.CreateAndParse(vbe.Object)) { var inspection = new ObsoleteMemberUsageInspection(state); var inspectionResults = inspection.GetInspectionResults(CancellationToken.None); Assert.AreEqual(1, inspectionResults.Count()); } }