Esempio n. 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);
 }
Esempio n. 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);
        }
        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);
        }
Esempio n. 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));
        }