-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Showing
7 changed files
with
97 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
https://github.com/StefH/GitHubReleaseNotes | ||
|
||
GitHubReleaseNotes.exe --output CHANGELOG.md --skip-empty-releases --version 1.0.21.0 | ||
GitHubReleaseNotes.exe --output CHANGELOG.md --skip-empty-releases --version 1.0.22.0 |
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
45 changes: 45 additions & 0 deletions
45
test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyFromFileTests.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,45 @@ | ||
using FluentAssertions; | ||
using System.IO; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using WireMock.RequestBuilders; | ||
using WireMock.ResponseBuilders; | ||
using WireMock.Server; | ||
using Xunit; | ||
|
||
namespace WireMock.Net.Tests.ResponseBuilders | ||
{ | ||
public class ResponseWithBodyFromFileTests | ||
{ | ||
[Fact] | ||
public async Task Response_ProvideResponse_WithBodyFromFile() | ||
{ | ||
// Arrange | ||
var server = FluentMockServer.Start(); | ||
|
||
string path = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", "MyXmlResponse.xml"); | ||
|
||
server | ||
.Given( | ||
Request | ||
.Create() | ||
.UsingGet() | ||
.WithPath("/v1/content") | ||
) | ||
.RespondWith( | ||
Response | ||
.Create() | ||
.WithStatusCode(HttpStatusCode.OK) | ||
.WithHeader("Content-Type", "application/xml") | ||
.WithBodyFromFile(path) | ||
); | ||
|
||
// Act | ||
var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content"); | ||
|
||
// Assert | ||
response.Should().Contain("<hello>world</hello>"); | ||
} | ||
} | ||
} |