|
5 | 5 | using Bogus;
|
6 | 6 | using DocAssembler.Actions;
|
7 | 7 | using DocAssembler.Configuration;
|
| 8 | +using DocAssembler.FileService; |
8 | 9 | using DocAssembler.Test.Helpers;
|
9 | 10 | using FluentAssertions;
|
10 | 11 | using Microsoft.Extensions.Logging;
|
@@ -38,7 +39,47 @@ public async void Issue_89_refHeaderInSameFile()
|
38 | 39 | string expected =
|
39 | 40 | @"#Documentation Readme
|
40 | 41 |
|
41 |
| -LINK [title](#documentation-readme)"; |
| 42 | +LINK [title](#documentation-readme)".NormalizeContent(); |
| 43 | + |
| 44 | + var folder = _fileService.AddFolder($"docs"); |
| 45 | + _fileService.AddFile(folder, "README.md", string.Empty |
| 46 | + .AddRaw(expected)); |
| 47 | + |
| 48 | + // arrange |
| 49 | + AssembleConfiguration config = new AssembleConfiguration |
| 50 | + { |
| 51 | + DestinationFolder = "out", |
| 52 | + Content = |
| 53 | + [ |
| 54 | + new Content |
| 55 | + { |
| 56 | + SourceFolder = "docs", |
| 57 | + DestinationFolder = "general", |
| 58 | + Files = { "**" }, |
| 59 | + } |
| 60 | + ] |
| 61 | + }; |
| 62 | + |
| 63 | + InventoryAction action = new(_workingFolder, config, _fileService, _logger); |
| 64 | + |
| 65 | + // act |
| 66 | + var ret = await action.RunAsync(); |
| 67 | + |
| 68 | + // assert |
| 69 | + ret.Should().Be(ReturnCode.Normal); |
| 70 | + var content = _fileService.ReadAllText(_fileService.Files.Last().Key); |
| 71 | + content.Should().Be(expected); |
| 72 | + } |
| 73 | + |
| 74 | + [Fact] |
| 75 | + public async void Issue_92_refMailTo() |
| 76 | + { |
| 77 | + _fileService.Files.Clear(); |
| 78 | + |
| 79 | + string expected = |
| 80 | +@"#Documentation Readme |
| 81 | +
|
| 82 | +LINK [John Doe](mailto:[email protected])".NormalizeContent(); |
42 | 83 |
|
43 | 84 | var folder = _fileService.AddFolder($"docs");
|
44 | 85 | _fileService.AddFile(folder, "README.md", string.Empty
|
|
0 commit comments