public void SarifSnapshot_GetMessageEmbeddedLinkInlines_DontCreateLinks() { string message = @"The quick [brown fox](2) jumps over the lazy dog."; var expected = new List <Inline> { new Run("The quick "), new Run("brown fox"), new Run(" jumps over the lazy dog.") }; var actual = SdkUIUtilities.GetInlinesForErrorMessage(message); actual.Count.Should().Be(expected.Count); for (int i = 0; i < actual.Count; i++) { VerifyTextRun(expected[i], actual[i]); } }
public void GetInlinesForErrorMessage_DoesNotCreateLinks() { const string message = @"The quick [brown fox](2) jumps over the lazy dog."; var expected = new List <Inline> { new Run("The quick "), new Run("brown fox"), new Run(" jumps over the lazy dog."), }; List <Inline> actual = SdkUIUtilities.GetInlinesForErrorMessage(message); actual.Count.Should().Be(expected.Count); for (int i = 0; i < actual.Count; i++) { VerifyTextRun(expected[i], actual[i]); } }
public void GetInlinesForErrorMessage_IgnoresInvalidLink() { // That is, the fact that the link destination doesn't look like a URL // doesn't bother it. string message = @"The quick [brown fox](some text) jumps over the lazy dog."; var expected = new List <Inline> { new Run("The quick "), new Run("brown fox"), new Run(" jumps over the lazy dog.") }; var actual = SdkUIUtilities.GetInlinesForErrorMessage(message); actual.Count.Should().Be(expected.Count); for (int i = 0; i < actual.Count; i++) { VerifyTextRun(expected[i], actual[i]); } }