Пример #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"));
 }
Пример #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);
 }
Пример #3
0
 private void I_can_import_a_valid_file(string filePath, object maxHor, object maxSim)
 {
     _hash = CsvImporter.ReadFxArray(filePath, maxHor, maxSim);
     _hash.ShouldNotBeNull();
 }
Пример #4
0
 private void I_cannot_import_a_file_with_spurious_data()
 {
     Should.Throw <ArgumentException>(() => CsvImporter.ReadFxArray(_relativePath, string.Empty, string.Empty));
 }
Пример #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");
 }
Пример #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");
 }