C# refactor improvements: .NET Standard and .NET Core (#2187)

* [csharp-refactor] limit available target framework

This removes .NET 3.x, .NET 4.0, UWP, and the "5.0" option (which
referred to PCL 5.0). This gives us a smaller footprint for maintenance,
and doesn't necessarily block consumers from creating custom templates
to support those target frameworks. A workaround for users wanting these
options is to build against openapi-generator 3.3.4.

This moves logic for applying additional properties to strategies per
target framework, as a means to reduce maintenance overhead at the cost
of maybe a little redundancy between strategies.

* [csharp-refactor] Fixing .netstandard support

* [csharp-refactor] Fixing netcoreapp2.0 support

* [csharp-refactor] Regenerate samples

* Fix toLowerCase missing Local.ROOT

* [csharp-refactor] Remove unnecessary bash/batch scripts, update appveyor.

* Update appveyor.yml to test for dotnet/xunit

* Update appveyor.yml

Wrap xunit console environment variables in quotes, to prevent yaml syntax error.

* Update appveyor.yml

Try to use dos-style switches, attempting to remove yaml parse error in appveyor. Previous command matched appveyor docs, but resulted in the parser error.

* Update appveyor.yml

Wrap full commands for netstandard tests in quotes

* Fix linux style slashes in dotnet build, use dotnet test over appveyor xunit

* [csharp-refactor] Update generator docs
This commit is contained in:
Jim Schubert 2019-03-09 23:33:49 -05:00 committed by William Cheng
parent cdb447d187
commit f39e200e5d
248 changed files with 25337 additions and 2639 deletions

View File

@ -7,85 +7,30 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
OpenAPI spec version: 1.0.0
-->
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{19F1DEBC-DE5E-4517-8062-F000CD499087}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Org.OpenAPITools.Test</RootNamespace>
<AssemblyName>Org.OpenAPITools.Test</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="obj\**" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
<Project>{321C8C3F-0156-40C1-AE42-D59761FB9B6C}</Project>
<Name>Org.OpenAPITools</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="linux-logo.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenAPI 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
-->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
<Name>Org.OpenAPITools</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="linux-logo.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,7 @@
# for CI with appveyor.yml
# Ref: http://www.yegor256.com/2015/01/10/windows-appveyor-maven.html
version: '{branch}-{build}'
os: Windows Server 2012
image: Visual Studio 2017
hosts:
petstore.swagger.io: 127.0.0.1
install:
@ -23,9 +23,10 @@ install:
- git clone https://github.com/wing328/swagger-samples
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
build_script:
- dotnet --info
# build C# API client (refactor)
- nuget restore samples\client\petstore\csharp-refactor\OpenAPIClient\Org.OpenAPITools.sln
- msbuild samples\client\petstore\csharp-refactor\OpenAPIClient\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- dotnet build samples\client\petstore\csharp-refactor\OpenAPIClient\Org.OpenAPITools.sln
- dotnet build samples\client\petstore\csharp-refactor\OpenAPIClientCore\Org.OpenAPITools.sln
# build C# API client
- nuget restore samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln
- msbuild samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
@ -41,7 +42,8 @@ test_script:
# restore test-related files
- copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client (refactor)
- nunit-console samples\client\petstore\csharp-refactor\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
- dotnet test samples\client\petstore\csharp-refactor\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp-refactor\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client
- nunit-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
# test c# API client (with PropertyChanged)

View File

@ -1,17 +1,7 @@
#!/bin/sh
# C# Petstore API client (.NET 3.5)
# C# Petstore API client .NET Standard 2.0
./bin/csharp-refactor-petstore.sh
# C# Petstore API client with PropertyChanged
./bin/csharp-refactor-property-changed-petstore.sh
# C# Petstore API client (v5.0 for .net standarnd 1.3+)
./bin/csharp-refactor-petstore-net-standard.sh
# C# Petstore API client (.NET 4.0)
./bin/csharp-refactor-petstore-net-40.sh
# C# Petstore API client (.NET 3.5)
./bin/csharp-refactor-petstore-net-35.sh
# C# Petstore API client .NET Core 2.0
./bin/csharp-refactor-petstore-netcore.sh

View File

@ -0,0 +1,38 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
outdir="samples/client/petstore/csharp-refactor/OpenAPIClientCore"
if [ ! -f "$executable" ]
then
mvn -B clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/csharp-refactor/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-refactor -o ${outdir} --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true,targetFramework=netcoreapp2.0 $@"
java $JAVA_OPTS -jar $executable $ags
# restore csproj file
echo "restore csproject file: CI/samples/client/petstore/csharp-refactor/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj"
cp ./CI/samples.ci/client/petstore/csharp-refactor/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp-refactor/OpenAPIClientCore/src/Org.OpenAPITools.Test/

View File

@ -12,7 +12,7 @@ sidebar_label: csharp-refactor
|sourceFolder|source folder for generated code| |src|
|packageGuid|The GUID that will be associated with the C# project| |null|
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|targetFramework|The target .NET framework version.|<dl><dt>**v3.5**</dt><dd>.NET Framework 3.5 compatible</dd><dt>**v4.0**</dt><dd>.NET Framework 4.0 compatible</dd><dt>**v4.5.2**</dt><dd>.NET Framework 4.5.2+ compatible</dd><dt>**v5.0**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**uwp**</dt><dd>Universal Windows Platform (IMPORTANT: this will be decommissioned and replaced by v5.0)</dd><dl>|v4.5.2|
|targetFramework|The target .NET framework version.|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dl>|v4.6.1|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
@ -23,7 +23,6 @@ sidebar_label: csharp-refactor
|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true|
|optionalProjectFile|Generate {PackageName}.csproj.| |true|
|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false|
|generatePropertyChanged|Specifies a AssemblyDescription for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |false|
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|

View File

