public record Cashflow(Currency Currency, decimal Amount, DateOnly ValueDate)
public static Cashflow[] Parse(string x)
throw new Exception("TO DO");
private const string sample = @"Currency,Cashflow,Date
GBP,-1321.23,2023-10-23";
public static void Main()
new Cashflow(Currency.USD, 124.35m, new DateOnly(2023, 9, 25)),
new Cashflow(Currency.EUR, 179.53m, new DateOnly(2023, 10, 23)),
new Cashflow(Currency.GBP, -1321.23m, new DateOnly(2023, 10, 23))
var actual = Cashflow.Parse(sample);
if (actual.Length != expected.Length)
throw new Exception("Length differ!");
foreach (var (expectedEntry, actualEntry) in expected.Zip(actual))
if (actualEntry != expectedEntry)
throw new Exception($"Parsed entry #{entryIndex} differs from the expected one");
Console.WriteLine("All ok!");