public void TestParseTemplateString(string s, IEnumerable <ITemplateFragment> expected) { // act var result = TemplateStringParser.ParseFragments(s); // assert Assert.Collection(result, expected.Select(x => new Action <ITemplateFragment>(y => { Assert.Equal(x.GetType(), y.GetType()); Assert.Equal(x.Value, y.Value); })).ToArray()); }
public static TemplateString Parse(string s) { var fragments = TemplateStringParser.ParseFragments(s); return(new TemplateString(fragments)); }