@ -19,17 +19,10 @@ using System.Runtime.Serialization.Formatters;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
{{#netStandard}}
using RestSharp.Portable;
using RestSharp.Portable.HttpClient;
using RestSharpMethod = RestSharp.Portable.Method;
{{/netStandard}}
{{^netStandard}}
using RestSharp;
using RestSharp.Deserializers;
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
using RestSharpMethod = RestSharp.Method;
{{/netStandard}}
namespace {{packageName}}.Client
{

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Ref: https://github.com/Fody/Fody -->
<Weavers>
<PropertyChanged/>
</Weavers>

View File

@ -11,9 +11,10 @@
{{#version}}OpenAPI spec version: {{version}}{{/version}}
{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
-->
<Project ToolsVersion="{{^netStandard}}12.0{{/netStandard}}{{#netStandard}}14.0{{/netStandard}}" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
{{#netStandard}}<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>{{/netStandard}}
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{{packageGuid}}</ProjectGuid>
@ -21,107 +22,23 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>{{packageName}}</RootNamespace>
<AssemblyName>{{packageName}}</AssemblyName>
{{#netStandard}}
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkVersion>{{targetFramework}}</TargetFrameworkVersion>
{{/netStandard}}
{{^netStandard}}
{{^supportsUWP}}
<TargetFrameworkVersion>{{targetFramework}}</TargetFrameworkVersion>
{{/supportsUWP}}
{{#supportsUWP}}
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
{{/supportsUWP}}
{{/netStandard}}
<!--<TargetFrameworkVersion>{{targetFramework}}</TargetFrameworkVersion>-->
<TargetFrameworkVersion>{{targetFrameworkVersion}}</TargetFrameworkVersion>
<TargetFrameworkIdentifier>{{targetFrameworkIdentifier}}</TargetFrameworkIdentifier>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
{{^netStandard}}
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
</Reference>
{{#useCompareNetObjects}}
<Reference Include="KellermanSoftware.Compare-NET-Objects">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
</Reference>
{{/useCompareNetObjects}}
{{#generatePropertyChanged}}
<Reference Include="PropertyChanged">
<HintPath>..\..\packages\PropertyChanged.Fody.1.51.3\Lib\portable-net4+sl4+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
</Reference>
{{/generatePropertyChanged}}
{{/netStandard}}
{{#netStandard}}
<!-- A reference to the entire .NET Framework is automatically included -->
<None Include="project.json" />
{{/netStandard}}
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs"
Exclude="obj\**" />
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
{{^netStandard}}
<ItemGroup>
<None Include="packages.config" />
{{#generatePropertyChanged}}
<None Include="FodyWeavers.xml" />
{{/generatePropertyChanged}}
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
{{#generatePropertyChanged}}
<Import Project="..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" Condition="Exists('..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets')" />
{{/generatePropertyChanged}}
{{/netStandard}}
{{#netStandard}}
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
{{/netStandard}}
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</Project>

View File

@ -22,44 +22,32 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- UWP >=10.0
{{/netStandard}}
{{^netStandard}}
{{^supportsUWP}}
- .NET 4.0 or later
- Windows Phone 7.1 (Mango)
{{/supportsUWP}}
{{#supportsUWP}}
- UWP
{{/supportsUWP}}
{{/netStandard}}
<a name="dependencies"></a>
## Dependencies
{{#netStandard}}
- FubarCoder.RestSharp.Portable.Core >=4.0.7
- FubarCoder.RestSharp.Portable.HttpClient >=4.0.7
- Newtonsoft.Json >=10.0.3
{{/netStandard}}
{{^netStandard}}
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.5.0 or later
The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
```
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
Install-Package CompareNETObjects
```
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
{{/netStandard}}
<a name="installation"></a>
## Installation
{{#netStandard}}
Generate the DLL using your preferred tool
Generate the DLL using your preferred tool (e.g. `dotnet build`)
{{/netStandard}}
{{^netStandard}}
Run the following command to generate the DLL

View File

@ -11,91 +11,39 @@
{{#version}}OpenAPI spec version: {{{version}}}{{/version}}
{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
-->
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{19F1DEBC-DE5E-4517-8062-F000CD499087}</ProjectGuid>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>{{testPackageName}}</RootNamespace>
<AssemblyName>{{testPackageName}}</AssemblyName>
{{^supportsUWP}}
<TargetFrameworkVersion>{{targetFramework}}</TargetFrameworkVersion>
{{/supportsUWP}}
{{#supportsUWP}}
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
{{/supportsUWP}}
<!-- By Microsoft design, test project can only be netcoreapp2.0 (even if main project is .netstandard -->
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs"
Exclude="obj\**"/>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<ItemGroup>
<ProjectReference Include="..\{{packageName}}\{{packageName}}.csproj">
<Project>{{packageGuid}}</Project>
<Name>{{packageName}}</Name>
</ProjectReference>
</ItemGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" />
</Target>
</Project>

View File

@ -6,7 +6,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using {{packageName}}.Client;
using {{packageName}}.{{apiPackage}};
@ -22,44 +22,35 @@ namespace {{packageName}}.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class {{classname}}Tests
public class {{classname}}Tests : IDisposable
{
private {{classname}} instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public {{classname}}Tests()
{
instance = new {{classname}}();
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of {{classname}}
/// </summary>
[Test]
[Fact]
public void {{operationId}}InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' {{classname}}
//Assert.IsInstanceOfType(typeof({{classname}}), instance, "instance is a {{classname}}");
//Assert.IsType(typeof({{classname}}), instance, "instance is a {{classname}}");
}
{{#operations}}{{#operation}}
/// <summary>
/// Test {{operationId}}
/// </summary>
[Test]
[Fact]
public void {{operationId}}Test()
{
// TODO uncomment below to test the method and replace null with proper value
@ -67,7 +58,7 @@ namespace {{packageName}}.Test
//{{{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}}//Assert.IsType<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}}
}
{{/operation}}{{/operations}}
}

View File

@ -1,84 +0,0 @@
#!/usr/bin/env bash
#
# Generated by: https://github.com/openapitools/openapi-generator.git
#
frameworkVersion={{targetFrameworkNuget}}
# sdk must match installed framworks under PREFIX/lib/mono/[value]
sdk={{x-mcs-sdk}}
# langversion refers to C# language features. see man mcs for details.
langversion=${sdk}
nuget_cmd=nuget
# Match against our known SDK possibilities
case "${sdk}" in
4)
langversion=4
;;
4.5*)
langversion=5
;;
4.6*)
langversion=6
;;
4.7*)
langversion=7 # ignoring 7.1 for now.
;;
*)
langversion=6
;;
esac
echo "[INFO] Target framework: ${frameworkVersion}"
if ! type nuget &>/dev/null; then
echo "[INFO] Download nuget and packages"
wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
nuget_cmd="mono nuget.exe"
fi
mozroots --import --sync
${nuget_cmd} install src/{{packageName}}/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
{{#useCompareNetObjects}}
cp packages/CompareNETObjects.4.57.0/lib/{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}/KellermanSoftware.Compare-NET-Objects.dll bin/KellermanSoftware.Compare-NET-Objects.dll;
{{/useCompareNetObjects}}
cp packages/Newtonsoft.Json.12.0.1/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.106.5.4/lib/{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}/RestSharp.dll bin/RestSharp.dll;
cp packages/JsonSubTypes.1.5.1/lib/{{targetFrameworkNuget}}/JsonSubTypes.dll bin/JsonSubTypes.dll
{{#generatePropertyChanged}}
cp packages/Fody.1.29.4/Fody.dll bin/Fody.dll
cp packages/PropertyChanged.Fody.1.51.3/PropertyChanged.Fody.dll bin/PropertyChanged.Fody.dll
cp packages/PropertyChanged.Fody.1.51.3/Lib/dotnet/PropertyChanged.dll bin/PropertyChanged.dll
{{/generatePropertyChanged}}
echo "[INFO] Run 'mcs' to build bin/{{{packageName}}}.dll"
mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\
{{#generatePropertyChanged}}
bin/Fody.dll,\
bin/PropertyChanged.Fody.dll,\
bin/PropertyChanged.dll,\
{{/generatePropertyChanged}}
{{#useCompareNetObjects}}
bin/KellermanSoftware.Compare-NET-Objects.dll,\
{{/useCompareNetObjects}}
bin/RestSharp.dll,\
System.ComponentModel.DataAnnotations.dll,\
System.Runtime.Serialization.dll \
-target:library \
-out:bin/{{packageName}}.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

View File

@ -1,29 +0,0 @@
:: Generated by: https://github.com/openapitools/openapi-generator.git
::
@echo off
{{#supportsAsync}}
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
{{/supportsAsync}}
{{^supportsAsync}}
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v3.5
{{/supportsAsync}}
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')"
.\nuget.exe install src\{{packageName}}\packages.config -o packages
if not exist ".\bin" mkdir bin
{{#CompareNetObjects}}
copy packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll bin\KellermanSoftware.Compare-NET-Objects.dll
{{/CompareNetObjects}}
copy packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll bin\JsonSubTypes.dll
copy packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll bin\RestSharp.dll
{{#generatePropertyChanged}}
copy packages\Fody.1.29.4\Fody.dll bin\Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll
{{/generatePropertyChanged}}
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;{{#CompareNetObjects}}bin\KellermanSoftware.Compare-NET-Objects.dll;{{/CompareNetObjects}}System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml

View File

@ -4,9 +4,7 @@ using System;
using System.Linq;
using System.IO;
using System.Text;
{{^netStandard}}
using System.Text.RegularExpressions;
{{/netStandard}}
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -20,13 +18,9 @@ using JsonSubTypes;
{{/discriminator}}
{{/model}}
{{/models}}
{{^netStandard}}
{{#generatePropertyChanged}}
using PropertyChanged;
using System.ComponentModel;
{{/generatePropertyChanged}}
{{#validatable}}
using System.ComponentModel.DataAnnotations;
{{/netStandard}}
{{/validatable}}
using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter;
{{#useCompareNetObjects}}
using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;

View File

@ -11,10 +11,7 @@
[JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{{mappingName}}}")]
{{/mappedModels}}
{{/discriminator}}
{{#generatePropertyChanged}}
[ImplementPropertyChanged]
{{/generatePropertyChanged}}
{{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}}
{{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}}
{
{{#vars}}
{{#items.isEnum}}
@ -227,30 +224,7 @@
return hashCode;
}
}
{{^netStandard}}
{{#generatePropertyChanged}}
/// <summary>
/// Property changed event handler
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Trigger when a property changed
/// </summary>
/// <param name="propertyName">Property Name</param>
public virtual void OnPropertyChanged(string propertyName)
{
// NOTE: property changed is handled via "code weaving" using Fody.
// Properties with setters are modified at compile time to notify of changes.
var propertyChanged = PropertyChanged;
if (propertyChanged != null)
{
propertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
{{/generatePropertyChanged}}
{{#validatable}}
{{#discriminator}}
/// <summary>
@ -337,5 +311,4 @@
yield break;
}
{{/validatable}}
{{/netStandard}}
}

View File

@ -1,6 +1,6 @@
{{>partial_header}}
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -23,35 +23,26 @@ namespace {{packageName}}.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class {{classname}}Tests
public class {{classname}}Tests : IDisposable
{
// TODO uncomment below to declare an instance variable for {{classname}}
//private {{classname}} instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
public {{classname}}Tests()
{
// TODO uncomment below to create an instance of {{classname}}
//instance = new {{classname}}();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of {{classname}}
/// </summary>
[Test]
[Fact]
public void {{classname}}InstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" {{classname}}
@ -63,7 +54,7 @@ namespace {{packageName}}.Test
/// <summary>
/// Test deserialize a {{classname}} from type {{parent}}
/// </summary>
[Test]
[Fact]
public void {{classname}}DeserializeFrom{{parent}}Test()
{
// TODO uncomment below to test deserialize a {{classname}} from type {{parent}}
@ -76,7 +67,7 @@ namespace {{packageName}}.Test
/// <summary>
/// Test the property '{{name}}'
/// </summary>
[Test]
[Fact]
public void {{name}}Test()
{
// TODO unit test for the property '{{name}}'

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
#
# Generated by: https://github.com/openapitools/openapi-generator.git
#
wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
mozroots --import --sync
echo "[INFO] remove bin/Debug/{{{packageName}}}.Test.dll"
rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null
echo "[INFO] install NUnit runners via NuGet"
wget -nc https://dist.nuget.org/win-x86-commandline/latest/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 2.6.4 -OutputDirectory packages
echo "[INFO] Build the solution and run the unit test"
xbuild {{{packageName}}}.sln && \
mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll

View File

@ -1,7 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>{{targetFrameworkNuget}}</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TargetFramework>{{targetFramework}}</TargetFramework>
<TargetFrameworkVersion>{{targetFrameworkVersion}}</TargetFrameworkVersion>
<TargetFrameworkIdentifier>{{targetFrameworkIdentifier}}</TargetFrameworkIdentifier>
<AssemblyName>{{packageName}}</AssemblyName>
<PackageId>{{packageName}}</PackageId>
<OutputType>Library</OutputType>
@ -18,15 +21,11 @@
</PropertyGroup>
<ItemGroup>
{{#netStandard}}
<PackageReference Include="FubarCoder.RestSharp.Portable.Core" Version="4.0.7" />
<PackageReference Include="FubarCoder.RestSharp.Portable.HttpClient" Version="4.0.7" />
{{/netStandard}}
{{^netStandard}}
<PackageReference Include="RestSharp" Version="106.5.4" />
{{/netStandard}}
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="JsonSubTypes" Version="1.5.1" />
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
{{^netStandard}}

View File

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>{{targetFrameworkNuget}}</TargetFramework>
<AssemblyName>{{testPackageName}}</AssemblyName>
<PackageId>{{testPackageName}}</PackageId>
<OutputType>Library</OutputType>
@ -14,18 +13,16 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<RootNamespace>{{testPackageName}}</RootNamespace>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="2.6.4" />
{{#netStandard}}
<PackageReference Include="FubarCoder.RestSharp.Portable.Core" Version="4.0.7" />
{{/netStandard}}
{{^netStandard}}
<PackageReference Include="RestSharp" Version="106.5.4" />
{{/netStandard}}
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="JsonSubTypes" Version="1.5.1" />
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
{{^netStandard}}

View File

@ -32,11 +32,10 @@
<dependency id="NewtonSoft.Json" version="12.0.1" />
<dependency id="JsonSubTypes" version="1.5.1" />
<dependency id="RestSharp" version="106.5.4" />
{{#generatePropertyChanged}}
<dependency id="Fody" version="1.29.4" />
<dependency id="PropertyChanged.Fody" version="1.51.3" />
{{/generatePropertyChanged}}
<dependency id="RestSharp" version="106.6.7" />
<dependency id="CompareNETObjects" version="4.57.0" />
<dependency id="JsonSubTypes" version="1.5.2" />
<dependency id="System.ComponentModel.Annotations" version="4.5.0" />
</dependencies>
</metadata>
@ -45,9 +44,6 @@
<!-- A readme.txt will be displayed when the package is installed -->
<file src="..\..\README.md" target="" />
<file src="..\..\docs\**\*.*" target="docs" />
{{#generatePropertyChanged}}
<file src="..\..\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
{{/generatePropertyChanged}}
</files>
</package>

View File

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
{{#useCompareNetObjects}}
<package id="CompareNETObjects" version="4.57.0" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="CompareNETObjects" version="4.57.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
{{/useCompareNetObjects}}
<package id="RestSharp" version="106.5.4" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
{{#generatePropertyChanged}}
<package id="Fody" version="1.29.4" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net45{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
{{/generatePropertyChanged}}
<package id="RestSharp" version="106.6.7" targetFramework="{{^netStandard}}net452{{/netStandard}}{{#netStandard}}netstandard2.0{{/netStandard}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
</packages>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="{{targetFrameworkNuget}}" />
<package id="RestSharp" version="106.5.4" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}" developmentDependency="true" />
</packages>

View File

@ -1,13 +1,12 @@
{
"supports": {},
"dependencies": {
"FubarCoder.RestSharp.Portable.Core": "4.0.7",
"FubarCoder.RestSharp.Portable.HttpClient": "4.0.7",
"Newtonsoft.Json": "12.0.1",
{{#useCompareNetObjects}}
"KellermanSoftware.Compare-NET-Objects": "4.57.0",
"CompareNETObjects": "4.57.0",
{{/useCompareNetObjects}}
"JsonSubTypes": "1.5.1"
"JsonSubTypes": "1.5.2",
"RestSharp": "106.6.7"
},
"frameworks": {
"{{targetFrameworkNuget}}": {}

View File

@ -1,9 +0,0 @@
#
# Generated by: https://github.com/openapitools/openapi-generator.git
#
language: csharp
mono:
- latest
solution: {{{packageName}}}.sln
script:
- /bin/sh ./mono_nunit_test.sh

View File

@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"

View File

@ -10,29 +10,33 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
<a name="frameworks-supported"></a>
## Frameworks supported
- .NET 4.0 or later
- Windows Phone 7.1 (Mango)
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
<a name="dependencies"></a>
## Dependencies
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.5.0 or later
The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
```
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
Install-Package CompareNETObjects
```
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
<a name="installation"></a>
## Installation
Run the following command to generate the DLL
- [Mac/Linux] `/bin/sh build.sh`
- [Windows] `build.bat`
Generate the DLL using your preferred tool (e.g. `dotnet build`)
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
```csharp
@ -40,19 +44,6 @@ using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
```
<a name="packaging"></a>
## Packaging
A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages.
This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:
```
nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj
```
Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.
<a name="getting-started"></a>
## Getting Started
@ -97,6 +88,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
@ -172,6 +164,7 @@ Class | Method | HTTP request | Description
- [Model.TypeHolderDefault](docs/TypeHolderDefault.md)
- [Model.TypeHolderExample](docs/TypeHolderExample.md)
- [Model.User](docs/User.md)
- [Model.XmlItem](docs/XmlItem.md)
<a name="documentation-for-authorization"></a>

View File

@ -1,16 +0,0 @@
:: Generated by: https://github.com/openapitools/openapi-generator.git
::
@echo off
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')"
.\nuget.exe install src\Org.OpenAPITools\packages.config -o packages
if not exist ".\bin" mkdir bin
copy packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll
copy packages\RestSharp.106.5.4\lib\net452\RestSharp.dll bin\RestSharp.dll
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\Org.OpenAPITools.dll /recurse:src\Org.OpenAPITools\*.cs /doc:bin\Org.OpenAPITools.xml

View File

@ -1,70 +0,0 @@
#!/usr/bin/env bash
#
# Generated by: https://github.com/openapitools/openapi-generator.git
#
frameworkVersion=net45
# sdk must match installed framworks under PREFIX/lib/mono/[value]
sdk=4.5.2-api
# langversion refers to C# language features. see man mcs for details.
langversion=${sdk}
nuget_cmd=nuget
# Match against our known SDK possibilities
case "${sdk}" in
4)
langversion=4
;;
4.5*)
langversion=5
;;
4.6*)
langversion=6
;;
4.7*)
langversion=7 # ignoring 7.1 for now.
;;
*)
langversion=6
;;
esac
echo "[INFO] Target framework: ${frameworkVersion}"
if ! type nuget &>/dev/null; then
echo "[INFO] Download nuget and packages"
wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
nuget_cmd="mono nuget.exe"
fi
mozroots --import --sync
${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages;
echo "[INFO] Copy DLLs to the 'bin' folder"
mkdir -p bin;
cp packages/CompareNETObjects.4.57.0/lib/net452/KellermanSoftware.Compare-NET-Objects.dll bin/KellermanSoftware.Compare-NET-Objects.dll;
cp packages/Newtonsoft.Json.12.0.1/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
cp packages/RestSharp.106.5.4/lib/net452/RestSharp.dll bin/RestSharp.dll;
cp packages/JsonSubTypes.1.5.1/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll
echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll"
mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\
bin/KellermanSoftware.Compare-NET-Objects.dll,\
bin/RestSharp.dll,\
System.ComponentModel.DataAnnotations.dll,\
System.Runtime.Serialization.dll \
-target:library \
-out:bin/Org.OpenAPITools.dll \
-recurse:'src/Org.OpenAPITools/*.cs' \
-doc:bin/Org.OpenAPITools.xml \
-platform:anycpu
if [ $? -ne 0 ]
then
echo "[ERROR] Compilation failed with exit code $?"
exit 1
else
echo "[INFO] bin/Org.OpenAPITools.dll was created successfully"
fi

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**CreateXmlItem**](FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem
[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
@ -18,6 +19,66 @@ Method | HTTP request | Description
[**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
<a name="createxmlitem"></a>
# **CreateXmlItem**
> void CreateXmlItem (XmlItem xmlItem)
creates an XmlItem
this route creates an XmlItem
### Example
```csharp
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class CreateXmlItemExample
{
public void main()
{
var apiInstance = new FakeApi();
var xmlItem = new XmlItem(); // XmlItem | XmlItem Body
try
{
// creates an XmlItem
apiInstance.CreateXmlItem(xmlItem);
}
catch (Exception e)
{
Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message );
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="fakeouterbooleanserialize"></a>
# **FakeOuterBooleanSerialize**
> bool FakeOuterBooleanSerialize (bool? body = null)
@ -161,7 +222,7 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = 1.2D; // decimal? | Input number as post body (optional)
var body = 8.14; // decimal? | Input number as post body (optional)
try
{

View File

@ -0,0 +1,37 @@
# Org.OpenAPITools.Model.XmlItem
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AttributeString** | **string** | | [optional]
**AttributeNumber** | **decimal** | | [optional]
**AttributeInteger** | **int** | | [optional]
**AttributeBoolean** | **bool** | | [optional]
**WrappedArray** | **List&lt;int&gt;** | | [optional]
**NameString** | **string** | | [optional]
**NameNumber** | **decimal** | | [optional]
**NameInteger** | **int** | | [optional]
**NameBoolean** | **bool** | | [optional]
**NameArray** | **List&lt;int&gt;** | | [optional]
**NameWrappedArray** | **List&lt;int&gt;** | | [optional]
**PrefixString** | **string** | | [optional]
**PrefixNumber** | **decimal** | | [optional]
**PrefixInteger** | **int** | | [optional]
**PrefixBoolean** | **bool** | | [optional]
**PrefixArray** | **List&lt;int&gt;** | | [optional]
**PrefixWrappedArray** | **List&lt;int&gt;** | | [optional]
**NamespaceString** | **string** | | [optional]
**NamespaceNumber** | **decimal** | | [optional]
**NamespaceInteger** | **int** | | [optional]
**NamespaceBoolean** | **bool** | | [optional]
**NamespaceArray** | **List&lt;int&gt;** | | [optional]
**NamespaceWrappedArray** | **List&lt;int&gt;** | | [optional]
**PrefixNsString** | **string** | | [optional]
**PrefixNsNumber** | **decimal** | | [optional]
**PrefixNsInteger** | **int** | | [optional]
**PrefixNsBoolean** | **bool** | | [optional]
**PrefixNsArray** | **List&lt;int&gt;** | | [optional]
**PrefixNsWrappedArray** | **List&lt;int&gt;** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -15,7 +15,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
@ -30,50 +30,36 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class AnotherFakeApiTests
{
private AnotherFakeApi instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public AnotherFakeApiTests()
{
instance = new AnotherFakeApi();
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of AnotherFakeApi
/// </summary>
[Test]
[Fact]
public void InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' AnotherFakeApi
//Assert.IsInstanceOfType(typeof(AnotherFakeApi), instance, "instance is a AnotherFakeApi");
//Assert.IsType(typeof(AnotherFakeApi), instance, "instance is a AnotherFakeApi");
}
/// <summary>
/// Test Call123TestSpecialTags
/// </summary>
[Test]
[Fact]
public void Call123TestSpecialTagsTest()
{
// TODO uncomment below to test the method and replace null with proper value
//ModelClient modelClient = null;
//var response = instance.Call123TestSpecialTags(modelClient);
//Assert.IsInstanceOf<ModelClient> (response, "response is ModelClient");
//Assert.IsType<ModelClient> (response, "response is ModelClient");
}
}

View File

@ -15,7 +15,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
@ -30,92 +30,78 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class FakeApiTests
{
private FakeApi instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public FakeApiTests()
{
instance = new FakeApi();
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of FakeApi
/// </summary>
[Test]
[Fact]
public void InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' FakeApi
//Assert.IsInstanceOfType(typeof(FakeApi), instance, "instance is a FakeApi");
//Assert.IsType(typeof(FakeApi), instance, "instance is a FakeApi");
}
/// <summary>
/// Test FakeOuterBooleanSerialize
/// </summary>
[Test]
[Fact]
public void FakeOuterBooleanSerializeTest()
{
// TODO uncomment below to test the method and replace null with proper value
//bool? body = null;
//var response = instance.FakeOuterBooleanSerialize(body);
//Assert.IsInstanceOf<bool?> (response, "response is bool?");
//Assert.IsType<bool?> (response, "response is bool?");
}
/// <summary>
/// Test FakeOuterCompositeSerialize
/// </summary>
[Test]
[Fact]
public void FakeOuterCompositeSerializeTest()
{
// TODO uncomment below to test the method and replace null with proper value
//OuterComposite outerComposite = null;
//var response = instance.FakeOuterCompositeSerialize(outerComposite);
//Assert.IsInstanceOf<OuterComposite> (response, "response is OuterComposite");
//Assert.IsType<OuterComposite> (response, "response is OuterComposite");
}
/// <summary>
/// Test FakeOuterNumberSerialize
/// </summary>
[Test]
[Fact]
public void FakeOuterNumberSerializeTest()
{
// TODO uncomment below to test the method and replace null with proper value
//decimal? body = null;
//var response = instance.FakeOuterNumberSerialize(body);
//Assert.IsInstanceOf<decimal?> (response, "response is decimal?");
//Assert.IsType<decimal?> (response, "response is decimal?");
}
/// <summary>
/// Test FakeOuterStringSerialize
/// </summary>
[Test]
[Fact]
public void FakeOuterStringSerializeTest()
{
// TODO uncomment below to test the method and replace null with proper value
//string body = null;
//var response = instance.FakeOuterStringSerialize(body);
//Assert.IsInstanceOf<string> (response, "response is string");
//Assert.IsType<string> (response, "response is string");
}
/// <summary>
/// Test TestBodyWithFileSchema
/// </summary>
[Test]
[Fact]
public void TestBodyWithFileSchemaTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -127,7 +113,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test TestBodyWithQueryParams
/// </summary>
[Test]
[Fact]
public void TestBodyWithQueryParamsTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -140,19 +126,19 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test TestClientModel
/// </summary>
[Test]
[Fact]
public void TestClientModelTest()
{
// TODO uncomment below to test the method and replace null with proper value
//ModelClient modelClient = null;
//var response = instance.TestClientModel(modelClient);
//Assert.IsInstanceOf<ModelClient> (response, "response is ModelClient");
//Assert.IsType<ModelClient> (response, "response is ModelClient");
}
/// <summary>
/// Test TestEndpointParameters
/// </summary>
[Test]
[Fact]
public void TestEndpointParametersTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -177,7 +163,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test TestEnumParameters
/// </summary>
[Test]
[Fact]
public void TestEnumParametersTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -196,7 +182,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test TestInlineAdditionalProperties
/// </summary>
[Test]
[Fact]
public void TestInlineAdditionalPropertiesTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -208,7 +194,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test TestJsonFormData
/// </summary>
[Test]
[Fact]
public void TestJsonFormDataTest()
{
// TODO uncomment below to test the method and replace null with proper value

View File

@ -15,7 +15,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
@ -30,50 +30,36 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class FakeClassnameTags123ApiTests
{
private FakeClassnameTags123Api instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public FakeClassnameTags123ApiTests()
{
instance = new FakeClassnameTags123Api();
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of FakeClassnameTags123Api
/// </summary>
[Test]
[Fact]
public void InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' FakeClassnameTags123Api
//Assert.IsInstanceOfType(typeof(FakeClassnameTags123Api), instance, "instance is a FakeClassnameTags123Api");
//Assert.IsType(typeof(FakeClassnameTags123Api), instance, "instance is a FakeClassnameTags123Api");
}
/// <summary>
/// Test TestClassname
/// </summary>
[Test]
[Fact]
public void TestClassnameTest()
{
// TODO uncomment below to test the method and replace null with proper value
//ModelClient modelClient = null;
//var response = instance.TestClassname(modelClient);
//Assert.IsInstanceOf<ModelClient> (response, "response is ModelClient");
//Assert.IsType<ModelClient> (response, "response is ModelClient");
}
}

View File

@ -15,7 +15,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
@ -30,8 +30,7 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class PetApiTests
public class PetApiTests : IDisposable
{
private PetApi instance;
@ -74,11 +73,7 @@ namespace Org.OpenAPITools.Test
return bytes;
}
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public PetApiTests()
{
instance = new PetApi();
@ -90,31 +85,20 @@ namespace Org.OpenAPITools.Test
petApi.AddPet(p);
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
// remove the pet after testing
PetApi petApi = new PetApi();
petApi.DeletePet(petId, "test key");
}
/// <summary>
/// Test an instance of PetApi
/// </summary>
[Test]
[Fact]
public void InstanceTest()
{
Assert.IsInstanceOf<PetApi>(instance);
Assert.IsType<PetApi>(instance);
}
/// <summary>
/// Test AddPet
/// </summary>
[Test]
[Fact]
public void AddPetTest()
{
// create pet
@ -125,7 +109,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test DeletePet
/// </summary>
[Test]
[Fact]
public void DeletePetTest()
{
// no need to test as it'c covered by Cleanup() already
@ -134,7 +118,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test FindPetsByStatus
/// </summary>
[Test]
[Fact]
public void FindPetsByStatusTest()
{
PetApi petApi = new PetApi();
@ -143,26 +127,26 @@ namespace Org.OpenAPITools.Test
List<Pet> listPet = petApi.FindPetsByTags(tagsList);
foreach (Pet pet in listPet) // Loop through List with foreach.
{
Assert.IsInstanceOf<Pet>(pet);
Assert.AreEqual("csharp sample tag name1", pet.Tags[0]);
Assert.IsType<Pet>(pet);
Assert.Equal("available", pet.Tags[0].Name);
}
}
/// <summary>
/// Test FindPetsByTags
/// </summary>
[Test]
[Fact]
public void FindPetsByTagsTest()
{
List<string> tags = new List<String>(new String[] { "pet" });
var response = instance.FindPetsByTags(tags);
Assert.IsInstanceOf<List<Pet>>(response);
Assert.IsType<List<Pet>>(response);
}
/// <summary>
/// Test GetPetById
/// </summary>
[Test]
[Fact]
public void GetPetByIdTest()
{
// set timeout to 10 seconds
@ -172,84 +156,84 @@ namespace Org.OpenAPITools.Test
PetApi petApi = new PetApi(c1);
Pet response = petApi.GetPetById(petId);
Assert.IsInstanceOf<Pet>(response);
Assert.IsType<Pet>(response);
Assert.AreEqual("Csharp test", response.Name);
Assert.AreEqual(Pet.StatusEnum.Available, response.Status);
Assert.Equal("Csharp test", response.Name);
Assert.Equal(Pet.StatusEnum.Available, response.Status);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual("csharp sample tag name1", response.Tags[0].Name);
Assert.IsType<List<Tag>>(response.Tags);
Assert.Equal(petId, response.Tags[0].Id);
Assert.Equal("csharp sample tag name1", response.Tags[0].Name);
Assert.IsInstanceOf<List<String>>(response.PhotoUrls);
Assert.AreEqual("sample photoUrls", response.PhotoUrls[0]);
Assert.IsType<List<String>>(response.PhotoUrls);
Assert.Equal("sample photoUrls", response.PhotoUrls[0]);
Assert.IsInstanceOf<Category>(response.Category);
Assert.AreEqual(56, response.Category.Id);
Assert.AreEqual("sample category name2", response.Category.Name);
Assert.IsType<Category>(response.Category);
Assert.Equal(56, response.Category.Id);
Assert.Equal("sample category name2", response.Category.Name);
}
/// <summary>
/// Test GetPetByIdAsync
/// </summary>
[Test()]
[Fact]
public void TestGetPetByIdAsync()
{
PetApi petApi = new PetApi();
var task = petApi.GetPetByIdAsync(petId);
Pet response = task.Result;
Assert.IsInstanceOf<Pet>(response);
Assert.IsType<Pet>(response);
Assert.AreEqual("Csharp test", response.Name);
Assert.AreEqual(Pet.StatusEnum.Available, response.Status);
Assert.Equal("Csharp test", response.Name);
Assert.Equal(Pet.StatusEnum.Available, response.Status);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual("csharp sample tag name1", response.Tags[0].Name);
Assert.IsType<List<Tag>>(response.Tags);
Assert.Equal(petId, response.Tags[0].Id);
Assert.Equal("csharp sample tag name1", response.Tags[0].Name);
Assert.IsInstanceOf<List<String>>(response.PhotoUrls);
Assert.AreEqual("sample photoUrls", response.PhotoUrls[0]);
Assert.IsType<List<String>>(response.PhotoUrls);
Assert.Equal("sample photoUrls", response.PhotoUrls[0]);
Assert.IsInstanceOf<Category>(response.Category);
Assert.AreEqual(56, response.Category.Id);
Assert.AreEqual("sample category name2", response.Category.Name);
Assert.IsType<Category>(response.Category);
Assert.Equal(56, response.Category.Id);
Assert.Equal("sample category name2", response.Category.Name);
}
/// <summary>
/// Test GetPetByIdAsyncWithHttpInfo
/// </summary>
[Test()]
[Fact]
public void TestGetPetByIdAsyncWithHttpInfo()
{
PetApi petApi = new PetApi();
var task = petApi.GetPetByIdAsyncWithHttpInfo(petId);
Assert.AreEqual(200, (int)task.Result.StatusCode);
Assert.IsTrue(task.Result.Headers.ContainsKey("Content-Type"));
Assert.AreEqual("application/json", task.Result.Headers["Content-Type"][0]);
Assert.Equal(200, (int)task.Result.StatusCode);
Assert.True(task.Result.Headers.ContainsKey("Content-Type"));
Assert.Equal("application/json", task.Result.Headers["Content-Type"][0]);
Pet response = task.Result.Data;
Assert.IsInstanceOf<Pet>(response);
Assert.IsType<Pet>(response);
Assert.AreEqual("Csharp test", response.Name);
Assert.AreEqual(Pet.StatusEnum.Available, response.Status);
Assert.Equal("Csharp test", response.Name);
Assert.Equal(Pet.StatusEnum.Available, response.Status);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual("csharp sample tag name1", response.Tags[0].Name);
Assert.IsType<List<Tag>>(response.Tags);
Assert.Equal(petId, response.Tags[0].Id);
Assert.Equal("csharp sample tag name1", response.Tags[0].Name);
Assert.IsInstanceOf<List<String>>(response.PhotoUrls);
Assert.AreEqual("sample photoUrls", response.PhotoUrls[0]);
Assert.IsType<List<String>>(response.PhotoUrls);
Assert.Equal("sample photoUrls", response.PhotoUrls[0]);
Assert.IsInstanceOf<Category>(response.Category);
Assert.AreEqual(56, response.Category.Id);
Assert.AreEqual("sample category name2", response.Category.Name);
Assert.IsType<Category>(response.Category);
Assert.Equal(56, response.Category.Id);
Assert.Equal("sample category name2", response.Category.Name);
}
/// <summary>
/// Test UpdatePet
/// </summary>
[Test]
[Fact]
public void UpdatePetTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -262,33 +246,33 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test UpdatePetWithForm
/// </summary>
[Test]
[Fact]
public void UpdatePetWithFormTest()
{
PetApi petApi = new PetApi();
petApi.UpdatePetWithForm(petId, "new form name", "pending");
Pet response = petApi.GetPetById(petId);
Assert.IsInstanceOf<Pet>(response);
Assert.IsInstanceOf<Category>(response.Category);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.IsType<Pet>(response);
Assert.IsType<Category>(response.Category);
Assert.IsType<List<Tag>>(response.Tags);
Assert.AreEqual("new form name", response.Name);
Assert.AreEqual(Pet.StatusEnum.Pending, response.Status);
Assert.Equal("new form name", response.Name);
Assert.Equal(Pet.StatusEnum.Pending, response.Status);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual(56, response.Category.Id);
Assert.Equal(petId, response.Tags[0].Id);
Assert.Equal(56, response.Category.Id);
// test optional parameter
petApi.UpdatePetWithForm(petId, "new form name2");
Pet response2 = petApi.GetPetById(petId);
Assert.AreEqual("new form name2", response2.Name);
Assert.Equal("new form name2", response2.Name);
}
/// <summary>
/// Test UploadFile
/// </summary>
[Test]
[Fact]
public void UploadFileTest()
{
Assembly _assembly = Assembly.GetExecutingAssembly();
@ -305,7 +289,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test UploadFileWithRequiredFile
/// </summary>
[Test]
[Fact]
public void UploadFileWithRequiredFileTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -313,27 +297,27 @@ namespace Org.OpenAPITools.Test
//System.IO.Stream requiredFile = null;
//string additionalMetadata = null;
//var response = instance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
//Assert.IsInstanceOf<ApiResponse> (response, "response is ApiResponse");
//Assert.IsType<ApiResponse> (response, "response is ApiResponse");
}
/// <summary>
/// Test status code
/// </summary>
[Test()]
[Fact]
public void TestStatusCodeAndHeader()
{
PetApi petApi = new PetApi();
var response = petApi.GetPetByIdWithHttpInfo(petId);
//Assert.AreEqual("OK", response.StatusCode);
Assert.AreEqual(200, (int)response.StatusCode);
Assert.IsTrue(response.Headers.ContainsKey("Content-Type"));
Assert.AreEqual("application/json", response.Headers["Content-Type"][0]);
//Assert.Equal("OK", response.StatusCode);
Assert.Equal(200, (int)response.StatusCode);
Assert.True(response.Headers.ContainsKey("Content-Type"));
Assert.Equal("application/json", response.Headers["Content-Type"][0]);
}
/// <summary>
/// Test default header (should be deprecated)
/// </summary>
[Test()]
[Fact]
public void TestDefaultHeader()
{
//PetApi petApi = new PetApi();
@ -344,6 +328,12 @@ namespace Org.OpenAPITools.Test
//petApi.Configuration.AddDefaultHeader("header_key2", "header_value2");
}
public void Dispose()
{
// remove the pet after testing
PetApi petApi = new PetApi();
petApi.DeletePet(petId, "test key");
}
}
}

View File

@ -15,7 +15,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
@ -30,44 +30,30 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class StoreApiTests
{
private StoreApi instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public StoreApiTests()
{
instance = new StoreApi();
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of StoreApi
/// </summary>
[Test]
[Fact]
public void InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' StoreApi
//Assert.IsInstanceOfType(typeof(StoreApi), instance, "instance is a StoreApi");
//Assert.IsType(typeof(StoreApi), instance, "instance is a StoreApi");
}
/// <summary>
/// Test DeleteOrder
/// </summary>
[Test]
[Fact]
public void DeleteOrderTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -79,36 +65,36 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test GetInventory
/// </summary>
[Test]
[Fact]
public void GetInventoryTest()
{
// TODO uncomment below to test the method and replace null with proper value
//var response = instance.GetInventory();
//Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
//Assert.IsType<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
}
/// <summary>
/// Test GetOrderById
/// </summary>
[Test]
[Fact]
public void GetOrderByIdTest()
{
// TODO uncomment below to test the method and replace null with proper value
//long? orderId = null;
//var response = instance.GetOrderById(orderId);
//Assert.IsInstanceOf<Order> (response, "response is Order");
//Assert.IsType<Order> (response, "response is Order");
}
/// <summary>
/// Test PlaceOrder
/// </summary>
[Test]
[Fact]
public void PlaceOrderTest()
{
// TODO uncomment below to test the method and replace null with proper value
//Order order = null;
//var response = instance.PlaceOrder(order);
//Assert.IsInstanceOf<Order> (response, "response is Order");
//Assert.IsType<Order> (response, "response is Order");
}
}

View File

@ -15,7 +15,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using RestSharp;
using NUnit.Framework;
using Xunit;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
@ -30,44 +30,30 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class UserApiTests
{
private UserApi instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
public UserApiTests()
{
instance = new UserApi();
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of UserApi
/// </summary>
[Test]
[Fact]
public void InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' UserApi
//Assert.IsInstanceOfType(typeof(UserApi), instance, "instance is a UserApi");
//Assert.IsType(typeof(UserApi), instance, "instance is a UserApi");
}
/// <summary>
/// Test CreateUser
/// </summary>
[Test]
[Fact]
public void CreateUserTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -79,7 +65,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test CreateUsersWithArrayInput
/// </summary>
[Test]
[Fact]
public void CreateUsersWithArrayInputTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -91,7 +77,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test CreateUsersWithListInput
/// </summary>
[Test]
[Fact]
public void CreateUsersWithListInputTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -103,7 +89,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test DeleteUser
/// </summary>
[Test]
[Fact]
public void DeleteUserTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -115,32 +101,32 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test GetUserByName
/// </summary>
[Test]
[Fact]
public void GetUserByNameTest()
{
// TODO uncomment below to test the method and replace null with proper value
//string username = null;
//var response = instance.GetUserByName(username);
//Assert.IsInstanceOf<User> (response, "response is User");
//Assert.IsType<User> (response, "response is User");
}
/// <summary>
/// Test LoginUser
/// </summary>
[Test]
[Fact]
public void LoginUserTest()
{
// TODO uncomment below to test the method and replace null with proper value
//string username = null;
//string password = null;
//var response = instance.LoginUser(username, password);
//Assert.IsInstanceOf<string> (response, "response is string");
//Assert.IsType<string> (response, "response is string");
}
/// <summary>
/// Test LogoutUser
/// </summary>
[Test]
[Fact]
public void LogoutUserTest()
{
// TODO uncomment below to test the method and replace null with proper value
@ -151,7 +137,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test UpdateUser
/// </summary>
[Test]
[Fact]
public void UpdateUserTest()
{
// TODO uncomment below to test the method and replace null with proper value

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,26 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class AdditionalPropertiesClassTests
{
// TODO uncomment below to declare an instance variable for AdditionalPropertiesClass
//private AdditionalPropertiesClass instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of AdditionalPropertiesClass
//instance = new AdditionalPropertiesClass();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of AdditionalPropertiesClass
/// </summary>
[Test]
[Fact]
public void AdditionalPropertiesClassInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" AdditionalPropertiesClass
//Assert.IsInstanceOfType<AdditionalPropertiesClass> (instance, "variable 'instance' is a AdditionalPropertiesClass");
//Assert.IsType<AdditionalPropertiesClass> (instance, "variable 'instance' is a AdditionalPropertiesClass");
}
/// <summary>
/// Test the property 'MapProperty'
/// </summary>
[Test]
[Fact]
public void MapPropertyTest()
{
// TODO unit test for the property 'MapProperty'
@ -77,7 +57,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'MapOfMapProperty'
/// </summary>
[Test]
[Fact]
public void MapOfMapPropertyTest()
{
// TODO unit test for the property 'MapOfMapProperty'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,39 +30,16 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class AnimalFarmTests
{
// TODO uncomment below to declare an instance variable for AnimalFarm
//private AnimalFarm instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of AnimalFarm
//instance = new AnimalFarm();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of AnimalFarm
/// </summary>
[Test]
[Fact]
public void AnimalFarmInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" AnimalFarm
//Assert.IsInstanceOfType<AnimalFarm> (instance, "variable 'instance' is a AnimalFarm");
//Assert.IsType<AnimalFarm> (instance, "variable 'instance' is a AnimalFarm");
}

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,64 +30,41 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class AnimalTests
{
// TODO uncomment below to declare an instance variable for Animal
//private Animal instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Animal
//instance = new Animal();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Animal
/// </summary>
[Test]
[Fact]
public void AnimalInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Animal
//Assert.IsInstanceOfType<Animal> (instance, "variable 'instance' is a Animal");
//Assert.IsType<Animal> (instance, "variable 'instance' is a Animal");
}
/// <summary>
/// Test deserialize a Dog from type Animal
/// </summary>
[Test]
[Fact]
public void DogDeserializeFromAnimalTest()
{
// TODO uncomment below to test deserialize a Dog from type Animal
//Assert.IsInstanceOf<Animal>(JsonConvert.DeserializeObject<Animal>(new Dog().ToJson()));
//Assert.IsType<Animal>(JsonConvert.DeserializeObject<Animal>(new Dog().ToJson()));
}
/// <summary>
/// Test deserialize a Cat from type Animal
/// </summary>
[Test]
[Fact]
public void CatDeserializeFromAnimalTest()
{
// TODO uncomment below to test deserialize a Cat from type Animal
//Assert.IsInstanceOf<Animal>(JsonConvert.DeserializeObject<Animal>(new Cat().ToJson()));
//Assert.IsType<Animal>(JsonConvert.DeserializeObject<Animal>(new Cat().ToJson()));
}
/// <summary>
/// Test the property 'ClassName'
/// </summary>
[Test]
[Fact]
public void ClassNameTest()
{
// TODO unit test for the property 'ClassName'
@ -95,7 +72,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Color'
/// </summary>
[Test]
[Fact]
public void ColorTest()
{
// TODO unit test for the property 'Color'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ApiResponseTests
{
// TODO uncomment below to declare an instance variable for ApiResponse
//private ApiResponse instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ApiResponse
//instance = new ApiResponse();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ApiResponse
/// </summary>
[Test]
[Fact]
public void ApiResponseInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ApiResponse
//Assert.IsInstanceOfType<ApiResponse> (instance, "variable 'instance' is a ApiResponse");
//Assert.IsType<ApiResponse> (instance, "variable 'instance' is a ApiResponse");
}
/// <summary>
/// Test the property 'Code'
/// </summary>
[Test]
[Fact]
public void CodeTest()
{
// TODO unit test for the property 'Code'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Type'
/// </summary>
[Test]
[Fact]
public void TypeTest()
{
// TODO unit test for the property 'Type'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Message'
/// </summary>
[Test]
[Fact]
public void MessageTest()
{
// TODO unit test for the property 'Message'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ArrayOfArrayOfNumberOnlyTests
{
// TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly
//private ArrayOfArrayOfNumberOnly instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly
//instance = new ArrayOfArrayOfNumberOnly();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ArrayOfArrayOfNumberOnly
/// </summary>
[Test]
[Fact]
public void ArrayOfArrayOfNumberOnlyInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ArrayOfArrayOfNumberOnly
//Assert.IsInstanceOfType<ArrayOfArrayOfNumberOnly> (instance, "variable 'instance' is a ArrayOfArrayOfNumberOnly");
//Assert.IsType<ArrayOfArrayOfNumberOnly> (instance, "variable 'instance' is a ArrayOfArrayOfNumberOnly");
}
/// <summary>
/// Test the property 'ArrayArrayNumber'
/// </summary>
[Test]
[Fact]
public void ArrayArrayNumberTest()
{
// 1st instance
@ -94,11 +71,11 @@ namespace Org.OpenAPITools.Test
instance2.ArrayArrayNumber = listOfList2;
Assert.IsTrue(instance1.Equals(instance2));
Assert.True(instance1.Equals(instance2));
// add one more element to list2
list2.Add(183.3m);
Assert.IsFalse(instance1.Equals(instance2));
Assert.False(instance1.Equals(instance2));
// 3rd instance
ArrayOfArrayOfNumberOnly instance3 = new ArrayOfArrayOfNumberOnly();
@ -109,7 +86,7 @@ namespace Org.OpenAPITools.Test
List<List<decimal>> listOfList3 = new List<List<decimal>>();
instance2.ArrayArrayNumber = listOfList3;
Assert.IsFalse(instance1.Equals(instance3));
Assert.False(instance1.Equals(instance3));
}
}

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ArrayOfNumberOnlyTests
{
// TODO uncomment below to declare an instance variable for ArrayOfNumberOnly
//private ArrayOfNumberOnly instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ArrayOfNumberOnly
//instance = new ArrayOfNumberOnly();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ArrayOfNumberOnly
/// </summary>
[Test]
[Fact]
public void ArrayOfNumberOnlyInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ArrayOfNumberOnly
//Assert.IsInstanceOfType<ArrayOfNumberOnly> (instance, "variable 'instance' is a ArrayOfNumberOnly");
//Assert.IsType<ArrayOfNumberOnly> (instance, "variable 'instance' is a ArrayOfNumberOnly");
}
/// <summary>
/// Test the property 'ArrayNumber'
/// </summary>
[Test]
[Fact]
public void ArrayNumberTest()
{
// TODO unit test for the property 'ArrayNumber'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ArrayTestTests
{
// TODO uncomment below to declare an instance variable for ArrayTest
//private ArrayTest instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ArrayTest
//instance = new ArrayTest();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ArrayTest
/// </summary>
[Test]
[Fact]
public void ArrayTestInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ArrayTest
//Assert.IsInstanceOfType<ArrayTest> (instance, "variable 'instance' is a ArrayTest");
//Assert.IsType<ArrayTest> (instance, "variable 'instance' is a ArrayTest");
}
/// <summary>
/// Test the property 'ArrayOfString'
/// </summary>
[Test]
[Fact]
public void ArrayOfStringTest()
{
// TODO unit test for the property 'ArrayOfString'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ArrayArrayOfInteger'
/// </summary>
[Test]
[Fact]
public void ArrayArrayOfIntegerTest()
{
// TODO unit test for the property 'ArrayArrayOfInteger'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ArrayArrayOfModel'
/// </summary>
[Test]
[Fact]
public void ArrayArrayOfModelTest()
{
// TODO unit test for the property 'ArrayArrayOfModel'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class CapitalizationTests
{
// TODO uncomment below to declare an instance variable for Capitalization
//private Capitalization instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Capitalization
//instance = new Capitalization();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Capitalization
/// </summary>
[Test]
[Fact]
public void CapitalizationInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Capitalization
//Assert.IsInstanceOfType<Capitalization> (instance, "variable 'instance' is a Capitalization");
//Assert.IsType<Capitalization> (instance, "variable 'instance' is a Capitalization");
}
/// <summary>
/// Test the property 'SmallCamel'
/// </summary>
[Test]
[Fact]
public void SmallCamelTest()
{
// TODO unit test for the property 'SmallCamel'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'CapitalCamel'
/// </summary>
[Test]
[Fact]
public void CapitalCamelTest()
{
// TODO unit test for the property 'CapitalCamel'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'SmallSnake'
/// </summary>
[Test]
[Fact]
public void SmallSnakeTest()
{
// TODO unit test for the property 'SmallSnake'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'CapitalSnake'
/// </summary>
[Test]
[Fact]
public void CapitalSnakeTest()
{
// TODO unit test for the property 'CapitalSnake'
@ -101,7 +78,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'SCAETHFlowPoints'
/// </summary>
[Test]
[Fact]
public void SCAETHFlowPointsTest()
{
// TODO unit test for the property 'SCAETHFlowPoints'
@ -109,7 +86,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ATT_NAME'
/// </summary>
[Test]
[Fact]
public void ATT_NAMETest()
{
// TODO unit test for the property 'ATT_NAME'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class CatTests
{
// TODO uncomment below to declare an instance variable for Cat
//private Cat instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Cat
//instance = new Cat();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Cat
/// </summary>
[Test]
[Fact]
public void CatInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Cat
//Assert.IsInstanceOfType<Cat> (instance, "variable 'instance' is a Cat");
//Assert.IsType<Cat> (instance, "variable 'instance' is a Cat");
}
/// <summary>
/// Test the property 'Declawed'
/// </summary>
[Test]
[Fact]
public void DeclawedTest()
{
// TODO unit test for the property 'Declawed'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class CategoryTests
{
// TODO uncomment below to declare an instance variable for Category
//private Category instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Category
//instance = new Category();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Category
/// </summary>
[Test]
[Fact]
public void CategoryInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Category
//Assert.IsInstanceOfType<Category> (instance, "variable 'instance' is a Category");
//Assert.IsType<Category> (instance, "variable 'instance' is a Category");
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,24 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ClassModelTests
{
// TODO uncomment below to declare an instance variable for ClassModel
//private ClassModel instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ClassModel
//instance = new ClassModel();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ClassModel
/// </summary>
[Test]
[Fact]
public void ClassModelInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ClassModel
//Assert.IsInstanceOfType<ClassModel> (instance, "variable 'instance' is a ClassModel");
//Assert.IsType<ClassModel> (instance, "variable 'instance' is a ClassModel");
}
/// <summary>
/// Test the property 'Class'
/// </summary>
[Test]
[Fact]
public void ClassTest()
{
// TODO unit test for the property 'Class'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class DogTests
{
// TODO uncomment below to declare an instance variable for Dog
//private Dog instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Dog
//instance = new Dog();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Dog
/// </summary>
[Test]
[Fact]
public void DogInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Dog
//Assert.IsInstanceOfType<Dog> (instance, "variable 'instance' is a Dog");
//Assert.IsType<Dog> (instance, "variable 'instance' is a Dog");
}
/// <summary>
/// Test the property 'Breed'
/// </summary>
[Test]
[Fact]
public void BreedTest()
{
// TODO unit test for the property 'Breed'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class EnumArraysTests
{
// TODO uncomment below to declare an instance variable for EnumArrays
//private EnumArrays instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of EnumArrays
//instance = new EnumArrays();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of EnumArrays
/// </summary>
[Test]
[Fact]
public void EnumArraysInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" EnumArrays
//Assert.IsInstanceOfType<EnumArrays> (instance, "variable 'instance' is a EnumArrays");
//Assert.IsType<EnumArrays> (instance, "variable 'instance' is a EnumArrays");
}
/// <summary>
/// Test the property 'JustSymbol'
/// </summary>
[Test]
[Fact]
public void JustSymbolTest()
{
// TODO unit test for the property 'JustSymbol'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ArrayEnum'
/// </summary>
[Test]
[Fact]
public void ArrayEnumTest()
{
// TODO unit test for the property 'ArrayEnum'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,39 +30,17 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class EnumClassTests
{
// TODO uncomment below to declare an instance variable for EnumClass
//private EnumClass instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of EnumClass
//instance = new EnumClass();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of EnumClass
/// </summary>
[Test]
[Fact]
public void EnumClassInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" EnumClass
//Assert.IsInstanceOfType<EnumClass> (instance, "variable 'instance' is a EnumClass");
//Assert.IsType<EnumClass> (instance, "variable 'instance' is a EnumClass");
}

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class EnumTestTests
{
// TODO uncomment below to declare an instance variable for EnumTest
//private EnumTest instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of EnumTest
//instance = new EnumTest();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of EnumTest
/// </summary>
[Test]
[Fact]
public void EnumTestInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" EnumTest
//Assert.IsInstanceOfType<EnumTest> (instance, "variable 'instance' is a EnumTest");
//Assert.IsType<EnumTest> (instance, "variable 'instance' is a EnumTest");
}
/// <summary>
/// Test the property 'EnumString'
/// </summary>
[Test]
[Fact]
public void EnumStringTest()
{
// TODO unit test for the property 'EnumString'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'EnumStringRequired'
/// </summary>
[Test]
[Fact]
public void EnumStringRequiredTest()
{
// TODO unit test for the property 'EnumStringRequired'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'EnumInteger'
/// </summary>
[Test]
[Fact]
public void EnumIntegerTest()
{
// TODO unit test for the property 'EnumInteger'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'EnumNumber'
/// </summary>
[Test]
[Fact]
public void EnumNumberTest()
{
// TODO unit test for the property 'EnumNumber'
@ -101,7 +78,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'OuterEnum'
/// </summary>
[Test]
[Fact]
public void OuterEnumTest()
{
// TODO unit test for the property 'OuterEnum'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class FileSchemaTestClassTests
{
// TODO uncomment below to declare an instance variable for FileSchemaTestClass
//private FileSchemaTestClass instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of FileSchemaTestClass
//instance = new FileSchemaTestClass();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of FileSchemaTestClass
/// </summary>
[Test]
[Fact]
public void FileSchemaTestClassInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" FileSchemaTestClass
//Assert.IsInstanceOfType<FileSchemaTestClass> (instance, "variable 'instance' is a FileSchemaTestClass");
//Assert.IsType<FileSchemaTestClass> (instance, "variable 'instance' is a FileSchemaTestClass");
}
/// <summary>
/// Test the property 'File'
/// </summary>
[Test]
[Fact]
public void FileTest()
{
// TODO unit test for the property 'File'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Files'
/// </summary>
[Test]
[Fact]
public void FilesTest()
{
// TODO unit test for the property 'Files'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class FileTests
{
// TODO uncomment below to declare an instance variable for File
//private File instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of File
//instance = new File();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of File
/// </summary>
[Test]
[Fact]
public void FileInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" File
//Assert.IsInstanceOfType<File> (instance, "variable 'instance' is a File");
//Assert.IsType<File> (instance, "variable 'instance' is a File");
}
/// <summary>
/// Test the property 'SourceURI'
/// </summary>
[Test]
[Fact]
public void SourceURITest()
{
// TODO unit test for the property 'SourceURI'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class FormatTestTests
{
// TODO uncomment below to declare an instance variable for FormatTest
//private FormatTest instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of FormatTest
//instance = new FormatTest();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of FormatTest
/// </summary>
[Test]
[Fact]
public void FormatTestInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" FormatTest
//Assert.IsInstanceOfType<FormatTest> (instance, "variable 'instance' is a FormatTest");
//Assert.IsType<FormatTest> (instance, "variable 'instance' is a FormatTest");
}
/// <summary>
/// Test the property 'Integer'
/// </summary>
[Test]
[Fact]
public void IntegerTest()
{
// TODO unit test for the property 'Integer'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Int32'
/// </summary>
[Test]
[Fact]
public void Int32Test()
{
// TODO unit test for the property 'Int32'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Int64'
/// </summary>
[Test]
[Fact]
public void Int64Test()
{
// TODO unit test for the property 'Int64'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Number'
/// </summary>
[Test]
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
@ -101,7 +78,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Float'
/// </summary>
[Test]
[Fact]
public void FloatTest()
{
// TODO unit test for the property 'Float'
@ -109,7 +86,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Double'
/// </summary>
[Test]
[Fact]
public void DoubleTest()
{
// TODO unit test for the property 'Double'
@ -117,7 +94,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'String'
/// </summary>
[Test]
[Fact]
public void StringTest()
{
// TODO unit test for the property 'String'
@ -125,7 +102,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Byte'
/// </summary>
[Test]
[Fact]
public void ByteTest()
{
// TODO unit test for the property 'Byte'
@ -133,7 +110,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Test]
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
@ -141,7 +118,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Date'
/// </summary>
[Test]
[Fact]
public void DateTest()
{
// TODO unit test for the property 'Date'
@ -149,7 +126,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'DateTime'
/// </summary>
[Test]
[Fact]
public void DateTimeTest()
{
// TODO unit test for the property 'DateTime'
@ -157,7 +134,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Uuid'
/// </summary>
[Test]
[Fact]
public void UuidTest()
{
// TODO unit test for the property 'Uuid'
@ -165,7 +142,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Password'
/// </summary>
[Test]
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class HasOnlyReadOnlyTests
{
// TODO uncomment below to declare an instance variable for HasOnlyReadOnly
//private HasOnlyReadOnly instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of HasOnlyReadOnly
//instance = new HasOnlyReadOnly();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of HasOnlyReadOnly
/// </summary>
[Test]
[Fact]
public void HasOnlyReadOnlyInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" HasOnlyReadOnly
//Assert.IsInstanceOfType<HasOnlyReadOnly> (instance, "variable 'instance' is a HasOnlyReadOnly");
//Assert.IsType<HasOnlyReadOnly> (instance, "variable 'instance' is a HasOnlyReadOnly");
}
/// <summary>
/// Test the property 'Bar'
/// </summary>
[Test]
[Fact]
public void BarTest()
{
// TODO unit test for the property 'Bar'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Foo'
/// </summary>
[Test]
[Fact]
public void FooTest()
{
// TODO unit test for the property 'Foo'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ListTests
{
// TODO uncomment below to declare an instance variable for List
//private List instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of List
//instance = new List();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of List
/// </summary>
[Test]
[Fact]
public void ListInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" List
//Assert.IsInstanceOfType<List> (instance, "variable 'instance' is a List");
//Assert.IsType<List> (instance, "variable 'instance' is a List");
}
/// <summary>
/// Test the property '_123List'
/// </summary>
[Test]
[Fact]
public void _123ListTest()
{
// TODO unit test for the property '_123List'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class MapTestTests
{
// TODO uncomment below to declare an instance variable for MapTest
//private MapTest instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of MapTest
//instance = new MapTest();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of MapTest
/// </summary>
[Test]
[Fact]
public void MapTestInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" MapTest
//Assert.IsInstanceOfType<MapTest> (instance, "variable 'instance' is a MapTest");
//Assert.IsType<MapTest> (instance, "variable 'instance' is a MapTest");
}
/// <summary>
/// Test the property 'MapMapOfString'
/// </summary>
[Test]
[Fact]
public void MapMapOfStringTest()
{
// TODO unit test for the property 'MapMapOfString'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'MapOfEnumString'
/// </summary>
[Test]
[Fact]
public void MapOfEnumStringTest()
{
// TODO unit test for the property 'MapOfEnumString'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'DirectMap'
/// </summary>
[Test]
[Fact]
public void DirectMapTest()
{
// TODO unit test for the property 'DirectMap'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'IndirectMap'
/// </summary>
[Test]
[Fact]
public void IndirectMapTest()
{
// TODO unit test for the property 'IndirectMap'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class MixedPropertiesAndAdditionalPropertiesClassTests
{
// TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass
//private MixedPropertiesAndAdditionalPropertiesClass instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass
//instance = new MixedPropertiesAndAdditionalPropertiesClass();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of MixedPropertiesAndAdditionalPropertiesClass
/// </summary>
[Test]
[Fact]
public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" MixedPropertiesAndAdditionalPropertiesClass
//Assert.IsInstanceOfType<MixedPropertiesAndAdditionalPropertiesClass> (instance, "variable 'instance' is a MixedPropertiesAndAdditionalPropertiesClass");
//Assert.IsType<MixedPropertiesAndAdditionalPropertiesClass> (instance, "variable 'instance' is a MixedPropertiesAndAdditionalPropertiesClass");
}
/// <summary>
/// Test the property 'Uuid'
/// </summary>
[Test]
[Fact]
public void UuidTest()
{
// TODO unit test for the property 'Uuid'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'DateTime'
/// </summary>
[Test]
[Fact]
public void DateTimeTest()
{
// TODO unit test for the property 'DateTime'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Map'
/// </summary>
[Test]
[Fact]
public void MapTest()
{
// TODO unit test for the property 'Map'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class Model200ResponseTests
{
// TODO uncomment below to declare an instance variable for Model200Response
//private Model200Response instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Model200Response
//instance = new Model200Response();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Model200Response
/// </summary>
[Test]
[Fact]
public void Model200ResponseInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Model200Response
//Assert.IsInstanceOfType<Model200Response> (instance, "variable 'instance' is a Model200Response");
//Assert.IsType<Model200Response> (instance, "variable 'instance' is a Model200Response");
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Class'
/// </summary>
[Test]
[Fact]
public void ClassTest()
{
// TODO unit test for the property 'Class'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ModelClientTests
{
// TODO uncomment below to declare an instance variable for ModelClient
//private ModelClient instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ModelClient
//instance = new ModelClient();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ModelClient
/// </summary>
[Test]
[Fact]
public void ModelClientInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ModelClient
//Assert.IsInstanceOfType<ModelClient> (instance, "variable 'instance' is a ModelClient");
//Assert.IsType<ModelClient> (instance, "variable 'instance' is a ModelClient");
}
/// <summary>
/// Test the property '__Client'
/// </summary>
[Test]
[Fact]
public void __ClientTest()
{
// TODO unit test for the property '__Client'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,24 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class NameTests
{
// TODO uncomment below to declare an instance variable for Name
//private Name instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Name
//instance = new Name();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Name
/// </summary>
[Test]
[Fact]
public void NameInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Name
//Assert.IsInstanceOfType<Name> (instance, "variable 'instance' is a Name");
//Assert.IsType<Name> (instance, "variable 'instance' is a Name");
}
/// <summary>
/// Test the property '_Name'
/// </summary>
[Test]
[Fact]
public void _NameTest()
{
// TODO unit test for the property '_Name'
@ -77,7 +55,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'SnakeCase'
/// </summary>
[Test]
[Fact]
public void SnakeCaseTest()
{
// TODO unit test for the property 'SnakeCase'
@ -85,7 +63,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Property'
/// </summary>
[Test]
[Fact]
public void PropertyTest()
{
// TODO unit test for the property 'Property'
@ -93,7 +71,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property '_123Number'
/// </summary>
[Test]
[Fact]
public void _123NumberTest()
{
// TODO unit test for the property '_123Number'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class NumberOnlyTests
{
// TODO uncomment below to declare an instance variable for NumberOnly
//private NumberOnly instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of NumberOnly
//instance = new NumberOnly();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of NumberOnly
/// </summary>
[Test]
[Fact]
public void NumberOnlyInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" NumberOnly
//Assert.IsInstanceOfType<NumberOnly> (instance, "variable 'instance' is a NumberOnly");
//Assert.IsType<NumberOnly> (instance, "variable 'instance' is a NumberOnly");
}
/// <summary>
/// Test the property 'JustNumber'
/// </summary>
[Test]
[Fact]
public void JustNumberTest()
{
// TODO unit test for the property 'JustNumber'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,24 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class OrderTests
{
// TODO uncomment below to declare an instance variable for Order
//private Order instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Order
//instance = new Order();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Order
/// </summary>
[Test]
[Fact]
public void OrderInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Order
//Assert.IsInstanceOfType<Order> (instance, "variable 'instance' is a Order");
//Assert.IsType<Order> (instance, "variable 'instance' is a Order");
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
@ -77,7 +55,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'PetId'
/// </summary>
[Test]
[Fact]
public void PetIdTest()
{
// TODO unit test for the property 'PetId'
@ -85,7 +63,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Quantity'
/// </summary>
[Test]
[Fact]
public void QuantityTest()
{
// TODO unit test for the property 'Quantity'
@ -93,7 +71,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ShipDate'
/// </summary>
[Test]
[Fact]
public void ShipDateTest()
{
// TODO unit test for the property 'ShipDate'
@ -101,7 +79,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Status'
/// </summary>
[Test]
[Fact]
public void StatusTest()
{
// TODO unit test for the property 'Status'
@ -109,7 +87,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Test]
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class OuterCompositeTests
{
// TODO uncomment below to declare an instance variable for OuterComposite
//private OuterComposite instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of OuterComposite
//instance = new OuterComposite();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of OuterComposite
/// </summary>
[Test]
[Fact]
public void OuterCompositeInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" OuterComposite
//Assert.IsInstanceOfType<OuterComposite> (instance, "variable 'instance' is a OuterComposite");
//Assert.IsType<OuterComposite> (instance, "variable 'instance' is a OuterComposite");
}
/// <summary>
/// Test the property 'MyNumber'
/// </summary>
[Test]
[Fact]
public void MyNumberTest()
{
// TODO unit test for the property 'MyNumber'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'MyString'
/// </summary>
[Test]
[Fact]
public void MyStringTest()
{
// TODO unit test for the property 'MyString'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'MyBoolean'
/// </summary>
[Test]
[Fact]
public void MyBooleanTest()
{
// TODO unit test for the property 'MyBoolean'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,39 +30,17 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class OuterEnumTests
{
// TODO uncomment below to declare an instance variable for OuterEnum
//private OuterEnum instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of OuterEnum
//instance = new OuterEnum();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of OuterEnum
/// </summary>
[Test]
[Fact]
public void OuterEnumInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" OuterEnum
//Assert.IsInstanceOfType<OuterEnum> (instance, "variable 'instance' is a OuterEnum");
//Assert.IsType<OuterEnum> (instance, "variable 'instance' is a OuterEnum");
}

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,47 +30,27 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class PetTests
{
//private Pet instance;
private long petId = 11088;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Pet
//instance = new Pet();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Pet
/// </summary>
[Test]
[Fact]
public void PetInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Pet
//Assert.IsInstanceOfType<Pet> (instance, "variable 'instance' is a Pet");
//Assert.IsType<Pet> (instance, "variable 'instance' is a Pet");
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
@ -78,7 +58,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Category'
/// </summary>
[Test]
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
@ -86,7 +66,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'
@ -94,7 +74,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'PhotoUrls'
/// </summary>
[Test]
[Fact]
public void PhotoUrlsTest()
{
// TODO unit test for the property 'PhotoUrls'
@ -102,7 +82,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Tags'
/// </summary>
[Test]
[Fact]
public void TagsTest()
{
// TODO unit test for the property 'Tags'
@ -110,7 +90,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Status'
/// </summary>
[Test]
[Fact]
public void StatusTest()
{
// TODO unit test for the property 'Status'
@ -119,18 +99,18 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test serialization
/// </summary>
[Test()]
[Fact]
public void TestSerialization()
{
// create pet
Pet p1 = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
Assert.AreEqual("{\"name\":\"Csharp test\",\"photoUrls\":[\"http://petstore.com/csharp_test\"]}", JsonConvert.SerializeObject(p1));
Assert.Equal("{\"name\":\"Csharp test\",\"photoUrls\":[\"http://petstore.com/csharp_test\"]}", JsonConvert.SerializeObject(p1));
}
/// <summary>
/// Test Equal
/// </summary>
[Test()]
[Fact]
public void TestEqual()
{
// create pet
@ -172,23 +152,23 @@ namespace Org.OpenAPITools.Test
p2.PhotoUrls = photoUrls2;
// p1 and p2 should be equal (both object and attribute level)
Assert.IsTrue(category1.Equals(category2));
Assert.IsTrue(tags1.SequenceEqual(tags2));
Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.True(category1.Equals(category2));
Assert.True(tags1.SequenceEqual(tags2));
Assert.True(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.IsTrue(p1.Equals(p2));
Assert.True(p1.Equals(p2));
// update attribute to that p1 and p2 are not equal
category2.Name = "new category name";
Assert.IsFalse(category1.Equals(category2));
Assert.False(category1.Equals(category2));
tags2 = new List<Tag>();
Assert.IsFalse(tags1.SequenceEqual(tags2));
Assert.False(tags1.SequenceEqual(tags2));
// photoUrls has not changed so it should be equal
Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.True(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.IsFalse(p1.Equals(p2));
Assert.False(p1.Equals(p2));
}
}

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ReadOnlyFirstTests
{
// TODO uncomment below to declare an instance variable for ReadOnlyFirst
//private ReadOnlyFirst instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of ReadOnlyFirst
//instance = new ReadOnlyFirst();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of ReadOnlyFirst
/// </summary>
[Test]
[Fact]
public void ReadOnlyFirstInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" ReadOnlyFirst
//Assert.IsInstanceOfType<ReadOnlyFirst> (instance, "variable 'instance' is a ReadOnlyFirst");
//Assert.IsType<ReadOnlyFirst> (instance, "variable 'instance' is a ReadOnlyFirst");
}
/// <summary>
/// Test the property 'Bar'
/// </summary>
[Test]
[Fact]
public void BarTest()
{
// TODO unit test for the property 'Bar'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Baz'
/// </summary>
[Test]
[Fact]
public void BazTest()
{
// TODO unit test for the property 'Baz'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class ReturnTests
{
// TODO uncomment below to declare an instance variable for Return
//private Return instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Return
//instance = new Return();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Return
/// </summary>
[Test]
[Fact]
public void ReturnInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Return
//Assert.IsInstanceOfType<Return> (instance, "variable 'instance' is a Return");
//Assert.IsType<Return> (instance, "variable 'instance' is a Return");
}
/// <summary>
/// Test the property '_Return'
/// </summary>
[Test]
[Fact]
public void _ReturnTest()
{
// TODO unit test for the property '_Return'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class SpecialModelNameTests
{
// TODO uncomment below to declare an instance variable for SpecialModelName
//private SpecialModelName instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of SpecialModelName
//instance = new SpecialModelName();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of SpecialModelName
/// </summary>
[Test]
[Fact]
public void SpecialModelNameInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" SpecialModelName
//Assert.IsInstanceOfType<SpecialModelName> (instance, "variable 'instance' is a SpecialModelName");
//Assert.IsType<SpecialModelName> (instance, "variable 'instance' is a SpecialModelName");
}
/// <summary>
/// Test the property 'SpecialPropertyName'
/// </summary>
[Test]
[Fact]
public void SpecialPropertyNameTest()
{
// TODO unit test for the property 'SpecialPropertyName'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,39 +30,16 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class StringBooleanMapTests
{
// TODO uncomment below to declare an instance variable for StringBooleanMap
//private StringBooleanMap instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of StringBooleanMap
//instance = new StringBooleanMap();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of StringBooleanMap
/// </summary>
[Test]
[Fact]
public void StringBooleanMapInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" StringBooleanMap
//Assert.IsInstanceOfType<StringBooleanMap> (instance, "variable 'instance' is a StringBooleanMap");
//Assert.IsType<StringBooleanMap> (instance, "variable 'instance' is a StringBooleanMap");
}

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class TagTests
{
// TODO uncomment below to declare an instance variable for Tag
//private Tag instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Tag
//instance = new Tag();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Tag
/// </summary>
[Test]
[Fact]
public void TagInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Tag
//Assert.IsInstanceOfType<Tag> (instance, "variable 'instance' is a Tag");
//Assert.IsType<Tag> (instance, "variable 'instance' is a Tag");
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class TypeHolderDefaultTests
{
// TODO uncomment below to declare an instance variable for TypeHolderDefault
//private TypeHolderDefault instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of TypeHolderDefault
//instance = new TypeHolderDefault();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of TypeHolderDefault
/// </summary>
[Test]
[Fact]
public void TypeHolderDefaultInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" TypeHolderDefault
//Assert.IsInstanceOfType<TypeHolderDefault> (instance, "variable 'instance' is a TypeHolderDefault");
//Assert.IsType<TypeHolderDefault> (instance, "variable 'instance' is a TypeHolderDefault");
}
/// <summary>
/// Test the property 'StringItem'
/// </summary>
[Test]
[Fact]
public void StringItemTest()
{
// TODO unit test for the property 'StringItem'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'NumberItem'
/// </summary>
[Test]
[Fact]
public void NumberItemTest()
{
// TODO unit test for the property 'NumberItem'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'IntegerItem'
/// </summary>
[Test]
[Fact]
public void IntegerItemTest()
{
// TODO unit test for the property 'IntegerItem'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'BoolItem'
/// </summary>
[Test]
[Fact]
public void BoolItemTest()
{
// TODO unit test for the property 'BoolItem'
@ -101,7 +78,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ArrayItem'
/// </summary>
[Test]
[Fact]
public void ArrayItemTest()
{
// TODO unit test for the property 'ArrayItem'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class TypeHolderExampleTests
{
// TODO uncomment below to declare an instance variable for TypeHolderExample
//private TypeHolderExample instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of TypeHolderExample
//instance = new TypeHolderExample();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of TypeHolderExample
/// </summary>
[Test]
[Fact]
public void TypeHolderExampleInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" TypeHolderExample
//Assert.IsInstanceOfType<TypeHolderExample> (instance, "variable 'instance' is a TypeHolderExample");
//Assert.IsType<TypeHolderExample> (instance, "variable 'instance' is a TypeHolderExample");
}
/// <summary>
/// Test the property 'StringItem'
/// </summary>
[Test]
[Fact]
public void StringItemTest()
{
// TODO unit test for the property 'StringItem'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'NumberItem'
/// </summary>
[Test]
[Fact]
public void NumberItemTest()
{
// TODO unit test for the property 'NumberItem'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'IntegerItem'
/// </summary>
[Test]
[Fact]
public void IntegerItemTest()
{
// TODO unit test for the property 'IntegerItem'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'BoolItem'
/// </summary>
[Test]
[Fact]
public void BoolItemTest()
{
// TODO unit test for the property 'BoolItem'
@ -101,7 +78,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'ArrayItem'
/// </summary>
[Test]
[Fact]
public void ArrayItemTest()
{
// TODO unit test for the property 'ArrayItem'

View File

@ -9,7 +9,7 @@
*/
using NUnit.Framework;
using Xunit;
using System;
using System.Linq;
@ -30,46 +30,23 @@ namespace Org.OpenAPITools.Test
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class UserTests
{
// TODO uncomment below to declare an instance variable for User
//private User instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of User
//instance = new User();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of User
/// </summary>
[Test]
[Fact]
public void UserInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" User
//Assert.IsInstanceOfType<User> (instance, "variable 'instance' is a User");
//Assert.IsType<User> (instance, "variable 'instance' is a User");
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
@ -77,7 +54,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Username'
/// </summary>
[Test]
[Fact]
public void UsernameTest()
{
// TODO unit test for the property 'Username'
@ -85,7 +62,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'FirstName'
/// </summary>
[Test]
[Fact]
public void FirstNameTest()
{
// TODO unit test for the property 'FirstName'
@ -93,7 +70,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'LastName'
/// </summary>
[Test]
[Fact]
public void LastNameTest()
{
// TODO unit test for the property 'LastName'
@ -101,7 +78,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Email'
/// </summary>
[Test]
[Fact]
public void EmailTest()
{
// TODO unit test for the property 'Email'
@ -109,7 +86,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Password'
/// </summary>
[Test]
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
@ -117,7 +94,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'Phone'
/// </summary>
[Test]
[Fact]
public void PhoneTest()
{
// TODO unit test for the property 'Phone'
@ -125,7 +102,7 @@ namespace Org.OpenAPITools.Test
/// <summary>
/// Test the property 'UserStatus'
/// </summary>
[Test]
[Fact]
public void UserStatusTest()
{
// TODO unit test for the property 'UserStatus'

View File

@ -0,0 +1,281 @@
/*
* OpenAPI 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
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing XmlItem
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class XmlItemTests
{
/// <summary>
/// Test an instance of XmlItem
/// </summary>
[Fact]
public void XmlItemInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" XmlItem
//Assert.IsType<XmlItem> (instance, "variable 'instance' is a XmlItem");
}
/// <summary>
/// Test the property 'AttributeString'
/// </summary>
[Fact]
public void AttributeStringTest()
{
// TODO unit test for the property 'AttributeString'
}
/// <summary>
/// Test the property 'AttributeNumber'
/// </summary>
[Fact]
public void AttributeNumberTest()
{
// TODO unit test for the property 'AttributeNumber'
}
/// <summary>
/// Test the property 'AttributeInteger'
/// </summary>
[Fact]
public void AttributeIntegerTest()
{
// TODO unit test for the property 'AttributeInteger'
}
/// <summary>
/// Test the property 'AttributeBoolean'
/// </summary>
[Fact]
public void AttributeBooleanTest()
{
// TODO unit test for the property 'AttributeBoolean'
}
/// <summary>
/// Test the property 'WrappedArray'
/// </summary>
[Fact]
public void WrappedArrayTest()
{
// TODO unit test for the property 'WrappedArray'
}
/// <summary>
/// Test the property 'NameString'
/// </summary>
[Fact]
public void NameStringTest()
{
// TODO unit test for the property 'NameString'
}
/// <summary>
/// Test the property 'NameNumber'
/// </summary>
[Fact]
public void NameNumberTest()
{
// TODO unit test for the property 'NameNumber'
}
/// <summary>
/// Test the property 'NameInteger'
/// </summary>
[Fact]
public void NameIntegerTest()
{
// TODO unit test for the property 'NameInteger'
}
/// <summary>
/// Test the property 'NameBoolean'
/// </summary>
[Fact]
public void NameBooleanTest()
{
// TODO unit test for the property 'NameBoolean'
}
/// <summary>
/// Test the property 'NameArray'
/// </summary>
[Fact]
public void NameArrayTest()
{
// TODO unit test for the property 'NameArray'
}
/// <summary>
/// Test the property 'NameWrappedArray'
/// </summary>
[Fact]
public void NameWrappedArrayTest()
{
// TODO unit test for the property 'NameWrappedArray'
}
/// <summary>
/// Test the property 'PrefixString'
/// </summary>
[Fact]
public void PrefixStringTest()
{
// TODO unit test for the property 'PrefixString'
}
/// <summary>
/// Test the property 'PrefixNumber'
/// </summary>
[Fact]
public void PrefixNumberTest()
{
// TODO unit test for the property 'PrefixNumber'
}
/// <summary>
/// Test the property 'PrefixInteger'
/// </summary>
[Fact]
public void PrefixIntegerTest()
{
// TODO unit test for the property 'PrefixInteger'
}
/// <summary>
/// Test the property 'PrefixBoolean'
/// </summary>
[Fact]
public void PrefixBooleanTest()
{
// TODO unit test for the property 'PrefixBoolean'
}
/// <summary>
/// Test the property 'PrefixArray'
/// </summary>
[Fact]
public void PrefixArrayTest()
{
// TODO unit test for the property 'PrefixArray'
}
/// <summary>
/// Test the property 'PrefixWrappedArray'
/// </summary>
[Fact]
public void PrefixWrappedArrayTest()
{
// TODO unit test for the property 'PrefixWrappedArray'
}
/// <summary>
/// Test the property 'NamespaceString'
/// </summary>
[Fact]
public void NamespaceStringTest()
{
// TODO unit test for the property 'NamespaceString'
}
/// <summary>
/// Test the property 'NamespaceNumber'
/// </summary>
[Fact]
public void NamespaceNumberTest()
{
// TODO unit test for the property 'NamespaceNumber'
}
/// <summary>
/// Test the property 'NamespaceInteger'
/// </summary>
[Fact]
public void NamespaceIntegerTest()
{
// TODO unit test for the property 'NamespaceInteger'
}
/// <summary>
/// Test the property 'NamespaceBoolean'
/// </summary>
[Fact]
public void NamespaceBooleanTest()
{
// TODO unit test for the property 'NamespaceBoolean'
}
/// <summary>
/// Test the property 'NamespaceArray'
/// </summary>
[Fact]
public void NamespaceArrayTest()
{
// TODO unit test for the property 'NamespaceArray'
}
/// <summary>
/// Test the property 'NamespaceWrappedArray'
/// </summary>
[Fact]
public void NamespaceWrappedArrayTest()
{
// TODO unit test for the property 'NamespaceWrappedArray'
}
/// <summary>
/// Test the property 'PrefixNsString'
/// </summary>
[Fact]
public void PrefixNsStringTest()
{
// TODO unit test for the property 'PrefixNsString'
}
/// <summary>
/// Test the property 'PrefixNsNumber'
/// </summary>
[Fact]
public void PrefixNsNumberTest()
{
// TODO unit test for the property 'PrefixNsNumber'
}
/// <summary>
/// Test the property 'PrefixNsInteger'
/// </summary>
[Fact]
public void PrefixNsIntegerTest()
{
// TODO unit test for the property 'PrefixNsInteger'
}
/// <summary>
/// Test the property 'PrefixNsBoolean'
/// </summary>
[Fact]
public void PrefixNsBooleanTest()
{
// TODO unit test for the property 'PrefixNsBoolean'
}
/// <summary>
/// Test the property 'PrefixNsArray'
/// </summary>
[Fact]
public void PrefixNsArrayTest()
{
// TODO unit test for the property 'PrefixNsArray'
}
/// <summary>
/// Test the property 'PrefixNsWrappedArray'
/// </summary>
[Fact]
public void PrefixNsWrappedArrayTest()
{
// TODO unit test for the property 'PrefixNsWrappedArray'
}
}
}

View File

@ -7,85 +7,30 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
OpenAPI spec version: 1.0.0
-->
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{19F1DEBC-DE5E-4517-8062-F000CD499087}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Org.OpenAPITools.Test</RootNamespace>
<AssemblyName>Org.OpenAPITools.Test</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="obj\**" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
<Project>{321C8C3F-0156-40C1-AE42-D59761FB9B6C}</Project>
<Name>Org.OpenAPITools</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="linux-logo.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
</Project>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="RestSharp" version="106.5.4" targetFramework="net452" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net452" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="net452" developmentDependency="true" />
</packages>

View File

@ -28,6 +28,27 @@ namespace Org.OpenAPITools.Api
{
#region Synchronous Operations
/// <summary>
/// creates an XmlItem
/// </summary>
/// <remarks>
/// this route creates an XmlItem
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns></returns>
void CreateXmlItem (XmlItem xmlItem);
/// <summary>
/// creates an XmlItem
/// </summary>
/// <remarks>
/// this route creates an XmlItem
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateXmlItemWithHttpInfo (XmlItem xmlItem);
/// <summary>
///
/// </summary>
/// <remarks>
@ -343,6 +364,27 @@ namespace Org.OpenAPITools.Api
{
#region Asynchronous Operations
/// <summary>
/// creates an XmlItem
/// </summary>
/// <remarks>
/// this route creates an XmlItem
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem);
/// <summary>
/// creates an XmlItem
/// </summary>
/// <remarks>
/// this route creates an XmlItem
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem);
/// <summary>
///
/// </summary>
/// <remarks>
@ -768,6 +810,128 @@ namespace Org.OpenAPITools.Api
set { _exceptionFactory = value; }
}
/// <summary>
/// creates an XmlItem this route creates an XmlItem
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns></returns>
public void CreateXmlItem (XmlItem xmlItem)
{
CreateXmlItemWithHttpInfo(xmlItem);
}
/// <summary>
/// creates an XmlItem this route creates an XmlItem
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> CreateXmlItemWithHttpInfo (XmlItem xmlItem)
{
// verify the required parameter 'xmlItem' is set
if (xmlItem == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
String[] @contentTypes = new String[] {
"application/xml",
"application/xml; charset=utf-8",
"application/xml; charset=utf-16",
"text/xml",
"text/xml; charset=utf-8",
"text/xml; charset=utf-16"
};
// to determine the Accept header
String[] @accepts = new String[] {
};
var localVarConentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(@contentTypes);
if (localVarConentType != null) requestOptions.HeaderParameters.Add("Content-Type", localVarConentType);
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts);
if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept);
requestOptions.Data = xmlItem;
// make the HTTP request
var response = this.Client.Post<Object>("/fake/create_xml_item", requestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception exception = this.ExceptionFactory("CreateXmlItem", response);
if (exception != null) throw exception;
}
return response;
}
/// <summary>
/// creates an XmlItem this route creates an XmlItem
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem)
{
await CreateXmlItemAsyncWithHttpInfo(xmlItem);
}
/// <summary>
/// creates an XmlItem this route creates an XmlItem
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="xmlItem">XmlItem Body</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem)
{
// verify the required parameter 'xmlItem' is set
if (xmlItem == null)
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem");
Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions();
String[] @contentTypes = new String[] {
"application/xml",
"application/xml; charset=utf-8",
"application/xml; charset=utf-16",
"text/xml",
"text/xml; charset=utf-8",
"text/xml; charset=utf-16"
};
// to determine the Accept header
String[] @accepts = new String[] {
};
foreach (var contentType in @contentTypes)
requestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in @accepts)
requestOptions.HeaderParameters.Add("Accept", accept);
requestOptions.Data = xmlItem;
// make the HTTP request
var response = await this.AsynchronousClient.PostAsync<Object>("/fake/create_xml_item", requestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception exception = this.ExceptionFactory("CreateXmlItem", response);
if (exception != null) throw exception;
}
return response;
}
/// <summary>
/// Test serialization of outer boolean types
/// </summary>

View File

@ -16,7 +16,6 @@ using System.Globalization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.IO;
using System.Web;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;

View File

@ -55,11 +55,7 @@ namespace Org.OpenAPITools.Client
string.Format("Error calling {0}: {1}", methodName, response.Content),
response.Content);
}
if (status == 0)
{
return new ApiException(status,
string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText);
}
return null;
};
@ -330,8 +326,7 @@ namespace Org.OpenAPITools.Client
public static String ToDebugReport()
{
String report = "C# SDK (Org.OpenAPITools) Debug Report:\n";
report += " OS: " + System.Environment.OSVersion + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n";
report += " Version of the API: 1.0.0\n";
report += " SDK Package Version: 1.0.0\n";

View File

@ -34,6 +34,8 @@ namespace Org.OpenAPITools.Model
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
public partial class Animal : IEquatable<Animal>, IValidatableObject
{
/// <summary>

View File

@ -0,0 +1,426 @@
/*
* OpenAPI 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
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// XmlItem
/// </summary>
[DataContract]
public partial class XmlItem : IEquatable<XmlItem>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="XmlItem" /> class.
/// </summary>
/// <param name="attributeString">attributeString.</param>
/// <param name="attributeNumber">attributeNumber.</param>
/// <param name="attributeInteger">attributeInteger.</param>
/// <param name="attributeBoolean">attributeBoolean.</param>
/// <param name="wrappedArray">wrappedArray.</param>
/// <param name="nameString">nameString.</param>
/// <param name="nameNumber">nameNumber.</param>
/// <param name="nameInteger">nameInteger.</param>
/// <param name="nameBoolean">nameBoolean.</param>
/// <param name="nameArray">nameArray.</param>
/// <param name="nameWrappedArray">nameWrappedArray.</param>
/// <param name="prefixString">prefixString.</param>
/// <param name="prefixNumber">prefixNumber.</param>
/// <param name="prefixInteger">prefixInteger.</param>
/// <param name="prefixBoolean">prefixBoolean.</param>
/// <param name="prefixArray">prefixArray.</param>
/// <param name="prefixWrappedArray">prefixWrappedArray.</param>
/// <param name="namespaceString">namespaceString.</param>
/// <param name="namespaceNumber">namespaceNumber.</param>
/// <param name="namespaceInteger">namespaceInteger.</param>
/// <param name="namespaceBoolean">namespaceBoolean.</param>
/// <param name="namespaceArray">namespaceArray.</param>
/// <param name="namespaceWrappedArray">namespaceWrappedArray.</param>
/// <param name="prefixNsString">prefixNsString.</param>
/// <param name="prefixNsNumber">prefixNsNumber.</param>
/// <param name="prefixNsInteger">prefixNsInteger.</param>
/// <param name="prefixNsBoolean">prefixNsBoolean.</param>
/// <param name="prefixNsArray">prefixNsArray.</param>
/// <param name="prefixNsWrappedArray">prefixNsWrappedArray.</param>
public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List<int> wrappedArray = default(List<int>), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List<int> nameArray = default(List<int>), List<int> nameWrappedArray = default(List<int>), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List<int> prefixArray = default(List<int>), List<int> prefixWrappedArray = default(List<int>), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List<int> namespaceArray = default(List<int>), List<int> namespaceWrappedArray = default(List<int>), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List<int> prefixNsArray = default(List<int>), List<int> prefixNsWrappedArray = default(List<int>))
{
this.AttributeString = attributeString;
this.AttributeNumber = attributeNumber;
this.AttributeInteger = attributeInteger;
this.AttributeBoolean = attributeBoolean;
this.WrappedArray = wrappedArray;
this.NameString = nameString;
this.NameNumber = nameNumber;
this.NameInteger = nameInteger;
this.NameBoolean = nameBoolean;
this.NameArray = nameArray;
this.NameWrappedArray = nameWrappedArray;
this.PrefixString = prefixString;
this.PrefixNumber = prefixNumber;
this.PrefixInteger = prefixInteger;
this.PrefixBoolean = prefixBoolean;
this.PrefixArray = prefixArray;
this.PrefixWrappedArray = prefixWrappedArray;
this.NamespaceString = namespaceString;
this.NamespaceNumber = namespaceNumber;
this.NamespaceInteger = namespaceInteger;
this.NamespaceBoolean = namespaceBoolean;
this.NamespaceArray = namespaceArray;
this.NamespaceWrappedArray = namespaceWrappedArray;
this.PrefixNsString = prefixNsString;
this.PrefixNsNumber = prefixNsNumber;
this.PrefixNsInteger = prefixNsInteger;
this.PrefixNsBoolean = prefixNsBoolean;
this.PrefixNsArray = prefixNsArray;
this.PrefixNsWrappedArray = prefixNsWrappedArray;
}
/// <summary>
/// Gets or Sets AttributeString
/// </summary>
[DataMember(Name="attribute_string", EmitDefaultValue=false)]
public string AttributeString { get; set; }
/// <summary>
/// Gets or Sets AttributeNumber
/// </summary>
[DataMember(Name="attribute_number", EmitDefaultValue=false)]
public decimal AttributeNumber { get; set; }
/// <summary>
/// Gets or Sets AttributeInteger
/// </summary>
[DataMember(Name="attribute_integer", EmitDefaultValue=false)]
public int AttributeInteger { get; set; }
/// <summary>
/// Gets or Sets AttributeBoolean
/// </summary>
[DataMember(Name="attribute_boolean", EmitDefaultValue=false)]
public bool AttributeBoolean { get; set; }
/// <summary>
/// Gets or Sets WrappedArray
/// </summary>
[DataMember(Name="wrapped_array", EmitDefaultValue=false)]
public List<int> WrappedArray { get; set; }
/// <summary>
/// Gets or Sets NameString
/// </summary>
[DataMember(Name="name_string", EmitDefaultValue=false)]
public string NameString { get; set; }
/// <summary>
/// Gets or Sets NameNumber
/// </summary>
[DataMember(Name="name_number", EmitDefaultValue=false)]
public decimal NameNumber { get; set; }
/// <summary>
/// Gets or Sets NameInteger
/// </summary>
[DataMember(Name="name_integer", EmitDefaultValue=false)]
public int NameInteger { get; set; }
/// <summary>
/// Gets or Sets NameBoolean
/// </summary>
[DataMember(Name="name_boolean", EmitDefaultValue=false)]
public bool NameBoolean { get; set; }
/// <summary>
/// Gets or Sets NameArray
/// </summary>
[DataMember(Name="name_array", EmitDefaultValue=false)]
public List<int> NameArray { get; set; }
/// <summary>
/// Gets or Sets NameWrappedArray
/// </summary>
[DataMember(Name="name_wrapped_array", EmitDefaultValue=false)]
public List<int> NameWrappedArray { get; set; }
/// <summary>
/// Gets or Sets PrefixString
/// </summary>
[DataMember(Name="prefix_string", EmitDefaultValue=false)]
public string PrefixString { get; set; }
/// <summary>
/// Gets or Sets PrefixNumber
/// </summary>
[DataMember(Name="prefix_number", EmitDefaultValue=false)]
public decimal PrefixNumber { get; set; }
/// <summary>
/// Gets or Sets PrefixInteger
/// </summary>
[DataMember(Name="prefix_integer", EmitDefaultValue=false)]
public int PrefixInteger { get; set; }
/// <summary>
/// Gets or Sets PrefixBoolean
/// </summary>
[DataMember(Name="prefix_boolean", EmitDefaultValue=false)]
public bool PrefixBoolean { get; set; }
/// <summary>
/// Gets or Sets PrefixArray
/// </summary>
[DataMember(Name="prefix_array", EmitDefaultValue=false)]
public List<int> PrefixArray { get; set; }
/// <summary>
/// Gets or Sets PrefixWrappedArray
/// </summary>
[DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)]
public List<int> PrefixWrappedArray { get; set; }
/// <summary>
/// Gets or Sets NamespaceString
/// </summary>
[DataMember(Name="namespace_string", EmitDefaultValue=false)]
public string NamespaceString { get; set; }
/// <summary>
/// Gets or Sets NamespaceNumber
/// </summary>
[DataMember(Name="namespace_number", EmitDefaultValue=false)]
public decimal NamespaceNumber { get; set; }
/// <summary>
/// Gets or Sets NamespaceInteger
/// </summary>
[DataMember(Name="namespace_integer", EmitDefaultValue=false)]
public int NamespaceInteger { get; set; }
/// <summary>
/// Gets or Sets NamespaceBoolean
/// </summary>
[DataMember(Name="namespace_boolean", EmitDefaultValue=false)]
public bool NamespaceBoolean { get; set; }
/// <summary>
/// Gets or Sets NamespaceArray
/// </summary>
[DataMember(Name="namespace_array", EmitDefaultValue=false)]
public List<int> NamespaceArray { get; set; }
/// <summary>
/// Gets or Sets NamespaceWrappedArray
/// </summary>
[DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)]
public List<int> NamespaceWrappedArray { get; set; }
/// <summary>
/// Gets or Sets PrefixNsString
/// </summary>
[DataMember(Name="prefix_ns_string", EmitDefaultValue=false)]
public string PrefixNsString { get; set; }
/// <summary>
/// Gets or Sets PrefixNsNumber
/// </summary>
[DataMember(Name="prefix_ns_number", EmitDefaultValue=false)]
public decimal PrefixNsNumber { get; set; }
/// <summary>
/// Gets or Sets PrefixNsInteger
/// </summary>
[DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)]
public int PrefixNsInteger { get; set; }
/// <summary>
/// Gets or Sets PrefixNsBoolean
/// </summary>
[DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)]
public bool PrefixNsBoolean { get; set; }
/// <summary>
/// Gets or Sets PrefixNsArray
/// </summary>
[DataMember(Name="prefix_ns_array", EmitDefaultValue=false)]
public List<int> PrefixNsArray { get; set; }
/// <summary>
/// Gets or Sets PrefixNsWrappedArray
/// </summary>
[DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)]
public List<int> PrefixNsWrappedArray { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class XmlItem {\n");
sb.Append(" AttributeString: ").Append(AttributeString).Append("\n");
sb.Append(" AttributeNumber: ").Append(AttributeNumber).Append("\n");
sb.Append(" AttributeInteger: ").Append(AttributeInteger).Append("\n");
sb.Append(" AttributeBoolean: ").Append(AttributeBoolean).Append("\n");
sb.Append(" WrappedArray: ").Append(WrappedArray).Append("\n");
sb.Append(" NameString: ").Append(NameString).Append("\n");
sb.Append(" NameNumber: ").Append(NameNumber).Append("\n");
sb.Append(" NameInteger: ").Append(NameInteger).Append("\n");
sb.Append(" NameBoolean: ").Append(NameBoolean).Append("\n");
sb.Append(" NameArray: ").Append(NameArray).Append("\n");
sb.Append(" NameWrappedArray: ").Append(NameWrappedArray).Append("\n");
sb.Append(" PrefixString: ").Append(PrefixString).Append("\n");
sb.Append(" PrefixNumber: ").Append(PrefixNumber).Append("\n");
sb.Append(" PrefixInteger: ").Append(PrefixInteger).Append("\n");
sb.Append(" PrefixBoolean: ").Append(PrefixBoolean).Append("\n");
sb.Append(" PrefixArray: ").Append(PrefixArray).Append("\n");
sb.Append(" PrefixWrappedArray: ").Append(PrefixWrappedArray).Append("\n");
sb.Append(" NamespaceString: ").Append(NamespaceString).Append("\n");
sb.Append(" NamespaceNumber: ").Append(NamespaceNumber).Append("\n");
sb.Append(" NamespaceInteger: ").Append(NamespaceInteger).Append("\n");
sb.Append(" NamespaceBoolean: ").Append(NamespaceBoolean).Append("\n");
sb.Append(" NamespaceArray: ").Append(NamespaceArray).Append("\n");
sb.Append(" NamespaceWrappedArray: ").Append(NamespaceWrappedArray).Append("\n");
sb.Append(" PrefixNsString: ").Append(PrefixNsString).Append("\n");
sb.Append(" PrefixNsNumber: ").Append(PrefixNsNumber).Append("\n");
sb.Append(" PrefixNsInteger: ").Append(PrefixNsInteger).Append("\n");
sb.Append(" PrefixNsBoolean: ").Append(PrefixNsBoolean).Append("\n");
sb.Append(" PrefixNsArray: ").Append(PrefixNsArray).Append("\n");
sb.Append(" PrefixNsWrappedArray: ").Append(PrefixNsWrappedArray).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input as XmlItem).AreEqual;
}
/// <summary>
/// Returns true if XmlItem instances are equal
/// </summary>
/// <param name="input">Instance of XmlItem to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(XmlItem input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.AttributeString != null)
hashCode = hashCode * 59 + this.AttributeString.GetHashCode();
if (this.AttributeNumber != null)
hashCode = hashCode * 59 + this.AttributeNumber.GetHashCode();
if (this.AttributeInteger != null)
hashCode = hashCode * 59 + this.AttributeInteger.GetHashCode();
if (this.AttributeBoolean != null)
hashCode = hashCode * 59 + this.AttributeBoolean.GetHashCode();
if (this.WrappedArray != null)
hashCode = hashCode * 59 + this.WrappedArray.GetHashCode();
if (this.NameString != null)
hashCode = hashCode * 59 + this.NameString.GetHashCode();
if (this.NameNumber != null)
hashCode = hashCode * 59 + this.NameNumber.GetHashCode();
if (this.NameInteger != null)
hashCode = hashCode * 59 + this.NameInteger.GetHashCode();
if (this.NameBoolean != null)
hashCode = hashCode * 59 + this.NameBoolean.GetHashCode();
if (this.NameArray != null)
hashCode = hashCode * 59 + this.NameArray.GetHashCode();
if (this.NameWrappedArray != null)
hashCode = hashCode * 59 + this.NameWrappedArray.GetHashCode();
if (this.PrefixString != null)
hashCode = hashCode * 59 + this.PrefixString.GetHashCode();
if (this.PrefixNumber != null)
hashCode = hashCode * 59 + this.PrefixNumber.GetHashCode();
if (this.PrefixInteger != null)
hashCode = hashCode * 59 + this.PrefixInteger.GetHashCode();
if (this.PrefixBoolean != null)
hashCode = hashCode * 59 + this.PrefixBoolean.GetHashCode();
if (this.PrefixArray != null)
hashCode = hashCode * 59 + this.PrefixArray.GetHashCode();
if (this.PrefixWrappedArray != null)
hashCode = hashCode * 59 + this.PrefixWrappedArray.GetHashCode();
if (this.NamespaceString != null)
hashCode = hashCode * 59 + this.NamespaceString.GetHashCode();
if (this.NamespaceNumber != null)
hashCode = hashCode * 59 + this.NamespaceNumber.GetHashCode();
if (this.NamespaceInteger != null)
hashCode = hashCode * 59 + this.NamespaceInteger.GetHashCode();
if (this.NamespaceBoolean != null)
hashCode = hashCode * 59 + this.NamespaceBoolean.GetHashCode();
if (this.NamespaceArray != null)
hashCode = hashCode * 59 + this.NamespaceArray.GetHashCode();
if (this.NamespaceWrappedArray != null)
hashCode = hashCode * 59 + this.NamespaceWrappedArray.GetHashCode();
if (this.PrefixNsString != null)
hashCode = hashCode * 59 + this.PrefixNsString.GetHashCode();
if (this.PrefixNsNumber != null)
hashCode = hashCode * 59 + this.PrefixNsNumber.GetHashCode();
if (this.PrefixNsInteger != null)
hashCode = hashCode * 59 + this.PrefixNsInteger.GetHashCode();
if (this.PrefixNsBoolean != null)
hashCode = hashCode * 59 + this.PrefixNsBoolean.GetHashCode();
if (this.PrefixNsArray != null)
hashCode = hashCode * 59 + this.PrefixNsArray.GetHashCode();
if (this.PrefixNsWrappedArray != null)
hashCode = hashCode * 59 + this.PrefixNsWrappedArray.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -7,9 +7,10 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
OpenAPI spec version: 1.0.0
-->
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{321C8C3F-0156-40C1-AE42-D59761FB9B6C}</ProjectGuid>
@ -17,68 +18,23 @@ OpenAPI spec version: 1.0.0
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Org.OpenAPITools</RootNamespace>
<AssemblyName>Org.OpenAPITools</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<!--<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>-->
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.106.5.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="KellermanSoftware.Compare-NET-Objects">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll</HintPath>
</Reference>
<!-- A reference to the entire .NET Framework is automatically included -->
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs"
Exclude="obj\**" />
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</Project>

View File

@ -27,7 +27,7 @@
<dependency id="NewtonSoft.Json" version="12.0.1" />
<dependency id="JsonSubTypes" version="1.5.1" />
<dependency id="RestSharp" version="106.5.4" />
<dependency id="RestSharp" version="106.6.7" />
</dependencies>
</metadata>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CompareNETObjects" version="4.57.0" targetFramework="net452" developmentDependency="true" />
<package id="RestSharp" version="106.5.4" targetFramework="net452" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.1" targetFramework="net45" developmentDependency="true" />
</packages>

View File

@ -0,0 +1,12 @@
{
"supports": {},
"dependencies": {
"Newtonsoft.Json": "12.0.1",
"CompareNETObjects": "4.57.0",
"JsonSubTypes": "1.5.2",
"RestSharp": "106.6.7"
},
"frameworks": {
"netstandard2.0": {}
}
}

View File

@ -0,0 +1,186 @@
# Ref: https://gist.github.com/kmorcinek/2710267
# Download this file using PowerShell v3 under Windows with the following comand
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
# User-specific files
*.suo
*.user
*.sln.docstates
./nuget
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# OS generated files #
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
modulesbin/
tempbin/
# EPiServer Site file (VPP)
AppData/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# vim
*.txt~
*.swp
*.swo
# svn
.svn
# SQL Server files
**/App_Data/*.mdf
**/App_Data/*.ldf
**/App_Data/*.sdf
#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
# SASS Compiler cache
.sass-cache
# Visual Studio 2014 CTP
**/*.sln.ide

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,27 @@
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}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.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
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,213 @@
# Org.OpenAPITools - the C# library for the OpenAPI 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: \" \\
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.0.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpRefactorClientCodegen
<a name="frameworks-supported"></a>
## Frameworks supported
<a name="dependencies"></a>
## Dependencies
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.5.0 or later
The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
```
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
Install-Package CompareNETObjects
```
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
<a name="installation"></a>
## Installation
Run the following command to generate the DLL
- [Mac/Linux] `/bin/sh build.sh`
- [Windows] `build.bat`
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
```csharp
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
```
<a name="packaging"></a>
## Packaging
A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages.
This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:
```
nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj
```
Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.
<a name="getting-started"></a>
## Getting Started
```csharp
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class Example
{
public void main()
{
var apiInstance = new AnotherFakeApi();
var body = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.Call123TestSpecialTags(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
}
}
}
}
```
<a name="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
<a name="documentation-for-models"></a>
## Documentation for Models
- [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Model.Animal](docs/Animal.md)
- [Model.ApiResponse](docs/ApiResponse.md)
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.Category](docs/Category.md)
- [Model.ClassModel](docs/ClassModel.md)
- [Model.Dog](docs/Dog.md)
- [Model.EnumArrays](docs/EnumArrays.md)
- [Model.EnumClass](docs/EnumClass.md)
- [Model.EnumTest](docs/EnumTest.md)
- [Model.File](docs/File.md)
- [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [Model.FormatTest](docs/FormatTest.md)
- [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [Model.List](docs/List.md)
- [Model.MapTest](docs/MapTest.md)
- [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model.Model200Response](docs/Model200Response.md)
- [Model.ModelClient](docs/ModelClient.md)
- [Model.Name](docs/Name.md)
- [Model.NumberOnly](docs/NumberOnly.md)
- [Model.Order](docs/Order.md)
- [Model.OuterComposite](docs/OuterComposite.md)
- [Model.OuterEnum](docs/OuterEnum.md)
- [Model.Pet](docs/Pet.md)
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.Return](docs/Return.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
- [Model.TypeHolderDefault](docs/TypeHolderDefault.md)
- [Model.TypeHolderExample](docs/TypeHolderExample.md)
- [Model.User](docs/User.md)
- [Model.XmlItem](docs/XmlItem.md)
<a name="documentation-for-authorization"></a>
## Documentation for Authorization
<a name="api_key"></a>
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
<a name="api_key_query"></a>
### api_key_query
- **Type**: API key
- **API key parameter name**: api_key_query
- **Location**: URL query string
<a name="http_basic_test"></a>
### http_basic_test
- **Type**: HTTP basic authentication
<a name="petstore_auth"></a>
### petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- write:pets: modify pets in your account
- read:pets: read your pets

View File

@ -0,0 +1,6 @@
:: Generated by: https://github.com/openapitools/openapi-generator.git
::
@echo off
dotnet build

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Generated by: https://github.com/openapitools/openapi-generator.git
#
for cmd in {dotnet}; do
if ! command -v ${cmd} > /dev/null; then
>&2 echo "This script requires '${cmd}' to be installed."
exit 1
fi
done
dotnet build
if [ $? -ne 0 ]
then
echo "[ERROR] Compilation failed with exit code $?"
exit 1
else
echo "[INFO] dotnet build was successful."
fi

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapProperty** | **Dictionary&lt;string, string&gt;** | | [optional]
**MapOfMapProperty** | **Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,70 @@
# Org.OpenAPITools.Api.AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
<a name="call123testspecialtags"></a>
# **Call123TestSpecialTags**
> ModelClient Call123TestSpecialTags (ModelClient body)
To test special tags
To test special tags and operation ID starting with number
### Example
```csharp
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class Call123TestSpecialTagsExample
{
public void main()
{
var apiInstance = new AnotherFakeApi();
var body = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.Call123TestSpecialTags(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ModelClient**](ModelClient.md)| client model |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Code** | **int** | | [optional]
**Type** | **string** | | [optional]
**Message** | **string** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Some files were not shown because too many files have changed in this diff Show More