From bde981b5224d698501343085c3e289cc4d2e95fe Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sun, 15 Mar 2020 10:17:36 +0000 Subject: [PATCH] .net 472 example (#440) ok --- WireMock.Net Solution.sln | 15 ++++ .../WireMock.Net.Client.Net472/App.config | 6 ++ .../WireMock.Net.Client.Net472/Program.cs | 35 ++++++++ .../Properties/AssemblyInfo.cs | 36 ++++++++ .../WireMock.Net.Client.Net472.csproj | 83 +++++++++++++++++++ .../packages.config | 8 ++ 6 files changed, 183 insertions(+) create mode 100644 examples/WireMock.Net.Client.Net472/App.config create mode 100644 examples/WireMock.Net.Client.Net472/Program.cs create mode 100644 examples/WireMock.Net.Client.Net472/Properties/AssemblyInfo.cs create mode 100644 examples/WireMock.Net.Client.Net472/WireMock.Net.Client.Net472.csproj create mode 100644 examples/WireMock.Net.Client.Net472/packages.config diff --git a/WireMock.Net Solution.sln b/WireMock.Net Solution.sln index 6f8d1af8..5ed85fda 100644 --- a/WireMock.Net Solution.sln +++ b/WireMock.Net Solution.sln @@ -65,6 +65,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.StandAlone", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.RequestLogTest", "examples\WireMock.Net.Console.RequestLogTest\WireMock.Net.Console.RequestLogTest.csproj", "{A9D039B9-7509-4CF1-9EFD-87EB82998575}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Client.Net472", "examples\WireMock.Net.Client.Net472\WireMock.Net.Client.Net472.csproj", "{02082E34-DEF2-47D0-AF0B-3326FAA908CE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug - Sonar|Any CPU = Debug - Sonar|Any CPU @@ -303,6 +305,18 @@ Global {A9D039B9-7509-4CF1-9EFD-87EB82998575}.Release|Any CPU.Build.0 = Release|Any CPU {A9D039B9-7509-4CF1-9EFD-87EB82998575}.Release|x64.ActiveCfg = Release|Any CPU {A9D039B9-7509-4CF1-9EFD-87EB82998575}.Release|x64.Build.0 = Release|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug - Sonar|Any CPU.ActiveCfg = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug - Sonar|Any CPU.Build.0 = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug - Sonar|x64.ActiveCfg = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug - Sonar|x64.Build.0 = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug|x64.ActiveCfg = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Debug|x64.Build.0 = Debug|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Release|Any CPU.Build.0 = Release|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Release|x64.ActiveCfg = Release|Any CPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -327,6 +341,7 @@ Global {B6269AAC-170A-4346-8B9A-579DED3D9A94} = {EF242EDF-7133-4277-9A0C-18744DE08707} {B6269AAC-170A-43D5-8B9A-579DED3D9A95} = {EF242EDF-7133-4277-9A0C-18744DE08707} {A9D039B9-7509-4CF1-9EFD-87EB82998575} = {F0C22C47-DF71-463C-9B04-B4E0F3B8708A} + {02082E34-DEF2-47D0-AF0B-3326FAA908CE} = {F0C22C47-DF71-463C-9B04-B4E0F3B8708A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BF428BCC-C837-433B-87D2-15C7014B73E9} diff --git a/examples/WireMock.Net.Client.Net472/App.config b/examples/WireMock.Net.Client.Net472/App.config new file mode 100644 index 00000000..56efbc7b --- /dev/null +++ b/examples/WireMock.Net.Client.Net472/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/WireMock.Net.Client.Net472/Program.cs b/examples/WireMock.Net.Client.Net472/Program.cs new file mode 100644 index 00000000..73d33f75 --- /dev/null +++ b/examples/WireMock.Net.Client.Net472/Program.cs @@ -0,0 +1,35 @@ +using Newtonsoft.Json; +using RestEase; +using System; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using WireMock.Client; + +namespace WireMock.Net.Client.Net472 +{ + class Program + { + static async Task Main(string[] args) + { + // Create an implementation of the IWireMockAdminApi and pass in the base URL for the API. + var api = RestClient.For("http://localhost:9091"); + + // Set BASIC Auth + var value = Convert.ToBase64String(Encoding.ASCII.GetBytes("a:b")); + api.Authorization = new AuthenticationHeaderValue("Basic", value); + + var settings1 = await api.GetSettingsAsync(); + Console.WriteLine($"settings1 = {JsonConvert.SerializeObject(settings1)}"); + } + } + + //public interface IWireMockAdminApi + //{ + // /// + // /// Authentication header + // /// + // [Header("Authorization")] + // AuthenticationHeaderValue Authorization { get; set; } + //} +} \ No newline at end of file diff --git a/examples/WireMock.Net.Client.Net472/Properties/AssemblyInfo.cs b/examples/WireMock.Net.Client.Net472/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..0be677a9 --- /dev/null +++ b/examples/WireMock.Net.Client.Net472/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("WireMock.Net.Client.Net472")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("mStack.nl")] +[assembly: AssemblyProduct("WireMock.Net.Client.Net472")] +[assembly: AssemblyCopyright("Copyright © mStack.nl 2020")] +[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("02082e34-def2-47d0-af0b-3326faa908ce")] + +// 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/examples/WireMock.Net.Client.Net472/WireMock.Net.Client.Net472.csproj b/examples/WireMock.Net.Client.Net472/WireMock.Net.Client.Net472.csproj new file mode 100644 index 00000000..027ed4da --- /dev/null +++ b/examples/WireMock.Net.Client.Net472/WireMock.Net.Client.Net472.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {02082E34-DEF2-47D0-AF0B-3326FAA908CE} + Exe + WireMock.Net.Client.Net472 + WireMock.Net.Client.Net472 + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + false + + + + + + + + ..\..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\..\packages\RestEase.1.4.10\lib\net45\RestEase.dll + + + + + + + + + + + + ..\..\packages\WireMock.Net.Abstractions.1.2.0\lib\net45\WireMock.Net.Abstractions.dll + + + ..\..\packages\WireMock.Net.RestClient.1.2.0\lib\net45\WireMock.Net.RestClient.dll + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/examples/WireMock.Net.Client.Net472/packages.config b/examples/WireMock.Net.Client.Net472/packages.config new file mode 100644 index 00000000..85eebf9a --- /dev/null +++ b/examples/WireMock.Net.Client.Net472/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file