public async Task <FileContentResult> GetReporte(
            [FromQuery] string busqueda
            )
        {
            var reporte = await service.GetReporteCandidatos(busqueda);

            return(FileContentResultHelper.CreateFileContentResult(
                       reporte.Contenido,
                       reporte.NombreConExtension
                       ));
        }
        public async Task <FileContentResult> GetCurriculum(
            int id
            )
        {
            var curriculum = await service.GetCurriculum(id);

            return(FileContentResultHelper.CreateFileContentResult(
                       curriculum.Curriculum,
                       curriculum.CurriculumFileName
                       ));
        }
        public async Task <FileContentResult> GetReporte(
            string busqueda,
            RolCandidato?puestoSolicitado
            )
        {
            var reporte = await service.GetReporteSolicitudes(
                busqueda,
                puestoSolicitado
                );

            return(FileContentResultHelper.CreateFileContentResult(
                       reporte.Contenido,
                       reporte.NombreConExtension
                       ));
        }
        public void WriteFileCopiesBufferToOutputStream() {
            // Arrange
            byte[] buffer = new byte[] { 1, 2, 3, 4, 5 };

            Mock<Stream> mockOutputStream = new Mock<Stream>();
            mockOutputStream.Setup(s => s.Write(buffer, 0, buffer.Length)).Verifiable();
            Mock<HttpResponseBase> mockResponse = new Mock<HttpResponseBase>();
            mockResponse.Setup(r => r.OutputStream).Returns(mockOutputStream.Object);

            FileContentResultHelper helper = new FileContentResultHelper(buffer, "application/octet-stream");

            // Act
            helper.PublicWriteFile(mockResponse.Object);

            // Assert
            mockOutputStream.Verify();
            mockResponse.Verify();
        }
        public void WriteFileCopiesBufferToOutputStream()
        {
            // Arrange
            byte[] buffer = new byte[] { 1, 2, 3, 4, 5 };

            Mock <Stream> mockOutputStream = new Mock <Stream>();

            mockOutputStream.Setup(s => s.Write(buffer, 0, buffer.Length)).Verifiable();
            Mock <HttpResponseBase> mockResponse = new Mock <HttpResponseBase>();

            mockResponse.Setup(r => r.OutputStream).Returns(mockOutputStream.Object);

            FileContentResultHelper helper = new FileContentResultHelper(buffer, "application/octet-stream");

            // Act
            helper.PublicWriteFile(mockResponse.Object);

            // Assert
            mockOutputStream.Verify();
            mockResponse.Verify();
        }