diff --git a/WireMock.Net Solution.sln b/WireMock.Net Solution.sln index 1b15f224..4941fe24 100644 --- a/WireMock.Net Solution.sln +++ b/WireMock.Net Solution.sln @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WireMock", "src\WireMock.Net\WireMock.Net.xproj", "{D3804228-91F4-4502-9595-39584E5A01AD}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WireMock.Net", "src\WireMock.Net\WireMock.Net.xproj", "{D3804228-91F4-4502-9595-39584E5A01AD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{F0C22C47-DF71-463C-9B04-B4E0F3B8708A}" EndProject @@ -28,6 +28,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Tests", "test\ {D3804228-91F4-4502-9595-39584E5A01AD} = {D3804228-91F4-4502-9595-39584E5A01AD} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.StandAlone", "src\WireMock.Net.StandAlone\WireMock.Net.StandAlone.csproj", "{668F689E-57B4-422E-8846-C0FF643CA999}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -46,6 +48,10 @@ Global {D8B56D28-33CE-4BEF-97D4-7DD546E37F25}.Debug|Any CPU.Build.0 = Debug|Any CPU {D8B56D28-33CE-4BEF-97D4-7DD546E37F25}.Release|Any CPU.ActiveCfg = Release|Any CPU {D8B56D28-33CE-4BEF-97D4-7DD546E37F25}.Release|Any CPU.Build.0 = Release|Any CPU + {668F689E-57B4-422E-8846-C0FF643CA999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {668F689E-57B4-422E-8846-C0FF643CA999}.Debug|Any CPU.Build.0 = Debug|Any CPU + {668F689E-57B4-422E-8846-C0FF643CA999}.Release|Any CPU.ActiveCfg = Release|Any CPU + {668F689E-57B4-422E-8846-C0FF643CA999}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -54,5 +60,6 @@ Global {D3804228-91F4-4502-9595-39584E5A01AD} = {EF242EDF-7133-4277-9A0C-18744DE08707} {668F689E-57B4-422E-8846-C0FF643CA268} = {F0C22C47-DF71-463C-9B04-B4E0F3B8708A} {D8B56D28-33CE-4BEF-97D4-7DD546E37F25} = {890A1DED-C229-4FA1-969E-AAC3BBFC05E5} + {668F689E-57B4-422E-8846-C0FF643CA999} = {EF242EDF-7133-4277-9A0C-18744DE08707} EndGlobalSection EndGlobal diff --git a/WireMock.Net-Logo.ico b/WireMock.Net-Logo.ico new file mode 100644 index 00000000..e80c6d73 Binary files /dev/null and b/WireMock.Net-Logo.ico differ diff --git a/examples/WireMock.Net.ConsoleApplication/Properties/AssemblyInfo.cs b/examples/WireMock.Net.ConsoleApplication/Properties/AssemblyInfo.cs index 5b156822..e22f1147 100644 --- a/examples/WireMock.Net.ConsoleApplication/Properties/AssemblyInfo.cs +++ b/examples/WireMock.Net.ConsoleApplication/Properties/AssemblyInfo.cs @@ -4,11 +4,11 @@ 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("Mock4Net.Core.ConsoleApplication")] +[assembly: AssemblyTitle("WireMock.Net.ConsoleApplication")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Mock4Net.Core.ConsoleApplication")] +[assembly: AssemblyProduct("WireMock.Net.ConsoleApplication")] [assembly: AssemblyCopyright("Copyright © Stef Heyenrath 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/examples/WireMock.Net.ConsoleApplication/WireMock.Net.ConsoleApplication.csproj b/examples/WireMock.Net.ConsoleApplication/WireMock.Net.ConsoleApplication.csproj index 03c13115..e0ca6dfb 100644 --- a/examples/WireMock.Net.ConsoleApplication/WireMock.Net.ConsoleApplication.csproj +++ b/examples/WireMock.Net.ConsoleApplication/WireMock.Net.ConsoleApplication.csproj @@ -32,6 +32,9 @@ prompt 4 + + ..\..\WireMock.Net-Logo.ico + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/WireMock.Net.StandAlone/Program.cs b/src/WireMock.Net.StandAlone/Program.cs new file mode 100644 index 00000000..843bc436 --- /dev/null +++ b/src/WireMock.Net.StandAlone/Program.cs @@ -0,0 +1,47 @@ +using System; +using CommandLineParser.Arguments; +using CommandLineParser.Exceptions; +using WireMock.Server; + +namespace WireMock.Net.StandAlone +{ + public class Program + { + private class Options + { + [ValueArgument(typeof(string), 'u', "Urls", Description = "URL(s) to listen on", Optional = false, AllowMultiple = true)] + public string[] Urls; + + [SwitchArgument('p', "AllowPartialMapping", true, Description = "Allow Partial Mapping (default set to true)", Optional = true)] + public bool AllowPartialMapping; + } + + static void Main(params string[] args) + { + var options = new Options(); + var parser = new CommandLineParser.CommandLineParser(); + parser.ExtractArgumentAttributes(options); + parser.ParseCommandLine(args); + + try + { + parser.ParseCommandLine(args); + + var server = FluentMockServer.StartWithAdminInterface(options.Urls); + + if (options.AllowPartialMapping) + server.AllowPartialMapping(); + + Console.WriteLine("WireMock.Net server listening at {0}", string.Join(" and ", server.Urls)); + } + catch (CommandLineException e) + { + Console.WriteLine(e.Message); + parser.ShowUsage(); + } + + Console.WriteLine("Press any key to stop the server"); + Console.ReadKey(); + } + } +} \ No newline at end of file diff --git a/src/WireMock.Net.StandAlone/Properties/AssemblyInfo.cs b/src/WireMock.Net.StandAlone/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..9cd8e0c8 --- /dev/null +++ b/src/WireMock.Net.StandAlone/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +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.StandAlone")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WireMock.Net.StandAlone")] +[assembly: AssemblyCopyright("Copyright © Stef Heyenrath 2017")] +[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("668f689e-57b4-422e-8846-c0ff643ca999")] + +// 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/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj new file mode 100644 index 00000000..5f1a35ac --- /dev/null +++ b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj @@ -0,0 +1,73 @@ + + + + + Debug + AnyCPU + {668F689E-57B4-422E-8846-C0FF643CA999} + Exe + Properties + WireMock.Net.StandAlone + WireMock.Net.StandAlone + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + ..\..\WireMock.Net-Logo.ico + + + + ..\..\packages\CommandLineArgumentsParser.3.0.4\lib\net452\CommandLineArgumentsParser.dll + True + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\..\packages\SimMetrics.Net.1.0.1.0\lib\net45\SimMetrics.Net.dll + True + + + + + ..\..\src\WireMock.Net\bin\$(Configuration)\net45\WireMock.Net.dll + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/WireMock.Net.StandAlone/app.config b/src/WireMock.Net.StandAlone/app.config new file mode 100644 index 00000000..8460dd43 --- /dev/null +++ b/src/WireMock.Net.StandAlone/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/WireMock.Net.StandAlone/packages.config b/src/WireMock.Net.StandAlone/packages.config new file mode 100644 index 00000000..85ccfb46 --- /dev/null +++ b/src/WireMock.Net.StandAlone/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file