-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00f92cf
commit 911d100
Showing
11 changed files
with
70 additions
and
55 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
7 changes: 2 additions & 5 deletions
7
...ationTests/ConfigureEngine/CookiesTest.cs → ...tionTests/ConfigureEngine/CookiesTests.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
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
File renamed without changes.
File renamed without changes.
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,42 @@ | ||
using WireMock.RequestBuilders; | ||
using WireMock.ResponseBuilders; | ||
using WireMock.Server; | ||
|
||
namespace CocoCrawler.IntegrationTests; | ||
|
||
internal static class WireMockExtensions | ||
{ | ||
internal static void ReturnSuccessFor(this WireMockServer wireMockServer, string url) | ||
{ | ||
wireMockServer | ||
.Given(Request.Create() | ||
.UsingGet() | ||
.WithUrl(url)) | ||
.RespondWith(Response.Create() | ||
.WithSuccess()); | ||
} | ||
|
||
internal static void ReturnSuccessWithBodyFromFile(this WireMockServer wireMockServer, string url, string filePath) | ||
{ | ||
wireMockServer | ||
.Given(Request.Create() | ||
.UsingGet() | ||
.WithUrl(url)) | ||
.RespondWith(Response.Create() | ||
.WithHeader("Content-Type", "text/xml; charset=utf-8") | ||
.WithSuccess() | ||
.WithBodyFromFile(filePath)); | ||
} | ||
|
||
internal static void ReturnSuccessWithPage(this WireMockServer wireMockServer, string url, string page) | ||
{ | ||
wireMockServer | ||
.Given(Request.Create() | ||
.UsingGet() | ||
.WithUrl(url)) | ||
.RespondWith(Response.Create() | ||
.WithHeader("Content-Type", "text/xml; charset=utf-8") | ||
.WithSuccess() | ||
.WithBody(page)); | ||
} | ||
} |