コード例 #1
0
            public void Should_Read_Rule_Url()
            {
                // Given
                var fixture = new InspectCodeIssuesProviderFixture("WithWikiUrl.xml");

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

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

                CheckIssue(
                    issue,
                    "Cake.CodeAnalysisReporting",
                    @"src\Cake.CodeAnalysisReporting\CodeAnalysisReportingAliases.cs",
                    3,
                    "RedundantUsingDirective",
                    "http://www.jetbrains.com/resharperplatform/help?Keyword=RedundantUsingDirective",
                    300,
                    "Warning",
                    @"Using directive is not required by the code and can be safely removed");
            }
コード例 #2
0
            public void Should_Read_Issue_Correct()
            {
                // Given
                var fixture = new InspectCodeIssuesProviderFixture("inspectcode.xml");

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

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

                CheckIssue(
                    issue,
                    "Cake.Issues",
                    @"src\Cake.Issues\CakeAliasConstants.cs",
                    16,
                    "UnusedMember.Global",
                    null,
                    200,
                    "Suggestion",
                    @"Constant 'PullRequestSystemCakeAliasCategory' is never used");
            }
コード例 #3
0
            public void Should_Read_Issue_Without_Line_Correct()
            {
                // Given
                var fixture = new InspectCodeIssuesProviderFixture("WithoutLineButOffset.xml");

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

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

                IssueChecker.Check(
                    issue,
                    IssueBuilder.NewIssue(
                        @"Using directive is not required by the code and can be safely removed",
                        "Cake.Issues.InspectCode.InspectCodeIssuesProvider",
                        "InspectCode")
                    .InProjectOfName("Project1")
                    .InFile(@"Src\myfile.cs", 1)
                    .OfRule("RedundantUsingDirective", new Uri("https://www.jetbrains.com/resharperplatform/help?Keyword=RedundantUsingDirective"))
                    .WithPriority(IssuePriority.Warning)
                    .Create());
            }
コード例 #4
0
            public void Should_Read_Rule_Url()
            {
                // Given
                var fixture = new InspectCodeIssuesProviderFixture("WithWikiUrl.xml");

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

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

                IssueChecker.Check(
                    issue,
                    IssueBuilder.NewIssue(
                        @"Using directive is not required by the code and can be safely removed",
                        "Cake.Issues.InspectCode.InspectCodeIssuesProvider",
                        "InspectCode")
                    .InProjectOfName("Cake.CodeAnalysisReporting")
                    .InFile(@"src\Cake.CodeAnalysisReporting\CodeAnalysisReportingAliases.cs", 3)
                    .OfRule("RedundantUsingDirective", new Uri("http://www.jetbrains.com/resharperplatform/help?Keyword=RedundantUsingDirective"))
                    .WithPriority(IssuePriority.Warning)
                    .Create());
            }
コード例 #5
0
            public void Should_Read_Issue_Correct()
            {
                // Given
                var fixture = new InspectCodeIssuesProviderFixture("inspectcode.xml");

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

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

                IssueChecker.Check(
                    issue,
                    IssueBuilder.NewIssue(
                        "Constant 'PullRequestSystemCakeAliasCategory' is never used",
                        "Cake.Issues.InspectCode.InspectCodeIssuesProvider",
                        "InspectCode")
                    .InProjectOfName("Cake.Issues")
                    .InFile(@"src\Cake.Issues\CakeAliasConstants.cs", 16)
                    .OfRule("UnusedMember.Global")
                    .WithPriority(IssuePriority.Suggestion)
                    .Create());
            }