public void ParseSingleLine_純英文_文字長度不拘都能解析(string source) { int[] columnLengths = { 3, 5 }; int expectedColumns = columnLengths.Length; var result = FixLengthParser.ParseSingleLine(source, columnLengths); result.Should().HaveCount(c => c == expectedColumns); }
public void ParseSingleLine_空字串_傳回空集合(string source) { int[] columnLengths = { 7, 3 }; var result = FixLengthParser.ParseSingleLine(source, columnLengths); foreach (var item in result) { item.Should().BeNull(); } }
public void ParseSingleLine_中英文混合_驗證可解析成2欄() { string source = "王abc123"; int[] columnLengths = { 6, 4 }; var result = FixLengthParser.ParseSingleLine(source, columnLengths); result[0].Should().Be("王abc1"); result[1].Should().Be("23"); }
public void ParseSingleLine_純中文_驗證可解析成2欄() { string source = "王小明李小華"; int[] columnLengths = { 6, 4 }; var result = FixLengthParser.ParseSingleLine(source, columnLengths); result[0].Should().Be("王小明"); result[1].Should().Be("李小"); }
public void ParseSingleLine_純英文_驗證可解析成2欄() { string source = "abcd"; int[] columnLengths = { 3, 5 }; var result = FixLengthParser.ParseSingleLine(source, columnLengths); result[0].Should().Be("abc"); result[1].Should().Be("d"); }