Example #1
0
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.DevExtremeLocation,
                        "https://foo/"));
            }
Example #2
0
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.JQueryVersion,
                        "1.0.0"));
            }
            public void Should_Not_Fail_On_Report_Creation(bool value)
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.EnableExporting,
                        value));
            }
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.IdeIntegrationSettings,
                        new IdeIntegrationSettings()));
            }
Example #5
0
            public void Should_Pass_Options_To_ViewBag()
            {
                // Given
                var expectedResult = "Foo";
                var fixture        = new GenericIssueReportFixture("@ViewBag.Title");

                fixture.GenericIssueReportFormatSettings.WithOption("Title", expectedResult);

                // When
                var result = fixture.CreateReport(new List <IIssue>());

                // Then
                result.ShouldBe(expectedResult);
            }
Example #6
0
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.FileLinkSettings,
                        FileLinkSettings.GitHub(
                            new Uri("https://github.com/cake-contrib/Cake.Issues.Reporting.Generic"),
                            "master",
                            null)));
            }
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.SortedColumns,
                        new List <ReportColumn>
                {
                    ReportColumn.Rule,
                    ReportColumn.Message,
                }));
            }
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.GroupedColumns,
                        new List <ReportColumn>
                {
                    ReportColumn.ProjectName,
                    ReportColumn.FileDirectory,
                    ReportColumn.FileName,
                }));
            }
            public void Should_Not_Fail_On_Report_Creation()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                // When / Then
                fixture.TestReportCreation(
                    settings =>
                    settings.WithOption(
                        HtmlDxDataGridOption.AdditionalColumns,
                        new List <HtmlDxDataGridColumnDescription>
                {
                    new HtmlDxDataGridColumnDescription("MyCustomColumn", x => "Foo")
                    {
                        Caption = "Custom Value",
                    },
                }));
            }
            public void Should_Show_Header_If_True()
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                fixture.GenericIssueReportFormatSettings
                .WithOption(HtmlDxDataGridOption.ShowHeader, true);

                // When
                var result = fixture.CreateReport(new List <IIssue>());

                // Then
                var doc = new HtmlDocument();

                doc.LoadHtml(result);
                var headingElements = doc.DocumentNode.Descendants("h1");

                headingElements.ShouldHaveSingleItem();
            }
            public void Should_Set_Theme(DevExtremeTheme theme)
            {
                // Given
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                fixture.GenericIssueReportFormatSettings
                .WithOption(HtmlDxDataGridOption.Theme, theme);

                // When
                var result = fixture.CreateReport(new List <IIssue>());

                // Then
                var doc = new HtmlDocument();

                doc.LoadHtml(result);
                var stylesheetElements = doc.DocumentNode.SelectNodes("//link[@rel='stylesheet']");

                stylesheetElements.Count.ShouldBe(2);
                stylesheetElements.ShouldContain(x => x.Attributes["href"].Value.EndsWith(theme.GetCssFileName()));
            }
            public void Should_Set_Heading()
            {
                // Given
                var title   = "Foo";
                var fixture = new GenericIssueReportFixture(GenericIssueReportTemplate.HtmlDxDataGrid);

                fixture.GenericIssueReportFormatSettings
                .WithOption(HtmlDxDataGridOption.Title, title);

                // When
                var result = fixture.CreateReport(new List <IIssue>());

                // Then
                var doc = new HtmlDocument();

                doc.LoadHtml(result);
                var headingElements = doc.DocumentNode.Descendants("h1").ToList();

                headingElements.ShouldHaveSingleItem();
                headingElements.Single().InnerText.ShouldBe(title);
            }