public NSwagStudioCodeGeneratorFactory( IGeneralOptions generalOptions, IProcessLauncher processLauncher, IDependencyInstaller dependencyInstaller) { this.generalOptions = generalOptions ?? throw new ArgumentNullException(nameof(generalOptions)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); }
public void Constructor_Requires_ProcessLauncher(IDependencyInstaller installer) => new Action( () => new SwaggerCSharpCodeGenerator( "", "", null, null, installer)) .Should() .ThrowExactly <ArgumentNullException>();
public SwaggerSingleFileCustomTool( IGeneralOptions options, IProcessLauncher processLauncher, ISwaggerCodegenFactory factory, IDependencyInstaller dependencyInstaller) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); }
public ICodeGenerator Create( string swaggerFile, string defaultNamespace, IGeneralOptions options, IProcessLauncher processLauncher, IDependencyInstaller dependencyInstaller) => new SwaggerCSharpCodeGenerator( swaggerFile, defaultNamespace, options, processLauncher, dependencyInstaller);
public SwaggerCodegenCommand( IConsoleOutput console, IProgressReporter progressReporter, IGeneralOptions options, IProcessLauncher processLauncher, ISwaggerCodegenFactory factory, IDependencyInstaller dependencyInstaller) : base(console, progressReporter) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); }
public AutoRestSingleFileCustomTool( IAutoRestCodeGeneratorFactory factory, IAutoRestOptions options, IProcessLauncher processLauncher, IOpenApiDocumentFactory documentFactory, IDependencyInstaller dependencyInstaller) { this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.options = options ?? throw new ArgumentNullException(nameof(options)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.documentFactory = documentFactory ?? throw new ArgumentNullException(nameof(documentFactory)); this.dependencyInstaller = dependencyInstaller; }
public NSwagStudioCodeGenerator( string nswagStudioFile, IGeneralOptions options, IProcessLauncher processLauncher, IDependencyInstaller dependencyInstaller, bool forceDownload = false) { this.nswagStudioFile = nswagStudioFile ?? throw new ArgumentNullException(nameof(nswagStudioFile)); this.options = options ?? throw new ArgumentNullException(nameof(options)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); this.forceDownload = forceDownload; }
public void Constructor_Requires_Options( IProcessLauncher launcher, IDependencyInstaller installer, IOpenApiGeneratorOptions openApiGeneratorOptions) => new Action( () => new OpenApiCSharpCodeGenerator( "", "", null, openApiGeneratorOptions, launcher, installer)) .Should() .ThrowExactly <ArgumentNullException>();
public ICodeGenerator Create( string swaggerFile, string defaultNamespace, IAutoRestOptions options, IProcessLauncher processLauncher, IOpenApiDocumentFactory factory, IDependencyInstaller dependencyInstaller) => new AutoRestCSharpCodeGenerator( swaggerFile, defaultNamespace, options, processLauncher, factory, dependencyInstaller);
public SwaggerCSharpCodeGenerator( string swaggerFile, string defaultNamespace, IGeneralOptions options, IProcessLauncher processLauncher, IDependencyInstaller dependencyInstaller) { this.swaggerFile = swaggerFile ?? throw new ArgumentNullException(nameof(swaggerFile)); this.defaultNamespace = defaultNamespace ?? throw new ArgumentNullException(nameof(defaultNamespace)); this.options = options ?? throw new ArgumentNullException(nameof(options)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); javaPathProvider = new JavaPathProvider(options, processLauncher); }
public void Reads_NSwagPath_From_Options( IProcessLauncher process, IGeneralOptions options, IProgressReporter progressReporter, IDependencyInstaller dependencyInstaller) { new NSwagStudioCodeGenerator( Path.GetFullPath(SwaggerNSwagFilename), options, process, dependencyInstaller, true) .GenerateCode(progressReporter); Mock.Get(options).Verify(c => c.NSwagPath); }
public void Create_Should_Return_NotNull( SwaggerCodegenFactory sut, string swaggerFile, string defaultNamespace, IGeneralOptions options, IProcessLauncher processLauncher, IDependencyInstaller dependencyInstaller) => sut.Create( swaggerFile, defaultNamespace, options, processLauncher, dependencyInstaller) .Should() .NotBeNull();
public OpenApiGeneratorCommand( IConsoleOutput console, IProgressReporter progressReporter, IGeneralOptions options, IOpenApiGeneratorOptions openApiGeneratorOptions, IProcessLauncher processLauncher, IOpenApiGeneratorFactory generatorFactory, IDependencyInstaller dependencyInstaller) : base(console, progressReporter) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.openApiGeneratorOptions = openApiGeneratorOptions; this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.generatorFactory = generatorFactory ?? throw new ArgumentNullException(nameof(generatorFactory)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); }
public void NSwagStudio_GenerateCode_Returns_Null( IProcessLauncher process, IGeneralOptions options, IProgressReporter progressReporter, IDependencyInstaller dependencyInstaller) { new NSwagStudioCodeGenerator( Path.GetFullPath(SwaggerNSwagFilename), options, process, dependencyInstaller) .GenerateCode(progressReporter) .Should() .BeNull(); }
public AutoRestCommand( IConsoleOutput console, IAutoRestOptions options, IProcessLauncher processLauncher, IProgressReporter progressReporter, IAutoRestCodeGeneratorFactory factory, IOpenApiDocumentFactory documentFactory, IDependencyInstaller dependencyInstaller) : base(console, progressReporter) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher)); this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.documentFactory = documentFactory ?? throw new ArgumentNullException(nameof(documentFactory)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); }
public AutoRestCSharpCodeGenerator( string swaggerFile, string defaultNamespace, IAutoRestOptions options, IProcessLauncher processLauncher, IOpenApiDocumentFactory documentFactory, IDependencyInstaller dependencyInstaller, IAutoRestArgumentProvider argumentProvider = null) { SwaggerFile = swaggerFile; DefaultNamespace = defaultNamespace; this.processLauncher = processLauncher; this.documentFactory = documentFactory ?? throw new ArgumentNullException(nameof(documentFactory)); this.dependencyInstaller = dependencyInstaller ?? throw new ArgumentNullException(nameof(dependencyInstaller)); this.argumentProvider = argumentProvider ?? new AutoRestArgumentProvider(options); }
public CodeGeneratorFactory( IOptionsFactory optionsFactory = null, IProcessLauncher processLauncher = null, IOpenApiDocumentFactory documentFactory = null, IRemoteLogger remoteLogger = null, IDependencyInstaller dependencyInstaller = null) { this.remoteLogger = remoteLogger ?? Logger.Instance; this.optionsFactory = optionsFactory ?? new OptionsFactory(); this.processLauncher = processLauncher ?? new ProcessLauncher(); this.documentFactory = documentFactory ?? new OpenApiDocumentFactory(); this.dependencyInstaller = dependencyInstaller ?? new DependencyInstaller( new NpmInstaller(this.processLauncher), new FileDownloader(new WebDownloader())); }
public void Create_Should_Return_NotNull( AutoRestCodeGeneratorFactory sut, string swaggerFile, string defaultNamespace, IAutoRestOptions options, IProcessLauncher processLauncher, IOpenApiDocumentFactory documentFactory, IDependencyInstaller dependencyInstaller) => sut.Create( swaggerFile, defaultNamespace, options, processLauncher, documentFactory, dependencyInstaller) .Should() .NotBeNull();
public void Constructor_Should_Throw_On_Null_IAutoRestCodeGeneratorFactory( IConsoleOutput console, IAutoRestOptions options, IProcessLauncher processLauncher, IProgressReporter progressReporter, IOpenApiDocumentFactory documentFactory, IDependencyInstaller dependencyInstaller) => new Action( () => new AutoRestCommand( console, options, processLauncher, progressReporter, null, documentFactory, dependencyInstaller)) .Should() .ThrowExactly <ArgumentNullException>();