Skip to content
This repository was archived by the owner on Apr 6, 2024. It is now read-only.

Commit 3949aab

Browse files
committed
Merge branch 'release/0.4.1'
2 parents 467ccc0 + 3f57d10 commit 3949aab

File tree

9 files changed

+424
-28
lines changed

9 files changed

+424
-28
lines changed

nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
2121
<requireLicenseAcceptance>false</requireLicenseAcceptance>
2222
<copyright>Copyright © Pascal Berger</copyright>
2323
<tags>Cake Script Cake-Issues Cake-ReportFormat Issues Reporting Html Markdown</tags>
24-
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting.Generic/releases/tag/0.4.0</releaseNotes>
24+
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Reporting.Generic/releases/tag/0.4.1</releaseNotes>
2525
</metadata>
2626
<files>
2727
<file src="Cake.Issues.Reporting.Generic.dll" target="lib\net46" />

src/Cake.Issues.Reporting.Generic.Tests/Cake.Issues.Reporting.Generic.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<ItemGroup>
8686
<Compile Include="ColumnSortOrderExtensionsTests.cs" />
8787
<Compile Include="DevExtremeThemeExtensionsTests.cs" />
88+
<Compile Include="IIssueExtensionTests.cs" />
8889
<Compile Include="UriExtensionsTests.cs" />
8990
<Compile Include="FileLinkSettingsTests.cs" />
9091
<Compile Include="GenericIssueReportFixture.cs" />
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
namespace Cake.Issues.Reporting.Generic.Tests
2+
{
3+
using Cake.Issues.Testing;
4+
using Shouldly;
5+
using Xunit;
6+
7+
public sealed class IIssueExtensionTests
8+
{
9+
public sealed class TheProjectPathExtension
10+
{
11+
[Fact]
12+
public void Should_Throw_If_Issue_Is_Null()
13+
{
14+
// Given
15+
IIssue issue = null;
16+
17+
// When
18+
var result = Record.Exception(() => issue.ProjectPath());
19+
20+
// Then
21+
result.IsArgumentNullException("issue");
22+
}
23+
24+
[Fact]
25+
public void Should_Return_Full_Path()
26+
{
27+
// Given
28+
var projectPath = @"src\Cake.Issues.Reporting.Generic.Tests\Cake.Issues.Reporting.Generic.Tests.csproj";
29+
var issue =
30+
IssueBuilder
31+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
32+
.InProjectFile(projectPath)
33+
.Create();
34+
35+
// When
36+
var result = issue.ProjectPath();
37+
38+
// Then
39+
result.ShouldBe(@"src/Cake.Issues.Reporting.Generic.Tests/Cake.Issues.Reporting.Generic.Tests.csproj");
40+
}
41+
42+
[Fact]
43+
public void Should_Return_Null_If_Project_Is_Not_Set()
44+
{
45+
// Given
46+
var issue =
47+
IssueBuilder
48+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
49+
.Create();
50+
51+
// When
52+
var result = issue.ProjectPath();
53+
54+
// Then
55+
result.ShouldBeNull();
56+
}
57+
}
58+
59+
public sealed class TheFilePathExtension
60+
{
61+
[Fact]
62+
public void Should_Throw_If_Issue_Is_Null()
63+
{
64+
// Given
65+
IIssue issue = null;
66+
67+
// When
68+
var result = Record.Exception(() => issue.FilePath());
69+
70+
// Then
71+
result.IsArgumentNullException("issue");
72+
}
73+
74+
[Fact]
75+
public void Should_Return_Full_Path()
76+
{
77+
// Given
78+
var filePath = @"src\Cake.Issues.Reporting.Generic.Tests\Foo.cs";
79+
var issue =
80+
IssueBuilder
81+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
82+
.InFile(filePath)
83+
.Create();
84+
85+
// When
86+
var result = issue.FilePath();
87+
88+
// Then
89+
result.ShouldBe(@"src/Cake.Issues.Reporting.Generic.Tests/Foo.cs");
90+
}
91+
92+
[Fact]
93+
public void Should_Return_Null_If_File_Is_Not_Set()
94+
{
95+
// Given
96+
var issue =
97+
IssueBuilder
98+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
99+
.Create();
100+
101+
// When
102+
var result = issue.FilePath();
103+
104+
// Then
105+
result.ShouldBeNull();
106+
}
107+
}
108+
109+
public sealed class TheFileDirectoryExtension
110+
{
111+
[Fact]
112+
public void Should_Throw_If_Issue_Is_Null()
113+
{
114+
// Given
115+
IIssue issue = null;
116+
117+
// When
118+
var result = Record.Exception(() => issue.FileDirectory());
119+
120+
// Then
121+
result.IsArgumentNullException("issue");
122+
}
123+
124+
[Fact]
125+
public void Should_Return_Full_Path()
126+
{
127+
// Given
128+
var filePath = @"src\Cake.Issues.Reporting.Generic.Tests\Foo.cs";
129+
var issue =
130+
IssueBuilder
131+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
132+
.InFile(filePath)
133+
.Create();
134+
135+
// When
136+
var result = issue.FileDirectory();
137+
138+
// Then
139+
result.ShouldBe(@"src/Cake.Issues.Reporting.Generic.Tests");
140+
}
141+
142+
[Fact]
143+
public void Should_Return_Null_If_File_Is_Not_Set()
144+
{
145+
// Given
146+
var issue =
147+
IssueBuilder
148+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
149+
.Create();
150+
151+
// When
152+
var result = issue.FileDirectory();
153+
154+
// Then
155+
result.ShouldBeNull();
156+
}
157+
}
158+
159+
public sealed class TheFileNameExtension
160+
{
161+
[Fact]
162+
public void Should_Throw_If_Issue_Is_Null()
163+
{
164+
// Given
165+
IIssue issue = null;
166+
167+
// When
168+
var result = Record.Exception(() => issue.FileName());
169+
170+
// Then
171+
result.IsArgumentNullException("issue");
172+
}
173+
174+
[Fact]
175+
public void Should_Return_Full_Path()
176+
{
177+
// Given
178+
var filePath = @"src\Cake.Issues.Reporting.Generic.Tests\Foo.cs";
179+
var issue =
180+
IssueBuilder
181+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
182+
.InFile(filePath)
183+
.Create();
184+
185+
// When
186+
var result = issue.FileName();
187+
188+
// Then
189+
result.ShouldBe("Foo.cs");
190+
}
191+
192+
[Fact]
193+
public void Should_Return_Null_If_File_Is_Not_Set()
194+
{
195+
// Given
196+
var issue =
197+
IssueBuilder
198+
.NewIssue("Message Foo", "ProviderType Foo", "ProviderName Foo")
199+
.Create();
200+
201+
// When
202+
var result = issue.FileName();
203+
204+
// Then
205+
result.ShouldBeNull();
206+
}
207+
}
208+
}
209+
}

