public void WhenIUploadTheFile(UploadFileDto uploadFile) { var filePath = ContextHelper.GetFromContext <string>("FilePath"); var file = File.ReadAllBytes(filePath); var response = new DropboxApiContent().UploadFile(uploadFile, file); response.EnsureSuccessful(); ContextHelper.AddToContext("LastApiResponse", response); }
public static void UploadFile(string fileName) { var filePath = GetFilePath(fileName); File.Exists(filePath) .Should() .BeTrue($"expected {fileName} to exists with test fata files inside the {filePath}"); var uploadFile = new UploadFileDto(); uploadFile.Mode = "add"; uploadFile.AutoRename = true; uploadFile.Mute = false; uploadFile.Path = fileName; var file = File.ReadAllBytes(filePath); var response = new DropboxApiContent().UploadFile(uploadFile, file); response.EnsureSuccessful(); }