public Program(string configName, string dir, string operation, string status = "") { Config config = GetConfig(configName); string[] fileEntries = Directory.GetFiles(dir); var api = new AbouRestApi(config); foreach (var fileName in fileEntries) { string uniqueId = GetUniqueIdFromGileName(fileName); switch (operation) { case "upload": api.FileUpload(uniqueId, fileName, status + Path.GetExtension(fileName)); break; case "setstatus": api.UpdateStatus(uniqueId, status); break; default: Console.WriteLine($"Operation {operation} not supported"); break; } } }
public void FileUploadPdf() { var config = Global.GetConfig; var api = new AbouRestApi(config); api.FileUpload(new FileUploadData(config) { UniqueId = "190227-BSF_10-GC95" }, ".\\Testdata\\AbouTestDoc.pdf", "Namn som syns.pdf"); }
public void FileUploadEpub() { var config = Global.GetConfig; var api = new AbouRestApi(config); Assert.Throws <AbouApiException>(() => api.FileUpload(new FileUploadData(config) { UniqueId = "190227-BSF_10-GC95" }, ".\\Testdata\\AbouTestDocEpub.epub", "Funkar inte.epub")); }
public void FileUploadPngf() { var config = Global.GetConfig; var api = new AbouRestApi(config); api.FileUpload(new FileUploadData(config) { UniqueId = "190227-BSF_10-GC95" }, ".\\Testdata\\Sokigo_logo.png", "Sokigo_logo.png"); }