From 726712350977575ca8f39a7f970f2ab17f9b22c6 Mon Sep 17 00:00:00 2001 From: Nikolas Magno Braga Leite - AeC Date: Wed, 22 Aug 2018 16:56:41 -0300 Subject: [PATCH] Alterando para .netcore --- .vscode/tasks.json | 34 +++++++++-- .../Extension.cs => Extension.cs | 4 +- Package.nuspec | 20 ------- .../WhenResponse.RestSharp.NetCore.csproj | 19 ------- WhenResponse.RestSharp.csproj | 21 +++++++ WhenResponse.RestSharp/Extension.cs | 16 ------ .../Properties/AssemblyInfo.cs | 36 ------------ .../WhenResponse.RestSharp.csproj | 57 ------------------- .../WhenResponse.RestSharp.csproj.nuspec | 19 ------- .../WhenResponse.RestSharp.nuspec | 17 ------ WhenResponse.RestSharp/packages.config | 4 -- WhenResponse.Test/RestSharp.cs | 34 ----------- WhenResponse.Test/WhenResponse.Test.csproj | 20 ------- WhenResponse.sln | 37 ------------ 14 files changed, 51 insertions(+), 287 deletions(-) rename WhenResponse.RestSharp.NetCore/Extension.cs => Extension.cs (81%) delete mode 100644 Package.nuspec delete mode 100644 WhenResponse.RestSharp.NetCore/WhenResponse.RestSharp.NetCore.csproj create mode 100644 WhenResponse.RestSharp.csproj delete mode 100644 WhenResponse.RestSharp/Extension.cs delete mode 100644 WhenResponse.RestSharp/Properties/AssemblyInfo.cs delete mode 100644 WhenResponse.RestSharp/WhenResponse.RestSharp.csproj delete mode 100644 WhenResponse.RestSharp/WhenResponse.RestSharp.csproj.nuspec delete mode 100644 WhenResponse.RestSharp/WhenResponse.RestSharp.nuspec delete mode 100644 WhenResponse.RestSharp/packages.config delete mode 100644 WhenResponse.Test/RestSharp.cs delete mode 100644 WhenResponse.Test/WhenResponse.Test.csproj delete mode 100644 WhenResponse.sln diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9fb30a9..59336c3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,15 +1,37 @@ { + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/WhenResponse.Test/WhenResponse.Test.csproj" - ], + "command": "dotnet build ${workspaceFolder}/", + "type": "shell", + "group": "build", + "presentation": { + "reveal": "silent" + }, "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet publish -c Release ${workspaceFolder}/", + "type": "shell", + "group": "build", + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$msCompile" + }, + { + "label": "pack", + "command": "dotnet pack -c Release ${workspaceFolder}/", + "type": "shell", + "group": "build", + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$msCompile" } ] } \ No newline at end of file diff --git a/WhenResponse.RestSharp.NetCore/Extension.cs b/Extension.cs similarity index 81% rename from WhenResponse.RestSharp.NetCore/Extension.cs rename to Extension.cs index 3345afb..48cc58e 100644 --- a/WhenResponse.RestSharp.NetCore/Extension.cs +++ b/Extension.cs @@ -1,11 +1,11 @@ namespace WhenResponse.RestSharp { - using global::RestSharp; using System; + using global::RestSharp; public static class Extension { - public static IRestResponse When(this IRestResponse response, Func condition, Action action) + public static IRestResponse When(this IRestResponse response, Func condition, Action action) { if (condition(response)) action(response); diff --git a/Package.nuspec b/Package.nuspec deleted file mode 100644 index 344f102..0000000 --- a/Package.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - Package - 1.0.0 - NikolasMagno - NikolasMagno - http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE - http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE - http://ICON_URL_HERE_OR_DELETE_THIS_LINE - false - Package description - Summary of changes made in this release of the package. - Copyright 2018 - Tag1 Tag2 - - - - - \ No newline at end of file diff --git a/WhenResponse.RestSharp.NetCore/WhenResponse.RestSharp.NetCore.csproj b/WhenResponse.RestSharp.NetCore/WhenResponse.RestSharp.NetCore.csproj deleted file mode 100644 index 430c734..0000000 --- a/WhenResponse.RestSharp.NetCore/WhenResponse.RestSharp.NetCore.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - netcoreapp2.0 - true - A simple library to make response treatment clean and fluent -https://github.com/nikolasmagno/WhenResponse - https://github.com/nikolasmagno/WhenResponse - https://github.com/nikolasmagno/WhenResponse - https://github.com/nikolasmagno/WhenResponse - WhenResponse.RestSharp.NetCore - WhenResponse.RestSharp - - - - - - - diff --git a/WhenResponse.RestSharp.csproj b/WhenResponse.RestSharp.csproj new file mode 100644 index 0000000..08812bd --- /dev/null +++ b/WhenResponse.RestSharp.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0;net452 + 2.0.0 + Nikolas Magno + A simple library to make response treatment clean and fluent + false + A NetStandard2 portable + https://creativecommons.org/licenses/by/4.0/ + Rest RestSharp + + + + + + + + + + \ No newline at end of file diff --git a/WhenResponse.RestSharp/Extension.cs b/WhenResponse.RestSharp/Extension.cs deleted file mode 100644 index bbf5119..0000000 --- a/WhenResponse.RestSharp/Extension.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace WhenResponse.RestSharp -{ - using global::RestSharp; - using System; - - public static class Extension - { - public static IRestResponse When(this IRestResponse response, Func condition, Action action) - { - if (condition(response)) - action(response); - - return response; - } - } -} diff --git a/WhenResponse.RestSharp/Properties/AssemblyInfo.cs b/WhenResponse.RestSharp/Properties/AssemblyInfo.cs deleted file mode 100644 index c0832b3..0000000 --- a/WhenResponse.RestSharp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WhenResponse.RestSharp")] -[assembly: AssemblyDescription("A simple library to make response treatment clean and fluent")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("WhenResponse.RestSharp")] -[assembly: AssemblyProduct("WhenResponse.RestSharp")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d8c8681f-c978-47c3-a148-cec7ad05e25b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WhenResponse.RestSharp/WhenResponse.RestSharp.csproj b/WhenResponse.RestSharp/WhenResponse.RestSharp.csproj deleted file mode 100644 index 3c6a574..0000000 --- a/WhenResponse.RestSharp/WhenResponse.RestSharp.csproj +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Debug - AnyCPU - {D8C8681F-C978-47C3-A148-CEC7AD05E25B} - Library - Properties - WhenResponse.RestSharp - WhenResponse.RestSharp - v4.5 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\packages\RestSharp.105.0.0\lib\net4\RestSharp.dll - - - - - - - - - - - - - - - - Designer - - - - \ No newline at end of file diff --git a/WhenResponse.RestSharp/WhenResponse.RestSharp.csproj.nuspec b/WhenResponse.RestSharp/WhenResponse.RestSharp.csproj.nuspec deleted file mode 100644 index 3089b34..0000000 --- a/WhenResponse.RestSharp/WhenResponse.RestSharp.csproj.nuspec +++ /dev/null @@ -1,19 +0,0 @@ - - - - .\WhenResponse.RestSharp\WhenResponse.RestSharp.csproj - 1.0.0 - NikolasMagno - NikolasMagno - https://github.com/nikolasmagno/WhenResponse - https://github.com/nikolasmagno/WhenResponse - false - A simple library to make response treatment clean and fluent - A simple library to make response treatment clean and fluent - Copyright 2018 - Tag1 Tag2 - - - - - \ No newline at end of file diff --git a/WhenResponse.RestSharp/WhenResponse.RestSharp.nuspec b/WhenResponse.RestSharp/WhenResponse.RestSharp.nuspec deleted file mode 100644 index d8d1fa4..0000000 --- a/WhenResponse.RestSharp/WhenResponse.RestSharp.nuspec +++ /dev/null @@ -1,17 +0,0 @@ - - - - $id$ - $version$ - $title$ - Nikolas Magno - Nikolas Magno - https://github.com/nikolasmagno/WhenResponse - https://github.com/nikolasmagno/WhenResponse - false - A simple library to make response treatment clean and fluent - A simple library to make response treatment clean and fluent - Copyright 2018 - Rest RestSharp - - \ No newline at end of file diff --git a/WhenResponse.RestSharp/packages.config b/WhenResponse.RestSharp/packages.config deleted file mode 100644 index 1f09a7e..0000000 --- a/WhenResponse.RestSharp/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/WhenResponse.Test/RestSharp.cs b/WhenResponse.Test/RestSharp.cs deleted file mode 100644 index bd85967..0000000 --- a/WhenResponse.Test/RestSharp.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace WhenResponse.Test -{ - using global::RestSharp; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using WhenResponse.RestSharp; - using System.Net; - - [TestClass] - public class RestSharp - { - [TestMethod] - public void Ok() - { - var client = new RestClient("https://jsonplaceholder.typicode.com/"); - var request = new RestRequest("posts/1", Method.GET); - - // execute the request - IRestResponse response = client.Execute(request); - response.When((r)=> r.StatusCode != HttpStatusCode.OK,(r)=> Assert.Fail("Waiting status code OK")); - } - - [TestMethod] - public void Random() - { - var client = new RestClient("https://httpstat.us/"); - var request = new RestRequest("202?sleep=2000", Method.GET); - - // execute the request - IRestResponse response = client.Execute(request); - response.When((r)=> r.StatusCode != HttpStatusCode.Accepted,(r)=> Assert.Fail("Waiting status code Accepted")) - .When((r)=> r.StatusCode == HttpStatusCode.Accepted,(r)=> System.Console.WriteLine("Accepted")); - } - } -} diff --git a/WhenResponse.Test/WhenResponse.Test.csproj b/WhenResponse.Test/WhenResponse.Test.csproj deleted file mode 100644 index 46b87bc..0000000 --- a/WhenResponse.Test/WhenResponse.Test.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp2.0 - - false - - - - - - - - - - - - - - diff --git a/WhenResponse.sln b/WhenResponse.sln deleted file mode 100644 index 112a8ee..0000000 --- a/WhenResponse.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2037 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WhenResponse.Test", "WhenResponse.Test\WhenResponse.Test.csproj", "{654BC4A8-087F-4700-BE52-1FAD94C58399}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WhenResponse.RestSharp.NetCore", "WhenResponse.RestSharp.NetCore\WhenResponse.RestSharp.NetCore.csproj", "{34BB1CD5-E19A-402E-B552-DAFB9A94B0D9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WhenResponse.RestSharp", "WhenResponse.RestSharp\WhenResponse.RestSharp.csproj", "{D8C8681F-C978-47C3-A148-CEC7AD05E25B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {654BC4A8-087F-4700-BE52-1FAD94C58399}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {654BC4A8-087F-4700-BE52-1FAD94C58399}.Debug|Any CPU.Build.0 = Debug|Any CPU - {654BC4A8-087F-4700-BE52-1FAD94C58399}.Release|Any CPU.ActiveCfg = Release|Any CPU - {654BC4A8-087F-4700-BE52-1FAD94C58399}.Release|Any CPU.Build.0 = Release|Any CPU - {34BB1CD5-E19A-402E-B552-DAFB9A94B0D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34BB1CD5-E19A-402E-B552-DAFB9A94B0D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34BB1CD5-E19A-402E-B552-DAFB9A94B0D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34BB1CD5-E19A-402E-B552-DAFB9A94B0D9}.Release|Any CPU.Build.0 = Release|Any CPU - {D8C8681F-C978-47C3-A148-CEC7AD05E25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8C8681F-C978-47C3-A148-CEC7AD05E25B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8C8681F-C978-47C3-A148-CEC7AD05E25B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8C8681F-C978-47C3-A148-CEC7AD05E25B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {01B6FF3F-71BB-44FB-BE8A-4A4A100FD7D9} - EndGlobalSection -EndGlobal