Skip to content

Commit

Permalink
Solved issues #204 #205 #200
Browse files Browse the repository at this point in the history
* Lower priority from Proxy mappings

* Fix codefactor

* extra tests

* #205

* Fix test for linux

* `c:\temp\x.json` fix

* Extra tests

* more tests

* more tests

* codefactor

* #200

* refactor

* refactor

* tests
  • Loading branch information
StefH committed Sep 22, 2018
1 parent 0c25ab4 commit f358f13
Show file tree
Hide file tree
Showing 135 changed files with 12,000 additions and 4,567 deletions.
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ steps:
- script: |
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"wiremock" /d:sonar.organization="stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="**\coverage.opencover.xml"
# Build source, tests and run tests
# Build source, tests and run tests for net452 and netcoreapp2.1 (with coverage)
- script: |
dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration $(buildConfiguration) --framework net452
dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration $(buildConfiguration) --framework netcoreapp2.1 --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
# End SonarScanner
Expand Down
11 changes: 11 additions & 0 deletions build-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build info
For building and running all code in VSCode:

- download nuget.exe from https://www.nuget.org/downloads
- copy nuget.exe to a folder which is listed in the path or just in c:\Windows
- go to the root from this project and run `nuget restore`
- all packages are now restored into the `WireMock.Net\packages` folder

### Note
An example project like `WireMock.Net.Console.Net452.Classic` still shows some red errors in VSCode, but you can just run `dotnet build`.
But you can just execute `.\bin\Debug\WireMock.Net.ConsoleApplication.exe` to run the application
8 changes: 0 additions & 8 deletions examples/WireMock.Net.Console.Net452.Classic/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,4 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
13 changes: 13 additions & 0 deletions examples/WireMock.Net.Console.Net452.Classic/MainApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public static void Run()
.WithHeader("Keep-Alive", "timeout=1, max=1")
);

server
.Given(Request.Create()
.WithPath("/httpbin")
)
.RespondWith(Response.Create()
.WithProxy(new ProxyAndRecordSettings { Url = "http://httpbin.org" })
);

server
.Given(Request.Create()
.UsingGet()
Expand Down Expand Up @@ -140,6 +148,11 @@ public static void Run()
.WithHeader("Content-Type", "application/json")
.WithBodyAsJson(new { result = "data:headers posted with 201" }));

if (!System.IO.File.Exists(@"c:\temp\x.json"))
{
System.IO.File.WriteAllText(@"c:\temp\x.json", "{ \"hello\": \"world\", \"answer\": 42 }");
}

server
.Given(Request.Create().WithPath("/file").UsingGet())
.RespondWith(Response.Create()
Expand Down
Loading

0 comments on commit f358f13

Please sign in to comment.