public async Task OrderedFiles()
        {
            var filesRequest = new FilesRequest
            {
                Directory    = testFilesDirectory,
                OrderFilesBy = FileProperty.Name
            };

            var result = await client.PostAsync("directory/files", TestExtensions.SerializeRequest(filesRequest));

            var files = await TestExtensions.DeserializeResult <List <string> >(result);

            // check correct files number is returned
            files.Count.Should().Be(6);

            // check files ordered by name correctly
            new FileInfo(files.First()).Name.Should().Be("file1.cs");

            foreach (var file in files)
            {
                File.Exists(file).Should().BeTrue();

                testOutputHelper.WriteLine(file);
            }
        }
Exemplo n.º 2
0
        public FilesFinalizeMppResponse SendInfoAboutFiles(LinkFinalizeResponce model, int index)
        {
            var file = $"/api/v4/transfers/{model.Id}/files";

            var request = new FilesRequest(model.Files[index].Name, model.Files[index].Size);

            return(JsonConvert.DeserializeObject <FilesFinalizeMppResponse>(GetResponse(Method.POST, request, file, CookiesDo.Add | CookiesDo.Clear).Content));
        }