public void IssuesFileIsEmpty()
        {
            var tempInputFilePath = Path.Combine(TestContext.DeploymentDirectory, ParameterLoader.ParameterConfigurationFileName);

            File.Copy(Path.Combine(TestResourcesFolderName, "ConfigurationTest.Empty.Cs.xml"), tempInputFilePath, true);

            Program.RunAnalysis(new ScannerAnalyzerConfiguration
            {
                InputConfigurationPath = tempInputFilePath,
                OutputFolderPath       = OutputFolderName,
                Language = AnalyzerLanguage.CSharp.ToString(),
                WorkDirectoryConfigFilePath = Path.Combine(TestResourcesFolderName, "ProjectOutFolderPath.txt")
            });

            var fileIssues = EndToEnd_CSharp.GetDeserializedData <FileIssues>(Path.Combine(OutputFolderName, Program.IssuesFileName));

            Assert.AreEqual(0, fileIssues.Count);
        }
Esempio n. 2
0
        public void Symbol_Reference_Computed_VisualBasic()
        {
            var testFileContent = File.ReadAllLines(EndToEnd_CSharp.TestInputPath + extension);

            EndToEnd_CSharp.CheckTokenReferenceFile(testFileContent, extension, 4, new[]
            {
                new EndToEnd_CSharp.ExpectedReferenceInfo {
                    Index = 0, NumberOfReferences = 1, DeclarationText = "TTTestClass", ReferenceText = "TTTestClass"
                },
                new EndToEnd_CSharp.ExpectedReferenceInfo {
                    Index = 1, NumberOfReferences = 0, DeclarationText = "MyMethod"
                },
                new EndToEnd_CSharp.ExpectedReferenceInfo {
                    Index = 2, NumberOfReferences = 1, DeclarationText = "x", ReferenceText = "x"
                },
                new EndToEnd_CSharp.ExpectedReferenceInfo {
                    Index = 3, NumberOfReferences = 0, DeclarationText = "y", ReferenceText = "y"
                }
            });
        }
Esempio n. 3
0
        public void Token_Types_Computed_VisualBasic()
        {
            var testFileContent = File.ReadAllLines(EndToEnd_CSharp.TestInputPath + extension);

            EndToEnd_CSharp.CheckTokenInfoFile(testFileContent, extension, 32, new[]
            {
                new EndToEnd_CSharp.ExpectedTokenInfo {
                    Index = 7, Kind = TokenType.Comment, Text = "' FIXME: fix this issue"
                },
                new EndToEnd_CSharp.ExpectedTokenInfo {
                    Index = 6, Kind = TokenType.TypeName, Text = "TTTestClass"
                },
                new EndToEnd_CSharp.ExpectedTokenInfo {
                    Index = 17, Kind = TokenType.TypeName, Text = "TTTestClass"
                },
                new EndToEnd_CSharp.ExpectedTokenInfo {
                    Index = 16, Kind = TokenType.Keyword, Text = "New"
                }
            });
        }
Esempio n. 4
0
 public void Cpd_Tokens_Computed_VisualBasic()
 {
     EndToEnd_CSharp.CheckCpdTokens(
         @"Public Class TTTestClass Public Function MyMethod ( ) As Object Dim x = $num Dim y = New TTTestClass " +
         "If $num = $num Then Return x + $str End If Return $char End Function End Class");
 }