public Task ShouldThrowForKeyStartingWithSymbol() { var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsStartRegion("#region _key", "file", out _)); return(Verify(exception.Message)); }
public void ShouldThrowForKeyEndingWithSymbol() { var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsStartRegion("#region key_ ", out _, out _)); Assert.Equal("Key should not start or end with symbols. Key: key_", exception.Message); }
public void ShouldThrowForKeyEndingWithSymbol() { var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsStartRegion("#region key_ ", "file", out _)); Approvals.Verify(exception.Message); }
public Task ShouldIgnoreForNoKey() { var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsStartRegion("#region ", "file", out _)); return(Verify(exception.Message)); }
public void ShouldIgnoreForNoKey() { var exception = Assert.Throws <SnippetReadingException>(() => StartEndTester.IsStartRegion("#region ", "file", out _)); Assert.Equal("No Key could be derived. Line: '#region '.", exception.Message); }
public void ShouldIgnoreForNoKey() { string fake; var exception = Assert.Throws <Exception>(() => StartEndTester.IsStartRegion("#region ", out fake, out fake)); Assert.AreEqual("No Key could be derived. Line: '#region '.", exception.Message); }
public void ShouldThrowForKeyEndingWithSymbol() { string fake; var exception = Assert.Throws <Exception>(() => StartEndTester.IsStartRegion("#region key_ ", out fake, out fake)); Assert.AreEqual("Key should not start or end with symbols. Key: key_", exception.Message); }
public void CanExtractFromXmlWithExtraSpacesWithSuffix1() { string key; string suffix; StartEndTester.IsStartRegion("#region CodeKey v5 ", out key, out suffix); Assert.AreEqual("CodeKey", key); Assert.AreEqual("v5", suffix); }
public void CanExtractFromXml() { string key; string suffix; StartEndTester.IsStartRegion("#region CodeKey", out key, out suffix); Assert.AreEqual("CodeKey", key); Assert.IsNull(suffix); }
public void CanExtractWithDashesWithVersion() { string key; string suffix; StartEndTester.IsStartRegion("#region Code-Key 5", out key, out suffix); Assert.AreEqual("Code-Key", key); Assert.AreEqual("5", suffix); }
public void CanExtractWithUnderScores() { string key; string suffix; StartEndTester.IsStartRegion("#region Code_Key", out key, out suffix); Assert.AreEqual("Code_Key", key); Assert.IsNull(suffix); }
public void CanExtractWithNoTrailingCharacters() { string key; string suffix; StartEndTester.IsStartRegion("#region CodeKey", out key, out suffix); Assert.AreEqual("CodeKey", key); Assert.IsNull(suffix); }
public void CanExtractWithUnderScores() { StartEndTester.IsStartRegion("#region Code_Key", out var key); Assert.Equal("code_key", key); }
public void CanExtractFromXmlWithExtraSpaces() { StartEndTester.IsStartRegion("#region CodeKey ", out var key); Assert.Equal("codekey", key); }
public void ShouldIgnoreForNoKey() { Assert.False(StartEndTester.IsStartRegion("#region ", out _)); }
public void ShouldThrowForKeyEndingWithSymbol() { Assert.False(StartEndTester.IsStartRegion("#region key_ ", out _)); }
public void WithSpaces() { Assert.False(StartEndTester.IsStartRegion("#region the text", out _)); }
public void CanExtractWithUnderScoresWithVersion() { StartEndTester.IsStartRegion("#region Code_Key 5", out var key, out var suffix); Assert.Equal("Code_Key", key); Assert.Equal("5", suffix); }
public void CanExtractWithDashes() { StartEndTester.IsStartRegion("#region Code-Key", "file", out var key); Assert.Equal("Code-Key", key); }
public void CanExtractWithNoTrailingCharacters() { StartEndTester.IsStartRegion("#region CodeKey", "file", out var key); Assert.Equal("CodeKey", key); }
public void CanExtractFromXmlWithVersion() { StartEndTester.IsStartRegion("#region CodeKey 5", out var key, out var suffix); Assert.Equal("CodeKey", key); Assert.Equal("5", suffix); }
public void CanExtractFromXml() { StartEndTester.IsStartRegion("#region CodeKey", "file", out var key); Assert.Equal("CodeKey", key); }
public void CanExtractFromXmlWithExtraSpacesWithSuffix1() { StartEndTester.IsStartRegion("#region CodeKey v5 ", out var key, out var suffix); Assert.Equal("CodeKey", key); Assert.Equal("v5", suffix); }