Ejemplo n.º 1
0
 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"));
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 private void I_can_import_a_valid_file(string filePath, object maxHor, object maxSim)
 {
     _hash = CsvImporter.ReadFxArray(filePath, maxHor, maxSim);
     _hash.ShouldNotBeNull();
 }
Ejemplo n.º 4
0
 private void I_cannot_import_a_file_with_spurious_data()
 {
     Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty));
 }
Ejemplo n.º 5
0
 private void I_cannot_import_a_file_with_wrong_extension()
 {
     Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty)).Message.ShouldBe("Invalid extension");
 }
Ejemplo n.º 6
0
 private void I_cannot_import_a_non_existent_esg()
 {
     Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty)).Message.ShouldBe("Non-existent file");
 }