public void StrongTagType_IsClosedTag_ReturnRightDefinesDoubleClosedTags(string text, int expectedCount) { var strong = new StrongTagType(); var underlineCount = text.Where((t, i) => strong.IsClosedTag(text, i)).Count(); underlineCount.Should().Be(expectedCount); }
public static TagType GetTagType(string text, int position) { var em = new EmTagType(); var strong = new StrongTagType(); if (em.IsOpenedTag(text, position) || em.IsClosedTag(text, position)) { return(em); } if (strong.IsOpenedTag(text, position) || strong.IsClosedTag(text, position)) { return(strong); } return(new DefaultTagType()); }
public void StrongTagType_IsClosedTag_ReturnRightResult(string text, int position, bool expected) { var strong = new StrongTagType(); strong.IsClosedTag(text, position).Should().Be(expected); }