Ejemplo n.º 1
0
        public void CreatePresignedUrl_should_call_S3_GetPresignedURL()
        {
            var request = new PresignedUrlRequest
            {
                ContentType = "application/pdf",
                FileName    = "TestFile.pdf",
                FolderName  = "Folder1",
                PartNumbers = new List <int> {
                    1, 3, 2, 4, 5
                },
                UploadId = "42"
            };

            _uploadService.CreatePresignedUrl(request, _context);

            _s3.Received(5).GetPreSignedURL(Arg.Is <GetPreSignedUrlRequest>(p =>
                                                                            p.ContentType == "application/pdf" &&
                                                                            p.Key == $"{request.FolderName}/{request.FileName}" &&
                                                                            p.UploadId == request.UploadId
                                                                            ));
        }