public void TryExtractSummary_NoXml_ReturnsTrue() { // Arrange var documentation = @" There is no xml, but I got you this < and the >. "; // Act var result = DefaultTagHelperTooltipFactory.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal("There is no xml, but I got you this < and the >.", summary); }
public void TryExtractSummary_XMLButNoSummary_ReturnsFalse() { // Arrange var documentation = @" <param type=""stuff"">param1</param> <return>Result</return> "; // Act var result = DefaultTagHelperTooltipFactory.TryExtractSummary(documentation, out var summary); // Assert Assert.False(result); Assert.Null(summary); }
public void TryExtractSummary_ExtractsSummary_ReturnsTrue() { // Arrange var expectedSummary = " Hello World "; var documentation = $@" Prefixed invalid content <summary>{expectedSummary}</summary> Suffixed invalid content"; // Act var result = DefaultTagHelperTooltipFactory.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal(expectedSummary, summary); }
public void TryExtractSummary_NoEndSummary_ReturnsTrue() { // Arrange var documentation = @" Prefixed invalid content <summary> Suffixed invalid content"; // Act var result = DefaultTagHelperTooltipFactory.TryExtractSummary(documentation, out var summary); // Assert Assert.True(result); Assert.Equal(@"Prefixed invalid content <summary> Suffixed invalid content", summary); }