public static object ImportFxArrayCsvAsync( [ExcelArgument(Description = "The csv path", Name = "CSV path")] string fullPath, [ExcelArgument(Description = "[OPTIONAL] The maximum horizon to read", Name = "MaxHorizon")] object horizon, [ExcelArgument(Description = "[OPTIONAL] The maximum sim to read", Name = "MaxSim")] object sim) { horizon = horizon is ExcelMissing ? string.Empty : horizon; sim = sim is ExcelMissing ? string.Empty : sim; return(RunAsync(() => CsvImporter.ReadFxArray(fullPath, horizon, sim), "Lloyds.Async.Importer.LoadFxArrayFromCsv")); }
private void I_cannot_import_a_file_when_passing_invalid_parameters(string filePath, object maxHor, object maxSim, Type exceptionType) { Should.Throw(() => CsvImporter.ReadFxArray(filePath, maxHor, maxSim), exceptionType); }
private void I_can_import_a_valid_file(string filePath, object maxHor, object maxSim) { _hash = CsvImporter.ReadFxArray(filePath, maxHor, maxSim); _hash.ShouldNotBeNull(); }
private void I_cannot_import_a_file_with_spurious_data() { Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty)); }
private void I_cannot_import_a_file_with_wrong_extension() { Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty)).Message.ShouldBe("Invalid extension"); }
private void I_cannot_import_a_non_existent_esg() { Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty)).Message.ShouldBe("Non-existent file"); }