public void CanExtractWithDifferentEndComments() { var isBeginSnippet = StartEndTester.IsBeginSnippet("/* begin-snippet: CodeKey */", "file", out var key); Assert.True(isBeginSnippet); Assert.Equal("codekey", key); }
public void CanExtractWithDashes() { var isBeginSnippet = StartEndTester.IsBeginSnippet("<!-- begin-snippet: Code-Key -->", "file", out var key); Assert.True(isBeginSnippet); Assert.Equal("code-key", key); }
public Task ShouldThrowForKeyEndingWithSymbol() { var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsBeginSnippet("<!-- begin-snippet: key_ -->", "file", out _)); return(Verify(exception.Message)); }
public void CanExtractWithNoTrailingCharacters() { var isBeginSnippet = StartEndTester.IsBeginSnippet("<!-- begin-snippet: CodeKey", "file", out var key); Assert.True(isBeginSnippet); Assert.Equal("codekey", key); }
public void CanExtractFromXmlWithExtraSpaces() { var isBeginSnippet = StartEndTester.IsBeginSnippet("<!-- begin-snippet: CodeKey -->", "file", out var key); Assert.True(isBeginSnippet); Assert.Equal("codekey", key); }
public void ShouldNotThrowForNoKeyWithNoSpace() { StartEndTester.IsBeginSnippet("<!--begin-snippet:-->", "file", out _); }
public Task ShouldThrowForKeyEndingWithSymbol() { return(Verifier.Throws(() => StartEndTester.IsBeginSnippet("<!-- begin-snippet: key_ -->", "file", out _))); }
public Task ShouldThrowForNoKey() { return(Verifier.Throws(() => StartEndTester.IsBeginSnippet("<!-- begin-snippet: -->", "file", out _))); }