Exemplo n.º 1
0
        public async Task UploadFileTest()
        {
            var ct = new CancellationTokenSource();

            ct.CancelAfter(TimeSpan.FromSeconds(10));
            await FileManager.CopyAndUpload(_sliFiles[0], "SLI-2");

            var nf = MatchDir(Path.GetFileName(_sliFiles[0]), "kji");

            Assert.IsTrue(await WebDavClientApi.IsExists(nf, ct.Token));
            Assert.IsTrue(await WebDavClientApi.RemoveFile(nf, ct.Token));
            Assert.IsFalse(await WebDavClientApi.IsExists(nf, ct.Token));
        }
Exemplo n.º 2
0
        public async Task UploadFilesTest()
        {
            foreach (var f in _lli1Files)
            {
                var ct = new CancellationTokenSource();
                await FileManager.CopyAndUpload(f, "LLI-1");

                var nf = MatchDir(Path.GetFileName(f), "dji-1");
                ct.CancelAfter(TimeSpan.FromSeconds(10));
                Assert.IsTrue(await WebDavClientApi.IsExists(nf, ct.Token));
                Assert.IsTrue(await WebDavClientApi.RemoveFile(nf, ct.Token));
                Assert.IsFalse(await WebDavClientApi.IsExists(nf, ct.Token));
            }
        }