Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
(GH-116) Rename MarkdownlintLogFileFormat to MarkdownlintV1LogFileFor…
Browse files Browse the repository at this point in the history
…mat (#119)
  • Loading branch information
pascalberger authored Jul 19, 2020
1 parent c566a53 commit c03bb9e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Testfiles\MarkdownlintCliLogFileFormat\markdownlint-cli-0.22.0.log" />
<EmbeddedResource Include="Testfiles\MarkdownlintLogFileFormat\markdownlint.json" />
<EmbeddedResource Include="Testfiles\MarkdownlintV1LogFileFormat\markdownlint.json" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
using Shouldly;
using Xunit;

public sealed class MarkdownlintLogFileFormatTests
public sealed class MarkdownlintV1LogFileFormatTests
{
public sealed class TheCtor
{
[Fact]
public void Should_Throw_If_Log_Is_Null()
{
// Given / When
var result = Record.Exception(() => new MarkdownlintLogFileFormat(null));
var result = Record.Exception(() => new MarkdownlintV1LogFileFormat(null));

// Then
result.IsArgumentNullException("log");
Expand All @@ -28,7 +28,7 @@ public sealed class TheReadIssuesMethod
public void Should_Read_Issues_Correct()
{
// Given
var fixture = new MarkdownlintIssuesProviderFixture<MarkdownlintLogFileFormat>("markdownlint.json");
var fixture = new MarkdownlintIssuesProviderFixture<MarkdownlintV1LogFileFormat>("markdownlint.json");

// When
var issues = fixture.ReadIssues().ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Should_Throw_If_Log_Is_Null()
var result = Record.Exception(() =>
new MarkdownlintIssuesProvider(
log,
new MarkdownlintIssuesSettings("Foo".ToByteArray(), new MarkdownlintLogFileFormat(new FakeLog()))));
new MarkdownlintIssuesSettings("Foo".ToByteArray(), new MarkdownlintV1LogFileFormat(new FakeLog()))));

// Then
result.IsArgumentNullException("log");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Should_Throw_If_LogFilePath_Is_Null()
{
// Given
FilePath logFilePath = null;
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var result = Record.Exception(() =>
Expand All @@ -34,7 +34,7 @@ public void Should_Throw_If_Format_For_LogFilePath_Is_Null()
// Given
BaseMarkdownlintLogFileFormat format = null;

using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintLogFileFormat.markdownlint.json"))
using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintV1LogFileFormat.markdownlint.json"))
{
// When
var result = Record.Exception(() =>
Expand All @@ -50,7 +50,7 @@ public void Should_Throw_If_LogFileContent_Is_Null()
{
// Given
byte[] logFileContent = null;
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var result = Record.Exception(() =>
Expand Down Expand Up @@ -80,7 +80,7 @@ public void Should_Set_LogFileContent()
{
// Given
var logFileContent = "Foo".ToByteArray();
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var settings = new MarkdownlintIssuesSettings(logFileContent, format);
Expand All @@ -94,7 +94,7 @@ public void Should_Set_LogFileContent_If_Empty()
{
// Given
byte[] logFileContent = Array.Empty<byte>();
var format = new MarkdownlintLogFileFormat(new FakeLog());
var format = new MarkdownlintV1LogFileFormat(new FakeLog());

// When
var settings = new MarkdownlintIssuesSettings(logFileContent, format);
Expand All @@ -107,8 +107,8 @@ public void Should_Set_LogFileContent_If_Empty()
public void Should_Set_LogFileContent_From_LogFilePath()
{
// Given
var format = new MarkdownlintLogFileFormat(new FakeLog());
using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintLogFileFormat.markdownlint.json"))
var format = new MarkdownlintV1LogFileFormat(new FakeLog());
using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintV1LogFileFormat.markdownlint.json"))
{
// When
var settings = new MarkdownlintIssuesSettings(tempFile.FileName, format);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
using Cake.Core.Diagnostics;

/// <summary>
/// Logfile format as written by Markdownlint.
/// Logfile format as written by Markdownlint with <c>options.resultVersion</c> set to 1.
/// </summary>
internal class MarkdownlintLogFileFormat : BaseMarkdownlintLogFileFormat
internal class MarkdownlintV1LogFileFormat : BaseMarkdownlintLogFileFormat
{
/// <summary>
/// Initializes a new instance of the <see cref="MarkdownlintLogFileFormat"/> class.
/// Initializes a new instance of the <see cref="MarkdownlintV1LogFileFormat"/> class.
/// </summary>
/// <param name="log">The Cake log instance.</param>
public MarkdownlintLogFileFormat(ICakeLog log)
public MarkdownlintV1LogFileFormat(ICakeLog log)
: base(log)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
public static partial class MarkdownlintIssuesAliases
{
/// <summary>
/// Gets an instance for the log format as written by Markdownlint.
/// Gets an instance for the log format as written by Markdownlint with <c>options.resultVersion</c> set to 1.
/// </summary>
/// <param name="context">The context.</param>
/// <returns>Instance for the Markdownlint log format.</returns>
/// <returns>Instance for the Markdownlint V1 log format.</returns>
[CakePropertyAlias]
[CakeAliasCategory(IssuesAliasConstants.IssueProviderCakeAliasCategory)]
public static BaseMarkdownlintLogFileFormat MarkdownlintLogFileFormat(
public static BaseMarkdownlintLogFileFormat MarkdownlintV1LogFileFormat(
this ICakeContext context)
{
context.NotNull(nameof(context));

return new MarkdownlintLogFileFormat(context.Log);
return new MarkdownlintV1LogFileFormat(context.Log);
}
}
}

0 comments on commit c03bb9e

Please sign in to comment.