public static void Main()
var tests = new string[] {
"5675, 73, Pizzabakeren, 632815"
var expected = new string[] {
foreach(var test in tests){
Console.WriteLine($"Test nr {testcount}");
Console.WriteLine($"Test successful: {Test(test, fallback) == expected[testcount - 1]}");
Console.WriteLine(string.Empty);
private static string Test(string ld, string fallback)
Console.WriteLine($"Testing {ld}");
if (string.IsNullOrEmpty(ld))
string [] lineDescriptionSplit = ld.Split(',', 2);
return lineDescriptionSplit[0] ?? fallback;