public void Does_Parse_Single_Delimiter() { //Arrange var parser = new HeaderDelimiterParser(); var testString = $"//{DELIMITER1}{Environment.NewLine}1{DELIMITER1}2"; //Act var result = parser.Parse(testString); //Act Assert.AreEqual(1, result.Count); Assert.AreEqual(DELIMITER1, result[0]); }
public void Does_Return_Default_Delimiter_When_Invalid_Prefix() { //Arrange var parser = new HeaderDelimiterParser(); var testString = $"&&{DELIMITER1}{Environment.NewLine}1{DELIMITER1}2"; //Act var result = parser.Parse(testString); //Act Assert.AreEqual(1, result.Count); Assert.AreEqual(HeaderDelimiterParser.DEFAULT_DELIMITER, result[0]); }
public void Does_Parse_Multiple_Delimiters() { //Arrange var parser = new HeaderDelimiterParser(); var testString = $"//{DELIMITER1}{DELIMITER2}{DELIMITER3}{Environment.NewLine}1{DELIMITER1}2{DELIMITER2}7{DELIMITER1}"; //Act var result = parser.Parse(testString); //Act Assert.AreEqual(3, result.Count); Assert.AreEqual(DELIMITER1, result[0]); Assert.AreEqual(DELIMITER2, result[1]); Assert.AreEqual(DELIMITER3, result[2]); }