public override void Given() { _fileStream = null; FileName = null; BlobStorageService.DownloadFileAsync(Arg.Any <BlobStorageData>()).Returns(_fileStream); Loader = new DocumentLoader(Logger, BlobStorageService); }
public override void Given() { BlobStorageService.DownloadFileAsync(Arg.Is <BlobStorageData>(x => x.ContainerName == DocumentType.Documents.ToString() && x.BlobFileName == FileName && x.SourceFilePath == $"{BlobStorageConstants.TechSpecFolderName}/{FolderName}")) .Returns(new MemoryStream()); }
public async Task <IActionResult> DownloadFile(int id) { var jo = await _context.JobApplications .SingleOrDefaultAsync(m => m.Id == id); (Stream blobStream, string ContentType, var name) = await _blob.DownloadFileAsync(jo.CvUrl); return(File(blobStream, ContentType, name)); }
public override void Given() { BlobUniqueReference = Guid.NewGuid(); ApiResponse = new DocumentUploadHistoryDetails { AoUkprn = Ukprn, BlobFileName = BlobFileName, BlobUniqueReference = BlobUniqueReference, DocumentType = (int)DocumentType.Results, FileType = (int)FileType.Csv, Status = (int)DocumentUploadStatus.Processed, CreatedBy = $"{Givenname} {Surname}" }; InternalApiClient.GetDocumentUploadHistoryDetailsAsync(Ukprn, BlobUniqueReference).Returns(ApiResponse); BlobStorageService.DownloadFileAsync(Arg.Any <BlobStorageData>()).Returns(new MemoryStream(Encoding.ASCII.GetBytes("Test File"))); Loader = new ResultLoader(Mapper, Logger, InternalApiClient, BlobStorageService); }
public override void Given() { Stream stream = null; BlobStorageService.DownloadFileAsync(Arg.Any <BlobStorageData>()).Returns(stream); }