mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 22:20:56 +00:00
Merge pull request #3115 from wing328/csharp_add_mono_test
[C#] Add mono test script, various enhancements
This commit is contained in:
commit
dda6c600ae
1
.gitignore
vendored
1
.gitignore
vendored
@ -112,6 +112,7 @@ samples/client/petstore/csharp/SwaggerClient/bin
|
||||
samples/client/petstore/csharp/SwaggerClient/obj/Debug/
|
||||
samples/client/petstore/csharp/SwaggerClient/bin/Debug/
|
||||
samples/client/petstore/csharp/SwaggerClient/packages
|
||||
samples/client/petstore/csharp/SwaggerClient/TestResult.xml
|
||||
|
||||
# Python
|
||||
*.pyc
|
||||
|
@ -238,6 +238,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
supportingFiles.add(new SupportingFile("compile.mustache", "", "build.bat"));
|
||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "build.sh"));
|
||||
// shell script to run the nunit test
|
||||
supportingFiles.add(new SupportingFile("mono_nunit_test.mustache", "", "mono_nunit_test.sh"));
|
||||
|
||||
// copy package.config to nuget's standard location for project-level installs
|
||||
supportingFiles.add(new SupportingFile("packages.config.mustache", packageFolder + File.separator, "packages.config"));
|
||||
|
@ -1,7 +1,15 @@
|
||||
{{>partial_header}}
|
||||
|
||||
using System;
|
||||
using RestSharp;
|
||||
|
||||
namespace {{packageName}}.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// A delegate to ExceptionFactory method
|
||||
/// </summary>
|
||||
/// <param name="methodName">Method name</param>
|
||||
/// <param name="response">Response</param>
|
||||
/// <returns>Exceptions</returns>
|
||||
public delegate Exception ExceptionFactory(string methodName, IRestResponse response);
|
||||
}
|
||||
|
@ -71,10 +71,10 @@ limitations under the License.
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
|
@ -71,10 +71,10 @@ limitations under the License.
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
@ -83,10 +83,10 @@ limitations under the License.
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -51,7 +51,8 @@ namespace {{packageName}}.Test
|
||||
[Test]
|
||||
public void {{operationId}}InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<{{classname}}> (instance, "instance is a {{classname}}");
|
||||
// test 'IsInstanceOfType' {{classname}}
|
||||
Assert.IsInstanceOfType(typeof({{classname}}), instance, "instance is a {{classname}}");
|
||||
}
|
||||
|
||||
{{#operations}}{{#operation}}
|
||||
@ -61,12 +62,12 @@ namespace {{packageName}}.Test
|
||||
[Test]
|
||||
public void {{operationId}}Test()
|
||||
{
|
||||
// TODO: add unit test for the method '{{operationId}}'
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null; // TODO: replace null with proper value
|
||||
//{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}}
|
||||
//{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}//Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}}
|
||||
}
|
||||
{{/operation}}{{/operations}}
|
||||
}
|
||||
|
@ -1,15 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
frameworkVersion={{targetFrameworkNuget}}
|
||||
netfx=${frameworkVersion#net}
|
||||
|
||||
echo "[INFO] Target framework: ${frameworkVersion}"
|
||||
|
||||
echo "[INFO] Download nuget and packages"
|
||||
wget -nc https://nuget.org/nuget.exe;
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install src/{{packageName}}/packages.config -o packages;
|
||||
mkdir -p bin;
|
||||
|
||||
cp packages/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
echo "[INFO] Copy DLLs to the 'bin' folder"
|
||||
mkdir -p bin;
|
||||
cp packages/Newtonsoft.Json.8.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll;
|
||||
|
||||
echo "[INFO] Run 'mcs' to build bin/{{{packageName}}}.dll"
|
||||
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
|
||||
bin/RestSharp.dll,\
|
||||
System.Runtime.Serialization.dll \
|
||||
@ -18,3 +38,11 @@ System.Runtime.Serialization.dll \
|
||||
-recurse:'src/{{packageName}}/*.cs' \
|
||||
-doc:bin/{{packageName}}.xml \
|
||||
-platform:anycpu
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "[ERROR] Compilation failed with exit code $?"
|
||||
exit 1
|
||||
else
|
||||
echo "[INFO] bin/{{{packageName}}}.dll was created successfully"
|
||||
fi
|
||||
|
@ -1,3 +1,17 @@
|
||||
:: Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
::
|
||||
:: Licensed under the Apache License, Version 2.0 (the "License");
|
||||
:: you may not use this file except in compliance with the License.
|
||||
:: You may obtain a copy of the License at
|
||||
::
|
||||
:: http://www.apache.org/licenses/LICENSE-2.0
|
||||
::
|
||||
:: Unless required by applicable law or agreed to in writing, software
|
||||
:: distributed under the License is distributed on an "AS IS" BASIS,
|
||||
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
:: See the License for the specific language governing permissions and
|
||||
:: limitations under the License.
|
||||
|
||||
@echo off
|
||||
|
||||
{{#supportsAsync}}SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319{{/supportsAsync}}
|
||||
@ -8,7 +22,7 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
|
||||
|
||||
if not exist ".\bin" mkdir bin
|
||||
|
||||
copy packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll bin\RestSharp.dll
|
||||
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml
|
||||
|
@ -25,7 +25,8 @@ namespace {{packageName}}.Test
|
||||
[TestFixture]
|
||||
public class {{classname}}Tests
|
||||
{
|
||||
private {{classname}} instance;
|
||||
// TODO uncomment below to declare an instance variable for {{classname}}
|
||||
//private {{classname}} instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
@ -33,7 +34,8 @@ namespace {{packageName}}.Test
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new {{classname}}();
|
||||
// TODO uncomment below to create an instance of {{classname}}
|
||||
//instance = new {{classname}}();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -51,7 +53,8 @@ namespace {{packageName}}.Test
|
||||
[Test]
|
||||
public void {{classname}}InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<{{classname}}> (instance, "instance is a {{classname}}");
|
||||
// TODO uncomment below to test "IsInstanceOfType" {{classname}}
|
||||
//Assert.IsInstanceOfType<{{classname}}> (instance, "variable 'instance' is a {{classname}}");
|
||||
}
|
||||
|
||||
{{#vars}}
|
||||
@ -61,7 +64,7 @@ namespace {{packageName}}.Test
|
||||
[Test]
|
||||
public void {{name}}Test()
|
||||
{
|
||||
// TODO: unit test for the property '{{name}}'
|
||||
// TODO unit test for the property '{{name}}'
|
||||
}
|
||||
{{/vars}}
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
wget -nc https://nuget.org/nuget.exe
|
||||
mozroots --import --sync
|
||||
|
||||
echo "[INFO] remove bin/Debug/SwaggerClientTest.dll"
|
||||
rm src/IO.Swagger.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null
|
||||
|
||||
echo "[INFO] install NUnit runners via NuGet"
|
||||
wget -nc https://nuget.org/nuget.exe
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install src/{{{packageName}}}.Test/packages.config -o packages
|
||||
|
||||
echo "[INFO] Install NUnit runners via NuGet"
|
||||
mono nuget.exe install NUnit.Runners -Version 3.2.1 -OutputDirectory packages
|
||||
|
||||
echo "[INFO] Build the solution and run the unit test"
|
||||
xbuild {{{packageName}}}.sln && \
|
||||
mono ./packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe src/{{{packageName}}}.Test/bin/debug/{{{packageName}}}.Test.dll
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
</packages>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="2.6.3" targetFramework="{{targetFrameworkNuget}}" />
|
||||
<package id="NUnit" version="3.2.1" targetFramework="{{targetFrameworkNuget}}" />
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
</packages>
|
||||
|
@ -21,3 +21,4 @@
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
src/IO.Swagger.Test/IO.Swagger.Test.csproj
|
||||
|
@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
VisualStudioVersion = 12.0.0.0
|
||||
MinimumVisualStudioVersion = 10.0.0.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{EE727567-9CAF-4258-AA0E-FDF89487D7D6}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{7B20DAE3-B510-4814-8986-CF1B89EA039E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||
EndProject
|
||||
@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7B20DAE3-B510-4814-8986-CF1B89EA039E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7B20DAE3-B510-4814-8986-CF1B89EA039E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7B20DAE3-B510-4814-8986-CF1B89EA039E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7B20DAE3-B510-4814-8986-CF1B89EA039E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
||||
|
||||
- API version: 1.0.0
|
||||
- SDK version: 1.0.0
|
||||
- Build date: 2016-06-10T08:07:39.769-04:00
|
||||
- Build date: 2016-06-12T12:38:46.317+08:00
|
||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||
|
||||
## Frameworks supported
|
||||
@ -138,6 +138,12 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
@ -147,9 +153,3 @@ Class | Method | HTTP request | Description
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
|
@ -1,3 +1,17 @@
|
||||
:: Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
::
|
||||
:: Licensed under the Apache License, Version 2.0 (the "License");
|
||||
:: you may not use this file except in compliance with the License.
|
||||
:: You may obtain a copy of the License at
|
||||
::
|
||||
:: http://www.apache.org/licenses/LICENSE-2.0
|
||||
::
|
||||
:: Unless required by applicable law or agreed to in writing, software
|
||||
:: distributed under the License is distributed on an "AS IS" BASIS,
|
||||
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
:: See the License for the specific language governing permissions and
|
||||
:: limitations under the License.
|
||||
|
||||
@echo off
|
||||
|
||||
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
|
||||
@ -8,7 +22,7 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
|
||||
|
||||
if not exist ".\bin" mkdir bin
|
||||
|
||||
copy packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
|
||||
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml
|
||||
|
@ -1,15 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
frameworkVersion=net45
|
||||
netfx=${frameworkVersion#net}
|
||||
|
||||
echo "[INFO] Target framework: ${frameworkVersion}"
|
||||
|
||||
echo "[INFO] Download nuget and packages"
|
||||
wget -nc https://nuget.org/nuget.exe;
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install src/IO.Swagger/packages.config -o packages;
|
||||
mkdir -p bin;
|
||||
|
||||
cp packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
echo "[INFO] Copy DLLs to the 'bin' folder"
|
||||
mkdir -p bin;
|
||||
cp packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
|
||||
|
||||
echo "[INFO] Run 'mcs' to build bin/IO.Swagger.dll"
|
||||
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
|
||||
bin/RestSharp.dll,\
|
||||
System.Runtime.Serialization.dll \
|
||||
@ -18,3 +38,11 @@ System.Runtime.Serialization.dll \
|
||||
-recurse:'src/IO.Swagger/*.cs' \
|
||||
-doc:bin/IO.Swagger.xml \
|
||||
-platform:anycpu
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "[ERROR] Compilation failed with exit code $?"
|
||||
exit 1
|
||||
else
|
||||
echo "[INFO] bin/IO.Swagger.dll was created successfully"
|
||||
fi
|
||||
|
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
wget -nc https://nuget.org/nuget.exe
|
||||
mozroots --import --sync
|
||||
|
||||
echo "[INFO] remove bin/Debug/SwaggerClientTest.dll"
|
||||
rm src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll 2> /dev/null
|
||||
|
||||
echo "[INFO] install NUnit runners via NuGet"
|
||||
wget -nc https://nuget.org/nuget.exe
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install src/IO.Swagger.Test/packages.config -o packages
|
||||
|
||||
echo "[INFO] Install NUnit runners via NuGet"
|
||||
mono nuget.exe install NUnit.Runners -Version 3.2.1 -OutputDirectory packages
|
||||
|
||||
echo "[INFO] Build the solution and run the unit test"
|
||||
xbuild IO.Swagger.sln && \
|
||||
mono ./packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe src/IO.Swagger.Test/bin/debug/IO.Swagger.Test.dll
|
@ -48,7 +48,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<FakeApi> (instance, "instance is a FakeApi");
|
||||
Assert.IsInstanceOfType(typeof(FakeApi), instance, "instance is a FakeApi");
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,7 +97,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<PetApi> (instance, "instance is a PetApi");
|
||||
Assert.IsInstanceOfType(typeof(PetApi), instance, "instance is a PetApi");
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ namespace IO.Swagger.Test
|
||||
List<Pet> listPet = petApi.FindPetsByTags (tagsList);
|
||||
foreach (Pet pet in listPet) // Loop through List with foreach.
|
||||
{
|
||||
Assert.IsInstanceOf<Pet> (pet, "Response is a Pet");
|
||||
Assert.IsInstanceOfType(typeof(Pet), pet, "Response is a Pet");
|
||||
Assert.AreEqual ("csharp sample tag name1", pet.Tags[0]);
|
||||
}
|
||||
}
|
||||
@ -147,7 +147,7 @@ namespace IO.Swagger.Test
|
||||
{
|
||||
List<string> tags = new List<String>(new String[] {"pet"});
|
||||
var response = instance.FindPetsByTags(tags);
|
||||
Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
|
||||
Assert.IsInstanceOfType(typeof(List<Pet>), response, "response is List<Pet>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -161,19 +161,19 @@ namespace IO.Swagger.Test
|
||||
|
||||
PetApi petApi = new PetApi (c1);
|
||||
Pet response = petApi.GetPetById (petId);
|
||||
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
||||
Assert.IsInstanceOfType(typeof(Pet), response, "Response is a Pet");
|
||||
|
||||
Assert.AreEqual ("Csharp test", response.Name);
|
||||
Assert.AreEqual (Pet.StatusEnum.Available, response.Status);
|
||||
|
||||
Assert.IsInstanceOf<List<Tag>> (response.Tags, "Response.Tags is a Array");
|
||||
Assert.IsInstanceOfType(typeof(List<Tag>), response.Tags, "Response.Tags is a Array");
|
||||
Assert.AreEqual (petId, response.Tags [0].Id);
|
||||
Assert.AreEqual ("csharp sample tag name1", response.Tags [0].Name);
|
||||
|
||||
Assert.IsInstanceOf<List<String>> (response.PhotoUrls, "Response.PhotoUrls is a Array");
|
||||
Assert.IsInstanceOfType(typeof(List<String>), response.PhotoUrls, "Response.PhotoUrls is a Array");
|
||||
Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]);
|
||||
|
||||
Assert.IsInstanceOf<Category> (response.Category, "Response.Category is a Category");
|
||||
Assert.IsInstanceOfType(typeof(Category), response.Category, "Response.Category is a Category");
|
||||
Assert.AreEqual (56, response.Category.Id);
|
||||
Assert.AreEqual ("sample category name2", response.Category.Name);
|
||||
}
|
||||
@ -187,19 +187,19 @@ namespace IO.Swagger.Test
|
||||
PetApi petApi = new PetApi ();
|
||||
var task = petApi.GetPetByIdAsync (petId);
|
||||
Pet response = task.Result;
|
||||
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
||||
Assert.IsInstanceOfType(typeof(Pet), response, "Response is a Pet");
|
||||
|
||||
Assert.AreEqual ("Csharp test", response.Name);
|
||||
Assert.AreEqual (Pet.StatusEnum.Available, response.Status);
|
||||
|
||||
Assert.IsInstanceOf<List<Tag>> (response.Tags, "Response.Tags is a Array");
|
||||
Assert.IsInstanceOfType(typeof(List<Tag>), response.Tags, "Response.Tags is a Array");
|
||||
Assert.AreEqual (petId, response.Tags [0].Id);
|
||||
Assert.AreEqual ("csharp sample tag name1", response.Tags [0].Name);
|
||||
|
||||
Assert.IsInstanceOf<List<String>> (response.PhotoUrls, "Response.PhotoUrls is a Array");
|
||||
Assert.IsInstanceOfType(typeof(List<String>), response.PhotoUrls, "Response.PhotoUrls is a Array");
|
||||
Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]);
|
||||
|
||||
Assert.IsInstanceOf<Category> (response.Category, "Response.Category is a Category");
|
||||
Assert.IsInstanceOfType(typeof(Category), response.Category, "Response.Category is a Category");
|
||||
Assert.AreEqual (56, response.Category.Id);
|
||||
Assert.AreEqual ("sample category name2", response.Category.Name);
|
||||
|
||||
@ -219,19 +219,19 @@ namespace IO.Swagger.Test
|
||||
Assert.AreEqual (task.Result.Headers["Content-Type"], "application/json");
|
||||
|
||||
Pet response = task.Result.Data;
|
||||
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
||||
Assert.IsInstanceOfType(typeof(Pet), response, "Response is a Pet");
|
||||
|
||||
Assert.AreEqual ("Csharp test", response.Name);
|
||||
Assert.AreEqual (Pet.StatusEnum.Available, response.Status);
|
||||
|
||||
Assert.IsInstanceOf<List<Tag>> (response.Tags, "Response.Tags is a Array");
|
||||
Assert.IsInstanceOfType(typeof(List<Tag>), response.Tags, "Response.Tags is a Array");
|
||||
Assert.AreEqual (petId, response.Tags [0].Id);
|
||||
Assert.AreEqual ("csharp sample tag name1", response.Tags [0].Name);
|
||||
|
||||
Assert.IsInstanceOf<List<String>> (response.PhotoUrls, "Response.PhotoUrls is a Array");
|
||||
Assert.IsInstanceOfType(typeof(List<String>), response.PhotoUrls, "Response.PhotoUrls is a Array");
|
||||
Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]);
|
||||
|
||||
Assert.IsInstanceOf<Category> (response.Category, "Response.Category is a Category");
|
||||
Assert.IsInstanceOfType(typeof(Category), response.Category, "Response.Category is a Category");
|
||||
Assert.AreEqual (56, response.Category.Id);
|
||||
Assert.AreEqual ("sample category name2", response.Category.Name);
|
||||
|
||||
@ -258,9 +258,9 @@ namespace IO.Swagger.Test
|
||||
petApi.UpdatePetWithForm (petId, "new form name", "pending");
|
||||
|
||||
Pet response = petApi.GetPetById (petId);
|
||||
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
||||
Assert.IsInstanceOf<Category> (response.Category, "Response.Category is a Category");
|
||||
Assert.IsInstanceOf<List<Tag>> (response.Tags, "Response.Tags is a Array");
|
||||
Assert.IsInstanceOfType(typeof(Pet), response, "Response is a Pet");
|
||||
Assert.IsInstanceOfType(typeof(Category), response.Category, "Response.Category is a Category");
|
||||
Assert.IsInstanceOfType(typeof(List<Tag>), response.Tags, "Response.Tags is a Array");
|
||||
|
||||
Assert.AreEqual ("new form name", response.Name);
|
||||
Assert.AreEqual (Pet.StatusEnum.Pending, response.Status);
|
||||
|
@ -50,7 +50,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<StoreApi> (instance, "instance is a StoreApi");
|
||||
Assert.IsInstanceOfType(typeof(StoreApi), instance, "instance is a StoreApi");
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ namespace IO.Swagger.Test
|
||||
|
||||
foreach(KeyValuePair<string, int?> entry in response)
|
||||
{
|
||||
Assert.IsInstanceOf (typeof(int?), entry.Value);
|
||||
Assert.IsInstanceOfType(typeof(int?), entry.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<UserApi> (instance, "instance is a UserApi");
|
||||
Assert.IsInstanceOfType(typeof(UserApi), instance, "instance is a UserApi");
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@ -59,10 +59,10 @@ limitations under the License.
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
@ -71,14 +71,14 @@ limitations under the License.
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.3.2.1\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs"/>
|
||||
<Compile Include="**\*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
@ -86,9 +86,11 @@ limitations under the License.
|
||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
|
||||
<Project>{EE727567-9CAF-4258-AA0E-FDF89487D7D6}</Project>
|
||||
<Project>{85AE8212-9819-4224-A9E5-B93419EC927B}</Project>
|
||||
<Name>IO.Swagger</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="swagger-logo.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void AdditionalPropertiesClassInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<AdditionalPropertiesClass> (instance, "instance is a AdditionalPropertiesClass");
|
||||
Assert.IsInstanceOfType(typeof(AdditionalPropertiesClass), instance, "instance is a AdditionalPropertiesClass");
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void AnimalFarmInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<AnimalFarm> (instance, "instance is a AnimalFarm");
|
||||
Assert.IsInstanceOfType(typeof(AnimalFarm), instance, "instance is a AnimalFarm");
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void AnimalInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Animal> (instance, "instance is a Animal");
|
||||
Assert.IsInstanceOfType(typeof(Animal), instance, "instance is a Animal");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void ApiResponseInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ApiResponse> (instance, "instance is a ApiResponse");
|
||||
Assert.IsInstanceOfType(typeof(ApiResponse), instance, "instance is a ApiResponse");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void ArrayTestInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ArrayTest> (instance, "instance is a ArrayTest");
|
||||
Assert.IsInstanceOfType(typeof(ArrayTest), instance, "instance is a ArrayTest");
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void CatInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Cat> (instance, "instance is a Cat");
|
||||
Assert.IsInstanceOfType(typeof(Cat), instance, "instance is a Cat");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void CategoryInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Category> (instance, "instance is a Category");
|
||||
Assert.IsInstanceOfType(typeof(Category), instance, "instance is a Category");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void DogInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Dog> (instance, "instance is a Dog");
|
||||
Assert.IsInstanceOfType(typeof(Dog), instance, "instance is a Dog");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void EnumClassInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<EnumClass> (instance, "instance is a EnumClass");
|
||||
Assert.IsInstanceOfType(typeof(EnumClass), instance, "instance is a EnumClass");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void EnumTestInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<EnumTest> (instance, "instance is a EnumTest");
|
||||
Assert.IsInstanceOfType(typeof(EnumTest), instance, "instance is a EnumTest");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void FormatTestInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<FormatTest> (instance, "instance is a FormatTest");
|
||||
Assert.IsInstanceOfType(typeof(FormatTest), instance, "instance is a FormatTest");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<MixedPropertiesAndAdditionalPropertiesClass> (instance, "instance is a MixedPropertiesAndAdditionalPropertiesClass");
|
||||
Assert.IsInstanceOfType(typeof(MixedPropertiesAndAdditionalPropertiesClass), instance, "instance is a MixedPropertiesAndAdditionalPropertiesClass");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void Model200ResponseInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Model200Response> (instance, "instance is a Model200Response");
|
||||
Assert.IsInstanceOfType(typeof(Model200Response), instance, "instance is a Model200Response");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void ModelReturnInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ModelReturn> (instance, "instance is a ModelReturn");
|
||||
Assert.IsInstanceOfType(typeof(ModelReturn), instance, "instance is a ModelReturn");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void NameInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Name> (instance, "instance is a Name");
|
||||
Assert.IsInstanceOfType(typeof(Name), instance, "instance is a Name");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -57,7 +57,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void OrderInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Order> (instance, "instance is a Order");
|
||||
Assert.IsInstanceOfType(typeof(Order), instance, "instance is a Order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -49,7 +49,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void PetInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Pet> (instance, "instance is a Pet");
|
||||
Assert.IsInstanceOfType(typeof(Pet), instance, "instance is a Pet");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void ReadOnlyFirstInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ReadOnlyFirst> (instance, "instance is a ReadOnlyFirst");
|
||||
Assert.IsInstanceOfType(typeof(ReadOnlyFirst), instance, "instance is a ReadOnlyFirst");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void SpecialModelNameInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<SpecialModelName> (instance, "instance is a SpecialModelName");
|
||||
Assert.IsInstanceOfType(typeof(SpecialModelName), instance, "instance is a SpecialModelName");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void TagInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Tag> (instance, "instance is a Tag");
|
||||
Assert.IsInstanceOfType(typeof(Tag), instance, "instance is a Tag");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -47,7 +47,7 @@ namespace IO.Swagger.Test
|
||||
[Test]
|
||||
public void UserInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<User> (instance, "instance is a User");
|
||||
Assert.IsInstanceOfType(typeof(User), instance, "instance is a User");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="2.6.3" targetFramework="net45" />
|
||||
<package id="NUnit" version="3.2.1" targetFramework="net45" />
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
||||
|
@ -1,7 +1,36 @@
|
||||
/*
|
||||
* Swagger Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using RestSharp;
|
||||
|
||||
namespace IO.Swagger.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// A delegate to ExceptionFactory method
|
||||
/// </summary>
|
||||
/// <param name="methodName">Method name</param>
|
||||
/// <param name="response">Response</param>
|
||||
/// <returns>Exceptions</returns>
|
||||
public delegate Exception ExceptionFactory(string methodName, IRestResponse response);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ limitations under the License.
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE727567-9CAF-4258-AA0E-FDF89487D7D6}</ProjectGuid>
|
||||
<ProjectGuid>{7B20DAE3-B510-4814-8986-CF1B89EA039E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Swagger Library</RootNamespace>
|
||||
@ -59,10 +59,10 @@ limitations under the License.
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
||||
|
Loading…
x
Reference in New Issue
Block a user