Example #1
0
 public OpenApiSingleFileCustomTool(
     IGeneralOptions options,
     IProcessLauncher processLauncher,
     IOpenApiGeneratorFactory factory)
 {
     this.options         = options ?? throw new ArgumentNullException(nameof(options));
     this.processLauncher = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher));
     this.factory         = factory ?? throw new ArgumentNullException(nameof(factory));
 }
 public OpenApiGeneratorCommand(
     IConsoleOutput console,
     IProgressReporter progressReporter,
     IGeneralOptions options,
     IProcessLauncher processLauncher,
     IOpenApiGeneratorFactory generatorFactory) : base(console, progressReporter)
 {
     this.options          = options ?? throw new ArgumentNullException(nameof(options));
     this.processLauncher  = processLauncher ?? throw new ArgumentNullException(nameof(processLauncher));
     this.generatorFactory = generatorFactory ?? throw new ArgumentNullException(nameof(generatorFactory));
 }
Example #3
0
        public void OnExecuteAsync_Should_NotThrow(
            IConsoleOutput console,
            IProgressReporter progressReporter,
            IProcessLauncher processLauncher,
            IGeneralOptions options,
            IOpenApiGeneratorFactory codeGeneratorFactory,
            ICodeGenerator generator,
            string code)
        {
            var sut = new OpenApiGeneratorCommand(
                console,
                progressReporter,
                options,
                processLauncher,
                codeGeneratorFactory);

            Mock.Get(generator)
            .Setup(c => c.GenerateCode(progressReporter))
            .Returns(code);

            new Func <Task>(sut.OnExecuteAsync).Should().NotThrow();
        }