namespace GParseTests; public class SplitParserTests { [Fact] public void CanConstruct() { _ = new SplitParser("|"); } [Theory] [InlineData("", new string[] { "" })] [InlineData("1", new string[] { "1" })] [InlineData("1,2", new string[] { "1", "2" })] [InlineData(",", new string[] { "", "" })] [InlineData(",,", new string[] { "", "", "" })] [InlineData("1,", new string[] { "1", "" })] [InlineData(",1", new string[] { "", "1" })] public void VarietyTests(string inputText, IEnumerable expected) { const string delimiter = ","; var parser = new SplitParser(delimiter); IEnumerable actual = parser.Parse(inputText); actual.ShouldBe(expected); } }