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); }
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); }
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)); }