-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial code for proxy and record #27
- Loading branch information
Showing
14 changed files
with
160 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
examples/WireMock.Net.Console.Record.NETCoreApp/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Newtonsoft.Json; | ||
using WireMock.Server; | ||
using WireMock.Settings; | ||
|
||
namespace WireMock.Net.Console.NETCoreApp | ||
{ | ||
static class Program | ||
{ | ||
static void Main(params string[] args) | ||
{ | ||
string url1 = "http://localhost:9095/"; | ||
|
||
var server = FluentMockServer.Start(new FluentMockServerSettings | ||
{ | ||
Urls = new[] { url1 }, | ||
StartAdminInterface = true, | ||
ProxyAndRecordSettings = new ProxyAndRecordSettings { Url = "http://www.bbc.com" } | ||
}); | ||
|
||
System.Console.WriteLine("Press any key to stop the server"); | ||
System.Console.ReadKey(); | ||
server.Stop(); | ||
|
||
System.Console.WriteLine("Displaying all requests"); | ||
var allRequests = server.LogEntries; | ||
System.Console.WriteLine(JsonConvert.SerializeObject(allRequests, Formatting.Indented)); | ||
|
||
System.Console.WriteLine("Press any key to quit"); | ||
System.Console.ReadKey(); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ples/WireMock.Net.Console.Record.NETCoreApp/WireMock.Net.Console.Record.NETCoreApp.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp1.1</TargetFramework> | ||
<ApplicationIcon>../../WireMock.Net-Logo.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CommandLineArgumentsParser" Version="3.0.9" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" /> | ||
<!--<ProjectReference Include="..\WireMock.Net\WireMock.Net.csproj" />--> | ||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace WireMock.Settings | ||
{ | ||
/// <summary> | ||
/// RecordAndSaveSettings | ||
/// </summary> | ||
public class ProxyAndRecordSettings | ||
{ | ||
/// <summary> | ||
/// The URL to proxy. | ||
/// </summary> | ||
public string Url { get; set; } | ||
|
||
/// <summary> | ||
/// Save the mapping for each request/response. | ||
/// </summary> | ||
public bool SaveMapping { get; set; } = true; | ||
} | ||
} |