Example #1
0
            public void Should_Read_Issue_Without_File_Correct()
            {
                // Given
                var fixture = new MsBuildIssuesProviderFixture("IssueWithoutFile.xml");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                var issue = issues.Single();

                CheckIssue(
                    issue,
                    null,
                    null,
                    "CA1711",
                    0,
                    "Microsoft.Naming : Rename type name 'UniqueQueue(Of T)' so that it does not end in 'Queue'.");
            }
Example #2
0
            public void Should_Read_Issue_With_File_Without_Path_Correct()
            {
                // Given
                var fixture = new MsBuildIssuesProviderFixture("IssueWithOnlyFileName.xml");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                var issue = issues.Single();

                CheckIssue(
                    issue,
                    @"src\Cake.Prca.CodeAnalysisProvider.MsBuild.Tests\MsBuildCodeAnalysisProviderTests.cs",
                    13,
                    "CS0219",
                    0,
                    "The variable 'foo' is assigned but its value is never used");
            }
Example #3
0
            public void Should_Read_Issue_With_Line_Zero_Correct()
            {
                // Given
                var fixture = new MsBuildIssuesProviderFixture("IssueWithLineZero.xml");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                var issue = issues.Single();

                CheckIssue(
                    issue,
                    @"SHFB",
                    null,
                    "BE0006",
                    0,
                    @"Unable to locate any documentation sources for 'c:\Source\Cake.Prca\Cake.Prca..csproj' (Configuration: Debug Platform: AnyCPU)");
            }
Example #4
0
            public void Should_Read_Issue_With_File_Correct()
            {
                // Given
                var fixture = new MsBuildIssuesProviderFixture("IssueWithFile.xml");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                var issue = issues.Single();

                CheckIssue(
                    issue,
                    @"src\Cake.Prca.CodeAnalysisProvider.MsBuild.Tests\MsBuildCodeAnalysisProviderTests.cs",
                    1311,
                    "CA2201",
                    0,
                    @"Microsoft.Usage : 'ConfigurationManager.GetSortedConfigFiles(String)' creates an exception of type 'ApplicationException', an exception type that is not sufficiently specific and should never be raised by user code. If this exception instance might be thrown, use a different exception type.");
            }