Example #1
0
        public void OnExecuteAsync_Should_NotThrow(
            [Frozen] IProgressReporter progressReporter,
            [Frozen] ICodeGenerator generator,
            SwaggerCodegenCommand sut,
            string code)
        {
            Mock.Get(generator)
            .Setup(c => c.GenerateCode(progressReporter))
            .Returns(code);

            new Func <int>(sut.OnExecute).Should().NotThrow();
        }
Example #2
0
        public void OnExecuteAsync_Should_NotThrow(
            IConsoleOutput console,
            IProgressReporter progressReporter,
            IProcessLauncher processLauncher,
            IGeneralOptions options,
            ISwaggerCodegenFactory codeGeneratorFactory,
            ICodeGenerator generator,
            string code)
        {
            var sut = new SwaggerCodegenCommand(
                console,
                progressReporter,
                options,
                processLauncher,
                codeGeneratorFactory);

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

            new Func <int>(sut.OnExecute).Should().NotThrow();
        }
Example #3
0
 public void CreateGenerator_Should_NotNull(SwaggerCodegenCommand sut)
 => sut.CreateGenerator().Should().NotBeNull();
Example #4
0
 public void OutputFile_Should_NotBeNullOrWhiteSpace(SwaggerCodegenCommand sut)
 => sut.OutputFile.Should().NotBeNullOrWhiteSpace();
Example #5
0
 public void DefaultNamespace_Should_NotBeNullOrWhiteSpace(SwaggerCodegenCommand sut)
 => sut.DefaultNamespace.Should().NotBeNullOrWhiteSpace();