src/Cake.Issues.Reporting.Generic/Cake.Issues.Reporting.Generic.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
<Compile Include="ColumnSortOrderExtensions.cs" />
7171
<Compile Include="DevExtremeTheme.cs" />
7272
<Compile Include="DevExtremeThemeExtensions.cs" />
73-
<Compile Include="FileLinkType.cs" />
7473
<Compile Include="FileLinkSettings.cs" />
7574
<Compile Include="HtmlDxDataGridOption.cs" />
7675
<Compile Include="GenericIssueReportFormatAliases.cs" />

src/Cake.Issues.Reporting.Generic/FileLinkSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ public string GetFileLink(IIssue issue)
8787
.Replace("{ProviderName}", issue.ProviderName)
8888
.Replace("{Priority}", issue.Priority?.ToString())
8989
.Replace("{PriorityName}", issue.PriorityName)
90-
.Replace("{ProjectPath}", issue.ProjectFileRelativePath?.FullPath.ToString())
90+
.Replace("{ProjectPath}", issue.ProjectPath())
9191
.Replace("{PojectName}", issue.ProjectName)
92-
.Replace("{FilePath}", issue.AffectedFileRelativePath?.FullPath.ToString())
93-
.Replace("{Path}", issue.FilePath())
92+
.Replace("{FilePath}", issue.FilePath())
93+
.Replace("{Path}", issue.FileDirectory())
9494
.Replace("{File}", issue.FileName())
9595
.Replace("{Line}", issue.Line?.ToString())
9696
.Replace("{Rule}", issue.Rule)

src/Cake.Issues.Reporting.Generic/FileLinkType.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Cake.Issues.Reporting.Generic/HtmlDxDataGridOption.cs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ public enum HtmlDxDataGridOption
4747
/// </summary>
4848
EnableFiltering,
4949

