-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from Ellerbach/92-fix-docassembler-mailto-ref
Fixed mailto reference detection
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
using Bogus; | ||
using DocAssembler.Actions; | ||
using DocAssembler.Configuration; | ||
using DocAssembler.FileService; | ||
using DocAssembler.Test.Helpers; | ||
using FluentAssertions; | ||
using Microsoft.Extensions.Logging; | ||
|
@@ -38,7 +39,47 @@ public async void Issue_89_refHeaderInSameFile() | |
string expected = | ||
@"#Documentation Readme | ||
LINK [title](#documentation-readme)"; | ||
LINK [title](#documentation-readme)".NormalizeContent(); | ||
|
||
var folder = _fileService.AddFolder($"docs"); | ||
_fileService.AddFile(folder, "README.md", string.Empty | ||
.AddRaw(expected)); | ||
|
||
// arrange | ||
AssembleConfiguration config = new AssembleConfiguration | ||
{ | ||
DestinationFolder = "out", | ||
Content = | ||
[ | ||
new Content | ||
{ | ||
SourceFolder = "docs", | ||
DestinationFolder = "general", | ||
Files = { "**" }, | ||
} | ||
] | ||
}; | ||
|
||
InventoryAction action = new(_workingFolder, config, _fileService, _logger); | ||
|
||
// act | ||
var ret = await action.RunAsync(); | ||
|
||
// assert | ||
ret.Should().Be(ReturnCode.Normal); | ||
var content = _fileService.ReadAllText(_fileService.Files.Last().Key); | ||
content.Should().Be(expected); | ||
} | ||
|
||
[Fact] | ||
public async void Issue_92_refMailTo() | ||
{ | ||
_fileService.Files.Clear(); | ||
|
||
string expected = | ||
@"#Documentation Readme | ||
LINK [John Doe](mailto:[email protected])".NormalizeContent(); | ||
|
||
var folder = _fileService.AddFolder($"docs"); | ||
_fileService.AddFile(folder, "README.md", string.Empty | ||
|
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