public void Reads_SwaggerCodegenPath( [Frozen] IGeneralOptions options, [Frozen] IProgressReporter progressReporter, SwaggerCSharpCodeGenerator sut) { sut.GenerateCode(progressReporter); Mock.Get(options).Verify(c => c.SwaggerCodegenPath); }
public void Updates_Progress( [Frozen] IProgressReporter progressReporter, SwaggerCSharpCodeGenerator sut) { sut.GenerateCode(progressReporter); Mock.Get(progressReporter).Verify( c => c.Progress( It.IsAny <uint>(), It.IsAny <uint>()), Times.Exactly(5)); }
public static void Init(TestContext testContext) { optionsMock = new Mock <IGeneralOptions>(); optionsMock.Setup(c => c.NSwagPath).Returns(PathProvider.GetJavaPath()); var codeGenerator = new SwaggerCSharpCodeGenerator( Path.GetFullPath("Swagger.json"), typeof(SwaggerCodeGeneratorTests).Namespace, optionsMock.Object); code = codeGenerator.GenerateCode(mock.Object); }
// [ClassInitialize] public static void Init(/* TestContext testContext */) { optionsMock = new Mock <IGeneralOptions>(); optionsMock.Setup(c => c.NSwagPath).Returns(PathProvider.GetJavaPath()); var codeGenerator = new SwaggerCSharpCodeGenerator( Path.GetFullPath(SwaggerJsonFilename), "GeneratedCode", optionsMock.Object); code = codeGenerator.GenerateCode(mock.Object); }
public SwaggerCodeGeneratorFixture() { OptionsMock.Setup(c => c.NSwagPath).Returns(PathProvider.GetJavaPath()); var codeGenerator = new SwaggerCSharpCodeGenerator( Path.GetFullPath("Swagger.json"), typeof(SwaggerCodeGeneratorTests).Namespace, OptionsMock.Object, new ProcessLauncher()); Code = codeGenerator.GenerateCode(ProgressReporterMock.Object); }
protected override void OnInitialize() { ThrowNotSupportedOnUnix(); OptionsMock.Setup(c => c.JavaPath).Returns(PathProvider.GetJavaPath()); var codeGenerator = new SwaggerCSharpCodeGenerator( Path.GetFullPath(SwaggerYamlFilename), "GeneratedCode", OptionsMock.Object, new ProcessLauncher()); Code = codeGenerator.GenerateCode(ProgressReporterMock.Object); }
protected override void OnInitialize() { ThrowNotSupportedOnUnix(); OptionsMock.Setup(c => c.NSwagPath).Returns(PathProvider.GetJavaPath()); var codeGenerator = new SwaggerCSharpCodeGenerator( Path.GetFullPath(SwaggerJsonFilename), "GeneratedCode", OptionsMock.Object, new ProcessLauncher(), new DependencyInstaller( new NpmInstaller(new ProcessLauncher()), new FileDownloader(new WebDownloader()))); Code = codeGenerator.GenerateCode(ProgressReporterMock.Object); }