public void HandlesSingleValue(string input, string a) { var parser = new StringLineParser("|", "<", ">"); var results = parser.Split(input); Assert.Collection(results, v => Assert.Equal(a, v)); }
public void HandlesEmptyString() { var parser = new StringLineParser("|", "<", ">"); var results = parser.Split(""); Assert.Collection(results, v => Assert.Equal("", v)); }
public void HandlesNull() { var parser = new StringLineParser("|", "<", ">"); var results = parser.Split(null); Assert.Empty(results); }
public void HandlesThreeValues() { var parser = new StringLineParser("|", "<", ">"); var results = parser.Split("abc|123|ghi"); Assert.Collection(results, v => Assert.Equal("abc", v), v => Assert.Equal("123", v), v => Assert.Equal("ghi", v)); }
public void HandlesTwoDelimiters() { var parser = new StringLineParser("|", "<", ">"); var results = parser.Split("||"); Assert.Collection(results, v => Assert.Equal("", v), v => Assert.Equal("", v), v => Assert.Equal("", v)); }
public void HandlesBadQuotedData(string input) { var parser = new StringLineParser("|", "<", ">"); Assert.Throws <InvalidDataException>(() => parser.Split(input)); }