refactor: renaming ParseMarkdownHeadingOne to ExtractMarkdownHeadingOne
This commit is contained in:
parent
31d545321f
commit
b3ea80c937
|
@ -8,16 +8,16 @@ using MfGames.Nitride.Generators;
|
|||
namespace MfGames.Nitride.Markdown;
|
||||
|
||||
/// <summary>
|
||||
/// An operation that parses the Markdown and converts the first heading one
|
||||
/// An operation that parses the Markdown and pulls the first heading one
|
||||
/// into a model to include in the component. The rest of the Markdown is put
|
||||
/// back as the text content of the entity.
|
||||
/// </summary>
|
||||
[WithProperties]
|
||||
public partial class ParseMarkdownHeadingOne : IOperation
|
||||
public partial class ExtractMarkdownHeadingOne : IOperation
|
||||
{
|
||||
private readonly IValidator<ParseMarkdownHeadingOne> validator;
|
||||
private readonly IValidator<ExtractMarkdownHeadingOne> validator;
|
||||
|
||||
public ParseMarkdownHeadingOne(IValidator<ParseMarkdownHeadingOne> validator)
|
||||
public ExtractMarkdownHeadingOne(IValidator<ExtractMarkdownHeadingOne> validator)
|
||||
{
|
||||
this.validator = validator;
|
||||
}
|
|
@ -2,9 +2,9 @@ using FluentValidation;
|
|||
|
||||
namespace MfGames.Nitride.Markdown.Validators;
|
||||
|
||||
public class ParseMarkdownHeadingOneValidator : AbstractValidator<ParseMarkdownHeadingOne>
|
||||
public class ExtractMarkdownHeadingOneValidator : AbstractValidator<ExtractMarkdownHeadingOne>
|
||||
{
|
||||
public ParseMarkdownHeadingOneValidator()
|
||||
public ExtractMarkdownHeadingOneValidator()
|
||||
{
|
||||
this.RuleFor(x => x.AddModelCallback).NotNull();
|
||||
}
|
|
@ -11,9 +11,9 @@ namespace MfGames.Nitride.Markdown.Tests;
|
|||
/// <summary>
|
||||
/// Tests the functionality of the ParseMarkdownHeadingOne operation.
|
||||
/// </summary>
|
||||
public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
||||
public class ExtractMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
||||
{
|
||||
public ParseMarkdownHeadingOneTests(ITestOutputHelper output)
|
||||
public ExtractMarkdownHeadingOneTests(ITestOutputHelper output)
|
||||
: base(output) { }
|
||||
|
||||
[Fact]
|
||||
|
@ -29,8 +29,8 @@ public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
|||
.SetTextContent("# Heading [One](/test)\n\nContent\nsecond\n\nline"),
|
||||
};
|
||||
|
||||
ParseMarkdownHeadingOne op = context
|
||||
.Resolve<ParseMarkdownHeadingOne>()
|
||||
ExtractMarkdownHeadingOne op = context
|
||||
.Resolve<ExtractMarkdownHeadingOne>()
|
||||
.WithAddModelCallback((entity, heading) => entity.Set(heading));
|
||||
|
||||
IEnumerable<Entity> output = op.Run(input);
|
||||
|
@ -49,8 +49,8 @@ public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
|||
List<Entity> input =
|
||||
new() { new Entity().Set(IsMarkdown.Instance).SetTextContent("#\nContent"), };
|
||||
|
||||
ParseMarkdownHeadingOne op = context
|
||||
.Resolve<ParseMarkdownHeadingOne>()
|
||||
ExtractMarkdownHeadingOne op = context
|
||||
.Resolve<ExtractMarkdownHeadingOne>()
|
||||
.WithAddModelCallback((entity, heading) => entity.Set(heading));
|
||||
|
||||
IEnumerable<Entity> output = op.Run(input);
|
||||
|
@ -72,8 +72,8 @@ public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
|||
new Entity().Set(IsMarkdown.Instance).SetTextContent("## Heading Two\nContent"),
|
||||
};
|
||||
|
||||
ParseMarkdownHeadingOne op = context
|
||||
.Resolve<ParseMarkdownHeadingOne>()
|
||||
ExtractMarkdownHeadingOne op = context
|
||||
.Resolve<ExtractMarkdownHeadingOne>()
|
||||
.WithAddModelCallback((entity, heading) => entity.Set(heading));
|
||||
|
||||
IEnumerable<Entity> output = op.Run(input);
|
||||
|
@ -97,8 +97,8 @@ public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
|||
.SetTextContent("# Heading One\n\n# Heading Two\n Content"),
|
||||
};
|
||||
|
||||
ParseMarkdownHeadingOne op = context
|
||||
.Resolve<ParseMarkdownHeadingOne>()
|
||||
ExtractMarkdownHeadingOne op = context
|
||||
.Resolve<ExtractMarkdownHeadingOne>()
|
||||
.WithAddModelCallback((entity, heading) => entity.Set(heading));
|
||||
|
||||
IEnumerable<Entity> output = op.Run(input);
|
||||
|
@ -117,8 +117,8 @@ public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
|||
List<Entity> input =
|
||||
new() { new Entity().Set(IsMarkdown.Instance).SetTextContent("Content"), };
|
||||
|
||||
ParseMarkdownHeadingOne op = context
|
||||
.Resolve<ParseMarkdownHeadingOne>()
|
||||
ExtractMarkdownHeadingOne op = context
|
||||
.Resolve<ExtractMarkdownHeadingOne>()
|
||||
.WithAddModelCallback((entity, heading) => entity.Set(heading));
|
||||
|
||||
IEnumerable<Entity> output = op.Run(input);
|
||||
|
@ -140,8 +140,8 @@ public class ParseMarkdownHeadingOneTests : TestBase<MarkdownTestContext>
|
|||
new Entity().Set(IsMarkdown.Instance).SetTextContent("# Heading One\n\nContent"),
|
||||
};
|
||||
|
||||
ParseMarkdownHeadingOne op = context
|
||||
.Resolve<ParseMarkdownHeadingOne>()
|
||||
ExtractMarkdownHeadingOne op = context
|
||||
.Resolve<ExtractMarkdownHeadingOne>()
|
||||
.WithAddModelCallback((entity, heading) => entity.Set(heading));
|
||||
|
||||
IEnumerable<Entity> output = op.Run(input);
|
Loading…
Reference in a new issue