This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
361 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 6 additions & 36 deletions
42
src/Cake.Issues.EsLint.Tests/EsLintIssuesProviderFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,18 @@ | ||
namespace Cake.Issues.EsLint.Tests | ||
{ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Cake.Testing; | ||
using Core.Diagnostics; | ||
using Cake.Issues.Testing; | ||
|
||
public class EsLintIssuesProviderFixture | ||
public class EsLintIssuesProviderFixture<T> | ||
: BaseMultiFormatIssueProviderFixture<EsLintIssuesProvider, EsLintIssuesSettings, T> | ||
where T : BaseEsLintLogFileFormat | ||
{ | ||
public EsLintIssuesProviderFixture(string fileResourceName) | ||
: base(fileResourceName) | ||
{ | ||
this.Log = new FakeLog { Verbosity = Verbosity.Normal }; | ||
|
||
using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.EsLint.Tests.Testfiles." + fileResourceName)) | ||
{ | ||
using (var sr = new StreamReader(stream)) | ||
{ | ||
this.Settings = | ||
EsLintIssuesSettings.FromContent( | ||
sr.ReadToEnd(), | ||
new JsonFormat(this.Log)); | ||
} | ||
} | ||
|
||
this.RepositorySettings = | ||
new RepositorySettings(@"c:\Source\Cake.Issues"); | ||
} | ||
|
||
public FakeLog Log { get; set; } | ||
|
||
public EsLintIssuesSettings Settings { get; set; } | ||
|
||
public RepositorySettings RepositorySettings { get; set; } | ||
|
||
internal EsLintIssuesProvider Create() | ||
{ | ||
var provider = new EsLintIssuesProvider(this.Log, this.Settings); | ||
provider.Initialize(this.RepositorySettings); | ||
return provider; | ||
} | ||
|
||
internal IEnumerable<IIssue> ReadIssues() | ||
{ | ||
var issueProvider = this.Create(); | ||
return issueProvider.ReadIssues(IssueCommentFormat.PlainText); | ||
} | ||
protected override string FileResourceNamespace => "Cake.Issues.EsLint.Tests.Testfiles." + typeof(T).Name + "."; | ||
} | ||
} |
35 changes: 21 additions & 14 deletions
35
src/Cake.Issues.EsLint.Tests/EsLintIssuesProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.