Permalink
Browse files

Fix tests

  • Loading branch information...
RSuter committed Nov 8, 2018
1 parent 93ec43f commit 1be21fb646b4ab8f0767eb8c957190cadcf2e3d1
@@ -24,6 +24,7 @@ public async Task When_ConfigurationClass_is_set_then_correct_ctor_is_generated(
var generator = new SwaggerToCSharpClientGenerator(document, new SwaggerToCSharpClientGeneratorSettings
{
InjectHttpClient = false,
ConfigurationClass = "MyConfig",
ClientBaseClass = "MyBaseClass"
});
@@ -79,7 +80,10 @@ public async Task When_code_is_generated_then_by_default_the_system_httpclient_i
var swaggerGenerator = new WebApiToSwaggerGenerator(new WebApiToSwaggerGeneratorSettings());
var document = await swaggerGenerator.GenerateForControllerAsync<FooController>();
var generator = new SwaggerToCSharpClientGenerator(document, new SwaggerToCSharpClientGeneratorSettings());
var generator = new SwaggerToCSharpClientGenerator(document, new SwaggerToCSharpClientGeneratorSettings
{
InjectHttpClient = false
});
//// Act
var code = generator.GenerateFile();
@@ -97,7 +101,8 @@ public async Task When_custom_http_client_type_is_specified_then_an_instance_of_
var generator = new SwaggerToCSharpClientGenerator(document, new SwaggerToCSharpClientGeneratorSettings
{
HttpClientType = "CustomNamespace.CustomHttpClient"
HttpClientType = "CustomNamespace.CustomHttpClient",
InjectHttpClient = false
});
//// Act
@@ -51,10 +51,13 @@ public async Task When_query_parameter_is_enum_array_then_the_enum_is_referenced
var document = await generator.GenerateForControllerAsync<FooController>();
var json = document.ToJson();
var gen = new SwaggerToTypeScriptClientGenerator(document, new SwaggerToTypeScriptClientGeneratorSettings
var clientSettings = new SwaggerToTypeScriptClientGeneratorSettings
{
Template = TypeScriptTemplate.JQueryCallbacks
});
};
clientSettings.TypeScriptGeneratorSettings.TypeScriptVersion = 1.8m;
var gen = new SwaggerToTypeScriptClientGenerator(document, clientSettings);
var code = gen.GenerateFile();
//// Assert

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -50,6 +50,7 @@
<Reference Include="NJsonSchema, Version=9.12.0.0, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.9.12.0\lib\net45\NJsonSchema.dll</HintPath>
</Reference>
<Reference Include="NJsonSchema.CodeGeneration.TypeScript, Version=9.12.0.0, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102" />
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.5.3\lib\net40\Swashbuckle.Core.dll</HintPath>
<Private>True</Private>
@@ -59,8 +59,11 @@ public async Task When_body_is_xml_then_correct_TypeScript_is_generated()
var generator = new WebApiToSwaggerGenerator(new WebApiToSwaggerGeneratorSettings());
var document = await generator.GenerateForControllerAsync<MyXmlController>();
var settings = new SwaggerToTypeScriptClientGeneratorSettings { Template = TypeScriptTemplate.JQueryCallbacks };
settings.TypeScriptGeneratorSettings.TypeScriptVersion = 1.8m;
//// Act
var gen = new SwaggerToTypeScriptClientGenerator(document, new SwaggerToTypeScriptClientGeneratorSettings { Template = TypeScriptTemplate.JQueryCallbacks });
var gen = new SwaggerToTypeScriptClientGenerator(document, settings);
var code = gen.GenerateFile();
//// Assert
@@ -50,7 +50,7 @@ public void When_swagger2typescript_is_called_then_file_is_created()
public async Task When_config_file_with_project_with_newer_json_net_is_run_then_property_is_correct()
{
//// Arrange
var command = "run \"" + Path.GetFullPath("../../../NSwag.VersionMissmatchTest/nswag.json") + "\"";
var command = "run \"" + Path.GetFullPath("../../../NSwag.VersionMissmatchTest/nswag.json") + "\" /runtime:WinX64";
//// Act
var output = RunCommandLine(command, Path.GetFullPath("../../../NSwag.VersionMissmatchTest/output.json"));
@@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.27130.2020
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration", "NSwag.CodeGeneration\NSwag.CodeGeneration.csproj", "{75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NSwag.CodeGeneration.Tests", "NSwag.CodeGeneration.Tests\NSwag.CodeGeneration.Tests.csproj", "{37650571-163A-4BE7-86BF-DC1B02ADACBB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration.Tests", "NSwag.CodeGeneration.Tests\NSwag.CodeGeneration.Tests.csproj", "{37650571-163A-4BE7-86BF-DC1B02ADACBB}"
ProjectSection(ProjectDependencies) = postProject
{26CBD69C-EE7C-4D81-8D62-410F4AD4876B} = {26CBD69C-EE7C-4D81-8D62-410F4AD4876B}
{37AE85DE-B127-4861-B925-1A67A35F314A} = {37AE85DE-B127-4861-B925-1A67A35F314A}
@@ -142,8 +142,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AspNetCore.Launcher.x
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NETCore11", "NSwag.Sample.NETCore11\NSwag.Sample.NETCore11.csproj", "{8522EA49-D7FA-4582-A535-ED28C5AFD746}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Integration.NETCore11", "NSwag.Integration.NETCore11\NSwag.Integration.NETCore11.csproj", "{42F44479-032B-493A-87A7-E103275CB26B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NETCore20", "NSwag.Sample.NETCore20\NSwag.Sample.NETCore20.csproj", "{EC94C4C5-3822-46D0-A8B4-B241D34830C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Core.Tests", "NSwag.Core.Tests\NSwag.Core.Tests.csproj", "{810AF444-D713-4CEE-BC9F-13D7875AE69B}"
@@ -864,24 +862,6 @@ Global
{8522EA49-D7FA-4582-A535-ED28C5AFD746}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU
{8522EA49-D7FA-4582-A535-ED28C5AFD746}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU
{8522EA49-D7FA-4582-A535-ED28C5AFD746}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Debug|x64.ActiveCfg = Debug|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Debug|x64.Build.0 = Debug|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Debug|x86.ActiveCfg = Debug|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Debug|x86.Build.0 = Debug|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Release|Any CPU.Build.0 = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Release|x64.ActiveCfg = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Release|x64.Build.0 = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Release|x86.ActiveCfg = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.Release|x86.Build.0 = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU
{42F44479-032B-493A-87A7-E103275CB26B}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU
{EC94C4C5-3822-46D0-A8B4-B241D34830C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC94C4C5-3822-46D0-A8B4-B241D34830C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC94C4C5-3822-46D0-A8B4-B241D34830C0}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -1038,7 +1018,6 @@ Global
{B715070B-E76E-4959-894A-623EB7639E5F} = {F0F26A35-C4B6-42D0-A1DF-98CA46A5C560}
{E90E9C77-7983-40D0-AAB3-91D16DC639CE} = {F0F26A35-C4B6-42D0-A1DF-98CA46A5C560}
{8522EA49-D7FA-4582-A535-ED28C5AFD746} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5}
{42F44479-032B-493A-87A7-E103275CB26B} = {F31829C6-CEE4-4242-A4D9-820C36127B0B}
{EC94C4C5-3822-46D0-A8B4-B241D34830C0} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5}
{810AF444-D713-4CEE-BC9F-13D7875AE69B} = {634E4ABD-29EC-4EB2-81EF-7E41D6D6F6E0}
{B60E7723-91F4-412B-9EB3-4050B71B0DAA} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5}

0 comments on commit 1be21fb

Please sign in to comment.