Esempio n. 1
0
 public OpenApiCSharpCodeGenerator(string swaggerFile, string defaultNamespace, IGeneralOptions options)
 {
     this.swaggerFile      = swaggerFile ?? throw new ArgumentNullException(nameof(swaggerFile));
     this.defaultNamespace = defaultNamespace ?? throw new ArgumentNullException(nameof(defaultNamespace));
     this.options          = new CustomPathOptions(options ?? throw new ArgumentNullException(nameof(options)));
     javaPathProvider      = new JavaPathProvider(options ?? throw new ArgumentNullException(nameof(options)));
 }
        public void Init()
        {
            var fixture = new Fixture();

            mock = new Mock <IGeneralOptions>();
            mock.Setup(c => c.JavaPath).Returns(fixture.Create <string>());
            mock.Setup(c => c.NpmPath).Returns(fixture.Create <string>());
            mock.Setup(c => c.NSwagPath).Returns(fixture.Create <string>());
            mock.Setup(c => c.SwaggerCodegenPath).Returns(fixture.Create <string>());
            mock.Setup(c => c.OpenApiGeneratorPath).Returns(fixture.Create <string>());

            sut = new CustomPathOptions(mock.Object);
        }
Esempio n. 3
0
 public NSwagStudioCodeGenerator(string nswagStudioFile, IGeneralOptions options)
 {
     this.nswagStudioFile = nswagStudioFile ?? throw new ArgumentNullException(nameof(nswagStudioFile));
     this.options         = new CustomPathOptions(options ?? throw new ArgumentNullException(nameof(options)));
 }