50+
/// <summary>
51+
/// Flag if the <see cref="ReportColumn.ProviderType"/> column should be visible or not.
52+
/// Either <c>true</c> or <c>false</c>.
53+
/// Default value is <c>false</c>.
54+
/// </summary>
55+
ProviderTypeVisible,
56+
57+
/// <summary>
58+
/// Sort order of the <see cref="ReportColumn.ProviderType"/> column if it is part of <see cref="SortedColumns"/>.
59+
/// See <see cref="ColumnSortOrder"/> for possible values.
60+
/// Default value is <see cref="ColumnSortOrder.Ascending"/>.
61+
/// </summary>
62+
ProviderTypeSortOrder,
63+
5064
/// <summary>
5165
/// Flag if the <see cref="ReportColumn.ProviderName"/> column should be visible or not.
5266
/// Either <c>true</c> or <c>false</c>.
@@ -61,6 +75,20 @@ public enum HtmlDxDataGridOption
6175
/// </summary>
6276
ProviderNameSortOrder,
6377

78+
/// <summary>
79+
/// Flag if the <see cref="ReportColumn.Priority"/> column should be visible or not.
80+
/// Either <c>true</c> or <c>false</c>.
81+
/// Default value is <c>false</c>.
82+
/// </summary>
83+
PriorityVisible,
84+
85+
/// <summary>
86+
/// Sort order of the <see cref="ReportColumn.Priority"/> column if it is part of <see cref="SortedColumns"/>.
87+
/// See <see cref="ColumnSortOrder"/> for possible values.
88+
/// Default value is <see cref="ColumnSortOrder.Descending"/>.
89+
/// </summary>
90+
PrioritySortOrder,
91+
6492
/// <summary>
6593
/// Flag if the <see cref="ReportColumn.PriorityName"/> column should be visible or not.
6694
/// Either <c>true</c> or <c>false</c>.
@@ -75,6 +103,20 @@ public enum HtmlDxDataGridOption
75103
/// </summary>
76104
PriorityNameSortOrder,
77105

106+
/// <summary>
107+
/// Flag if the <see cref="ReportColumn.ProjectPath"/> column should be visible or not.
108+
/// Either <c>true</c> or <c>false</c>.
109+
/// Default value is <c>false</c>.
110+
/// </summary>
111+
ProjectPathVisible,
112+
113+
/// <summary>
114+
/// Sort order of the <see cref="ReportColumn.ProjectPath"/> column if it is part of <see cref="SortedColumns"/>.
115+
/// See <see cref="ColumnSortOrder"/> for possible values.
116+
/// Default value is <see cref="ColumnSortOrder.Ascending"/>.
117+
/// </summary>
118+
ProjectPathSortOrder,
119+
78120
/// <summary>
79121
/// Flag if the <see cref="ReportColumn.ProjectName"/> column should be visible or not.
80122
/// Either <c>true</c> or <c>false</c>.
@@ -89,6 +131,20 @@ public enum HtmlDxDataGridOption
89131
/// </summary>
90132
ProjectNameSortOrder,
91133

134+
/// <summary>
135+
/// Flag if the <see cref="ReportColumn.FilePath"/> column should be visible or not.
136+
/// Either <c>true</c> or <c>false</c>.
137+
/// Default value is <c>false</c>.
138+
/// </summary>
139+
FilePathVisible,
140+
141+
/// <summary>
142+
/// Sort order of the <see cref="ReportColumn.FilePath"/> column if it is part of <see cref="SortedColumns"/>.
143+
/// See <see cref="ColumnSortOrder"/> for possible values.
144+
/// Default value is <see cref="ColumnSortOrder.Ascending"/>.
145+
/// </summary>
146+
FilePathSortOrder,
147+
92148
/// <summary>
93149
/// Flag if the <see cref="ReportColumn.Path"/> column should be visible or not.
94150
/// Either <c>true</c> or <c>false</c>.
@@ -145,6 +201,20 @@ public enum HtmlDxDataGridOption
145201
/// </summary>
146202
RuleSortOrder,
147203

204+
/// <summary>
205+
/// Flag if the <see cref="ReportColumn.RuleUrl"/> column should be visible or not.
206+
/// Either <c>true</c> or <c>false</c>.
207+
/// Default value is <c>false</c>.
208+
/// </summary>
209+
RuleUrlVisible,
210+
211+
/// <summary>
212+
/// Sort order of the <see cref="ReportColumn.RuleUrl"/> column if it is part of <see cref="SortedColumns"/>.
213+
/// See <see cref="ColumnSortOrder"/> for possible values.
214+
/// Default value is <see cref="ColumnSortOrder.Ascending"/>.
215+
/// </summary>
216+
RuleUrlSortOrder,
217+
148218
/// <summary>
149219
/// Flag if the <see cref="ReportColumn.Message"/> column should be visible or not.
150220
/// Either <c>true</c> or <c>false</c>.

0 commit comments

Comments
 (0)