Пример #1
0
 public IHttpActionResult Download(string configName)
 {
     var cmd = new ZipPackageForExport(inputConfigProvider, scriptProvider, appConfigProvider, configName);
     cmd.Execute();
     var stream = (MemoryStream) cmd.Result;
     return new FileResult(stream, Request);
 }
Пример #2
0
        public void DoesNotZipWithNonExistingConfig()
        {
            cmd = new ZipPackageForExport(inputConfigProvider, scriptProvider, appConfigProvider, zipper, nonExistingConfigName);
            cmd.Execute();

            inputConfigProviderMock.Verify(v => v.FindConfigForName(It.Is <string>(s => s.Equals(nonExistingConfigName))), Times.Once);
            zipperMock.Verify(v => v.Zip(It.IsAny <InputConfiguration>()), Times.Never);
        }
Пример #3
0
        public void ZipsWithExistingConfig()
        {
            cmd = new ZipPackageForExport(inputConfigProvider, scriptProvider, appConfigProvider, zipper, existingConfigName);
            cmd.Execute();

            inputConfigProviderMock.Verify(v => v.FindConfigForName(It.Is<string>(s => s.Equals(existingConfigName))), Times.Once);
            zipperMock.Verify(v => v.Zip(It.IsAny<InputConfiguration>()), Times.Once);
        }
Пример #4
0
        public IHttpActionResult Download(string configName)
        {
            var cmd = new ZipPackageForExport(inputConfigProvider, scriptProvider, appConfigProvider, configName);

            cmd.Execute();
            var stream = (MemoryStream)cmd.Result;

            return(new FileResult(stream, Request));
        }