From 6ddf34ce8aa7047591b97182e9da7c7e59e0a11d Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 12 Jun 2016 01:56:31 +0800 Subject: [PATCH] update nunit to 3.2.1 --- .../resources/csharp/TestProject.mustache | 8 +++---- .../main/resources/csharp/api_test.mustache | 3 ++- .../resources/csharp/compile-mono.sh.mustache | 2 +- .../main/resources/csharp/compile.mustache | 2 +- .../main/resources/csharp/model_test.mustache | 7 ++++--- .../resources/csharp/mono_nunit_test.mustache | 14 ++----------- .../csharp/packages_test.config.mustache | 2 +- .../csharp/SwaggerClient/IO.Swagger.sln | 10 ++++----- .../petstore/csharp/SwaggerClient/README.md | 2 +- .../petstore/csharp/SwaggerClient/build.bat | 2 +- .../petstore/csharp/SwaggerClient/build.sh | 2 +- .../csharp/SwaggerClient/mono_nunit_test.sh | 21 +++++++------------ .../IO.Swagger.Test/IO.Swagger.Test.csproj | 18 ++++++++-------- .../src/IO.Swagger.Test/packages.config | 4 ++-- .../src/IO.Swagger/IO.Swagger.csproj | 10 ++++----- .../src/IO.Swagger/packages.config | 2 +- 16 files changed, 47 insertions(+), 62 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache b/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache index 07448f9cfef..f01a7e25dbb 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/TestProject.mustache @@ -83,10 +83,10 @@ limitations under the License. {{binRelativePath}}\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll - $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - {{binRelativePath}}\NUnit.2.6.4\lib\nunit.framework.dll + $(SolutionDir)\packages\NUnit.3.2.1\lib\nunit.framework.dll + ..\packages\NUnit.3.2.1\lib\nunit.framework.dll + ..\..\packages\NUnit.3.2.1\lib\nunit.framework.dll + {{binRelativePath}}\NUnit.3.2.1\lib\nunit.framework.dll diff --git a/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache index 84904b8c08b..4a4c2f98952 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache @@ -51,7 +51,8 @@ namespace {{packageName}}.Test [Test] public void {{operationId}}InstanceTest() { - Assert.IsInstanceOf<{{classname}}> (instance, "instance is a {{classname}}"); + // TODO uncomment below to test 'IsInstanceOfType' {{classname}} + Assert.IsInstanceOfType(typeof({{classname}}), instance, "instance is a {{classname}}"); } {{#operations}}{{#operation}} diff --git a/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache index 2d3e96b9677..ea35b5d0b9c 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache @@ -11,7 +11,7 @@ mono nuget.exe install src/{{packageName}}/packages.config -o packages; mkdir -p bin; echo "[INFO] Copy DLLs to the 'bin' folder" -cp packages/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/Newtonsoft.Json.8.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll; echo "[INFO] Run 'mcs' to build bin/{{{packageName}}}.dll" diff --git a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache index 7f6dcfe0713..0164719456a 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache @@ -8,7 +8,7 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient if not exist ".\bin" mkdir bin -copy packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\Newtonsoft.Json.8.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll copy packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll bin\RestSharp.dll %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml diff --git a/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache index 6fcc4672b32..233534a3348 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache @@ -25,7 +25,8 @@ namespace {{packageName}}.Test [TestFixture] public class {{classname}}Tests { - private {{classname}} instance; + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; /// /// Setup before each test @@ -52,8 +53,8 @@ namespace {{packageName}}.Test [Test] public void {{classname}}InstanceTest() { - // TODO uncomment below to test "IsInstanceOf" {{classname}} - //Assert.IsInstanceOf<{{classname}}> (instance, "variable 'instance' is a {{classname}}"); + // TODO uncomment below to test "IsInstanceOfType" {{classname}} + //Assert.IsInstanceOfType<{{classname}}> (instance, "variable 'instance' is a {{classname}}"); } {{#vars}} diff --git a/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache index 32eabefe317..52daa1c5063 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/mono_nunit_test.mustache @@ -10,19 +10,9 @@ wget -nc https://nuget.org/nuget.exe mozroots --import --sync mono nuget.exe install src/{{{packageName}}}.Test/packages.config -o packages -echo "[INFO] Copy DLLs to the 'bin' folder" -# for project {{{packageName}}} -cp packages/Newtonsoft.Json.8.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll src/{{{packageName}}}/bin/Debug/Newtonsoft.Json.dll -cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll src/{{{packageName}}}/bin/Debug/RestSharp.dll -cp packages/NUnit.2.6.4/lib/nunit.framework.dll src/{{{packageName}}}/bin/Debug/nunit.framework.dll -# for project {{{packageName}}}.Test -cp packages/Newtonsoft.Json.8.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll src/{{{packageName}}}.Test/bin/Debug/Newtonsoft.Json.dll -cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll src/{{{packageName}}}.Test/bin/Debug/RestSharp.dll -cp packages/NUnit.2.6.4/lib/nunit.framework.dll src/{{{packageName}}}.Test/bin/Debug/nunit.framework.dll - echo "[INFO] Install NUnit runners via NuGet" -mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages +mono nuget.exe install NUnit.Runners -Version 3.2.1 -OutputDirectory packages echo "[INFO] Build the solution and run the unit test" xbuild {{{packageName}}}.sln && \ - mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/{{{packageName}}}.Test/bin/debug/{{{packageName}}}.Test.dll + mono ./packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe src/{{{packageName}}}.Test/bin/debug/{{{packageName}}}.Test.dll diff --git a/modules/swagger-codegen/src/main/resources/csharp/packages_test.config.mustache b/modules/swagger-codegen/src/main/resources/csharp/packages_test.config.mustache index 7e6f4575391..95192a480bf 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/packages_test.config.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/packages_test.config.mustache @@ -1,6 +1,6 @@ - + diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln index dc645198f38..6fc67c0bb51 100644 --- a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{7B057377-44BA-47A5-AC6B-70EEB6034E6F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{64A65E8F-EACE-4663-9B82-B565E01CFEAE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{7B057377-44BA-47A5-AC6B-70EEB6034E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{7B057377-44BA-47A5-AC6B-70EEB6034E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU -{7B057377-44BA-47A5-AC6B-70EEB6034E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU -{7B057377-44BA-47A5-AC6B-70EEB6034E6F}.Release|Any CPU.Build.0 = Release|Any CPU +{64A65E8F-EACE-4663-9B82-B565E01CFEAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{64A65E8F-EACE-4663-9B82-B565E01CFEAE}.Debug|Any CPU.Build.0 = Debug|Any CPU +{64A65E8F-EACE-4663-9B82-B565E01CFEAE}.Release|Any CPU.ActiveCfg = Release|Any CPU +{64A65E8F-EACE-4663-9B82-B565E01CFEAE}.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 diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 38d36d71493..8191778b36e 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - API version: 1.0.0 - SDK version: 1.0.0 -- Build date: 2016-06-11T23:10:58.942+08:00 +- Build date: 2016-06-12T01:56:22.092+08:00 - Build package: class io.swagger.codegen.languages.CSharpClientCodegen ## Frameworks supported diff --git a/samples/client/petstore/csharp/SwaggerClient/build.bat b/samples/client/petstore/csharp/SwaggerClient/build.bat index 80a13e48231..b0cdda9c0b2 100644 --- a/samples/client/petstore/csharp/SwaggerClient/build.bat +++ b/samples/client/petstore/csharp/SwaggerClient/build.bat @@ -8,7 +8,7 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient if not exist ".\bin" mkdir bin -copy packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml diff --git a/samples/client/petstore/csharp/SwaggerClient/build.sh b/samples/client/petstore/csharp/SwaggerClient/build.sh index 88180f68398..63cf08bc35c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/build.sh +++ b/samples/client/petstore/csharp/SwaggerClient/build.sh @@ -11,7 +11,7 @@ mono nuget.exe install src/IO.Swagger/packages.config -o packages; mkdir -p bin; echo "[INFO] Copy DLLs to the 'bin' folder" -cp packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll; echo "[INFO] Run 'mcs' to build bin/IO.Swagger.dll" diff --git a/samples/client/petstore/csharp/SwaggerClient/mono_nunit_test.sh b/samples/client/petstore/csharp/SwaggerClient/mono_nunit_test.sh index e2be7882f39..43d93618448 100644 --- a/samples/client/petstore/csharp/SwaggerClient/mono_nunit_test.sh +++ b/samples/client/petstore/csharp/SwaggerClient/mono_nunit_test.sh @@ -1,25 +1,18 @@ #!/usr/bin/env bash -wget -nc https://nuget.org/nuget.exe; +wget -nc https://nuget.org/nuget.exe mozroots --import --sync echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" rm src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll 2> /dev/null echo "[INFO] install NUnit runners via NuGet" -wget -nc https://nuget.org/nuget.exe; +wget -nc https://nuget.org/nuget.exe mozroots --import --sync -mono nuget.exe install src/IO.Swagger.Test/packages.config -o packages; +mono nuget.exe install src/IO.Swagger.Test/packages.config -o packages -echo "[INFO] Copy DLLs to the 'bin' folder" -# for project IO.Swagger -cp packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll src/IO.Swagger/bin/Debug/Newtonsoft.Json.dll -cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll src/IO.Swagger/bin/Debug/RestSharp.dll -cp packages/NUnit.2.6.3/lib/nunit.framework.dll src/IO.Swagger/bin/Debug/nunit.framework.dll -# for project IO.Swagger.Test -cp packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll src/IO.Swagger.Test/bin/Debug/Newtonsoft.Json.dll -cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll src/IO.Swagger.Test/bin/Debug/RestSharp.dll -cp packages/NUnit.2.6.3/lib/nunit.framework.dll src/IO.Swagger.Test/bin/Debug/nunit.framework.dll +echo "[INFO] Install NUnit runners via NuGet" +mono nuget.exe install NUnit.Runners -Version 3.2.1 -OutputDirectory packages -echo "[INFO] build the solution and run the unit test" +echo "[INFO] Build the solution and run the unit test" xbuild IO.Swagger.sln && \ - mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe src/IO.Swagger.Test/bin/debug/IO.Swagger.Test.dll + mono ./packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe src/IO.Swagger.Test/bin/debug/IO.Swagger.Test.dll diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj index 2ba51f5afa6..9f21997895b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -59,10 +59,10 @@ limitations under the License. - $(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll @@ -71,10 +71,10 @@ limitations under the License. ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll - $(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll - ..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll + $(SolutionDir)\packages\NUnit.3.2.1\lib\nunit.framework.dll + ..\packages\NUnit.3.2.1\lib\nunit.framework.dll + ..\..\packages\NUnit.3.2.1\lib\nunit.framework.dll + ..\..\vendor\NUnit.3.2.1\lib\nunit.framework.dll @@ -86,7 +86,7 @@ limitations under the License. - {7B057377-44BA-47A5-AC6B-70EEB6034E6F} + {64A65E8F-EACE-4663-9B82-B565E01CFEAE} IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/packages.config b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/packages.config index a8a3491f63d..317248179b6 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/packages.config +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/packages.config @@ -1,6 +1,6 @@ - + - + diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj index 9164a6b3fb0..844d959bcff 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj @@ -24,7 +24,7 @@ limitations under the License. Debug AnyCPU - {7B057377-44BA-47A5-AC6B-70EEB6034E6F} + {64A65E8F-EACE-4663-9B82-B565E01CFEAE} Library Properties Swagger Library @@ -59,10 +59,10 @@ limitations under the License. - $(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/packages.config b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/packages.config index 91f17cd0819..80f617d6d9f 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/packages.config +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/packages.config @@ -1,5 +1,5 @@ - +