示例#1
0
 public async Task TestGenericHeaderless ()
 {
     var settings = InfluxerConfigSection.Load (Path.Combine (TestFilesPath, "HeaderlessText.conf"));
     settings.InputFileName = Path.Combine (TestFilesPath, "HeaderlessText.txt");
     var client = await GetClientAsync (settings);
     var file = new GenericFile ();
     var result = await file.ProcessGenericFile (settings.InputFileName, client);
     //Debug.WriteLine (result.ToString ());
     Assert.IsTrue (result.ExitCode == ExitCode.ProcessedWithErrors && result.PointsFound == 1001 && result.PointsFailed == 29, "Processing a generic text file failed");
 }
示例#2
0
 public async Task TestGenericSimple ()
 {
     var settings = InfluxerConfigSection.LoadDefault ();
     settings.FileFormat = FileFormats.Generic;
     settings.InputFileName = Path.Combine (TestFilesPath, "Simple.csv");
     settings.InfluxDB.RetentionPolicy = "autogen";
     settings.GenericFile.TimeFormat = "yyyy-MM-dd m:ss";
     var client = await GetClientAsync (settings);
     var file = new GenericFile ();
     var result = await file.ProcessGenericFile (settings.InputFileName, client);
     //Debug.WriteLine (result.ToString ());
     Assert.IsTrue (result.ExitCode == ExitCode.ProcessedWithErrors && result.PointsFound == 4897 && result.PointsFailed == 1, "Processing a generic CSV file failed");
 }