public void CanExtractFromXmlWithExtraSpacesWithVersion()
    {
        string key;
        string suffix;
        var    isStartCode = StartEndTester.IsStartCode("<!--  startcode  CodeKey  v5  -->", out key, out suffix);

        Assert.IsTrue(isStartCode);
        Assert.AreEqual("CodeKey", key);
        Assert.AreEqual("v5", suffix);
    }
    public void CanExtractWithNoTrailingCharacters()
    {
        string key;
        string suffix;
        var    isStartCode = StartEndTester.IsStartCode("<!-- startcode CodeKey", out key, out suffix);

        Assert.IsTrue(isStartCode);
        Assert.AreEqual("CodeKey", key);
        Assert.IsNull(suffix);
    }
    public void CanExtractFromXmlWithMissingSpaces()
    {
        string key;
        string suffix;
        var    isStartCode = StartEndTester.IsStartCode("<!--startcode CodeKey-->", out key, out suffix);

        Assert.IsTrue(isStartCode);
        Assert.AreEqual("CodeKey", key);
        Assert.IsNull(suffix);
    }
    public void CanExtractWithDifferentEndCommentsAndNoSpaces()
    {
        string key;
        string suffix;
        var    isStartCode = StartEndTester.IsStartCode("/*startcode CodeKey 5*/", out key, out suffix);

        Assert.IsTrue(isStartCode);
        Assert.AreEqual("CodeKey", key);
        Assert.AreEqual("5", suffix);
    }
    public void CanExtractWithDashesWithVersion()
    {
        string key;
        string suffix;
        var    isStartCode = StartEndTester.IsStartCode("<!-- startcode Code-Key 5 -->", out key, out suffix);

        Assert.IsTrue(isStartCode);
        Assert.AreEqual("Code-Key", key);
        Assert.AreEqual("5", suffix);
    }
    public void CanExtractWithUnderScores()
    {
        string key;
        string suffix;
        var    isStartCode = StartEndTester.IsStartCode("<!-- startcode Code_Key -->", out key, out suffix);

        Assert.IsTrue(isStartCode);
        Assert.AreEqual("Code_Key", key);
        Assert.IsNull(suffix);
    }
 public void ShouldNotThrowForNoKeyWithNoSpace()
 {
     StartEndTester.IsStartCode("<!--startcode-->", "file", out _);
 }
    public void ShouldThrowForNoKey()
    {
        var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsStartCode("<!-- startcode -->", "file", out _));

        Assert.Equal("No Key could be derived. Line: '<!-- startcode -->'.", exception.Message);
    }
    public void ShouldNotThrowForNoKeyWithNoSpace()
    {
        string fake;

        StartEndTester.IsStartCode("<!--startcode-->", out fake, out fake);
    }