示例#1
0
        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;
                }
            }
        }
示例#2
0
        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");
        }
示例#3
0
        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"));
        }
示例#4
0
        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");
        }