Пример #1
0
        public void Can_Upload_File_Async()
        {
            var localFile    = new FileInfo(_fixture.CreateAnonymous <string>());
            var localContent = _fixture.CreateAnonymous <string>();

            File.WriteAllText(localFile.FullName, localContent, System.Text.Encoding.UTF8);
            Assert.IsTrue(File.Exists(localFile.FullName));
            byte[] content = _client.GetFileContentFromFS(localFile);

            _client.UploadFileAsync("/Test", localFile.Name, content, Can_Upload_File_Async_Success, Can_Upload_File_Async_Failure);
        }
Пример #2
0
        public void Can_Upload_File_PUT()
        {
            var localFile    = new FileInfo(fixture.CreateAnonymous <string>() + ".txt");
            var localContent = fixture.CreateAnonymous <string>();

            File.WriteAllText(localFile.FullName, localContent, System.Text.Encoding.UTF8);
            Assert.IsTrue(File.Exists(localFile.FullName));
            byte[] content = _client.GetFileContentFromFS(localFile);

            var uploaded = _client.UploadFilePUT("/", localFile.Name, content);

            Assert.IsNotNull(uploaded);
            File.Delete(localFile.FullName);
        }
Пример #3
0
        public void Can_Upload_File()
        {
            _client.Login(TestVariables.Email, TestVariables.Password);

            var localFile    = new FileInfo(fixture.CreateAnonymous <string>());
            var localContent = fixture.CreateAnonymous <string>();

            File.WriteAllText(localFile.FullName, localContent, System.Text.Encoding.UTF8);
            Assert.IsTrue(File.Exists(localFile.FullName));
            byte[] content = _client.GetFileContentFromFS(localFile);

            var uploaded = _client.UploadFile("/", localFile.Name, content);

            Assert.IsTrue(uploaded);
            File.Delete(localFile.FullName);
        }