public void GivenAnHtmlFormatter_WhenFormattingAnAction_ThenFormatIsRespected() { var action = new Action() { name = "Touch", desc = "Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d6) fire damage. If the target is a creature or a flammable object, it ignites. " + "Until a creature takes an action to douse the fire, the creature takes 3 (1d6) fire damage at the end of each of its turns." }; var expected = $"<p class=\"RWDefault\"><span class=\"RWSnippet\"><b><i>{action.name}.</i></b> <i>Melee Weapon Attack:</i> +4 to hit, reach 5 ft., one target. <i>Hit:</i> 7 (2d6) fire damage. If the target is a creature or a flammable object, it ignites. " + "Until a creature takes an action to douse the fire, the creature takes 3 (1d6) fire damage at the end of each of its turns.</span></p>"; var actual = HtmlFormatter.Format(action); actual.Should().Be(expected); }
public static string Format(Action action) { var description = ApplyAllActionFormatting(action.desc); return(WrapInAParagraph($"<b><i>{action.name}.</i></b> {description}")); }