public void EmptyForLoopBlock_InspectionName()
        {
            const string expectedName = nameof(EmptyForLoopBlockInspection);
            var          inspection   = new EmptyForLoopBlockInspection(null);

            Assert.AreEqual(expectedName, inspection.Name);
        }
        public void EmptyForLoopBlock_InspectionType()
        {
            var inspection         = new EmptyForLoopBlockInspection(null);
            var expectedInspection = CodeInspectionType.MaintainabilityAndReadabilityIssues;

            Assert.AreEqual(expectedInspection, inspection.InspectionType);
        }
        private void CheckActualEmptyBlockCountEqualsExpected(string inputCode, int expectedCount)
        {
            var vbe   = MockVbeBuilder.BuildFromSingleStandardModule(inputCode, out _);
            var state = MockParser.CreateAndParse(vbe.Object);

            var inspection    = new EmptyForLoopBlockInspection(state);
            var inspector     = InspectionsHelper.GetInspector(inspection);
            var actualResults = inspector.FindIssuesAsync(state, CancellationToken.None).Result;

            Assert.AreEqual(expectedCount, actualResults.Count());
        }
Exemplo n.º 4
0
        public void EmptyForLoopBlock_InspectionName()
        {
            var inspection = new EmptyForLoopBlockInspection(null);

            Assert.AreEqual(nameof(EmptyForLoopBlockInspection), inspection.Name);
        }