Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Handlebars.Net.Helpers to 2.19 #616

Merged
merged 2 commits into from
Jun 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/WireMock.Net/WireMock.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Handlebars.Net.Helpers" Version="2.1.2" />
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.1.2" />
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.1.2" />
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.1.2" />
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.1.2" />
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.1.2" />
<PackageReference Include="Handlebars.Net.Helpers" Version="2.1.9" />
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.1.9" />
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.1.9" />
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.1.9" />
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.1.9" />
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.1.9" />

<ProjectReference Include="..\WireMock.Net.Abstractions\WireMock.Net.Abstractions.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,6 @@ public async Task Response_ProvideResponseAsync_Handlebars_RegexMatch_NoMatch()
Check.That(response.Message.BodyData.BodyAsString).Equals("");
}

[Fact]
public async Task Response_ProvideResponseAsync_Handlebars_RegexMatch_NoMatch_WithDefaultValue()
{
// Assign
var body = new BodyData { BodyAsString = "abc", DetectedBodyType = BodyType.String };

var request = new RequestMessage(new UrlDetails("http://localhost:1234"), "POST", ClientIp, body);

var responseBuilder = Response.Create()
.WithBody("{{Regex.Match request.body \"^?0$\" \"d\"}}")
.WithTransformer();

// Act
var response = await responseBuilder.ProvideResponseAsync(request, _settings);

// assert
Check.That(response.Message.BodyData.BodyAsString).Equals("d");
}

[Fact]
public async Task Response_ProvideResponseAsync_Handlebars_RegexMatch2()
{
Expand Down Expand Up @@ -122,25 +103,6 @@ public async Task Response_ProvideResponseAsync_Handlebars_RegexMatch2_NoMatch()
Check.That(response.Message.BodyData.BodyAsString).Equals("");
}

[Fact]
public async Task Response_ProvideResponseAsync_Handlebars_RegexMatch2_NoMatch_WithDefaultValue()
{
// Assign
var body = new BodyData { BodyAsString = "{{\\test", DetectedBodyType = BodyType.String };

var request = new RequestMessage(new UrlDetails("http://localhost:1234"), "POST", ClientIp, body);

var responseBuilder = Response.Create()
.WithBody("{{#Regex.Match request.body \"^(?<proto>\\w+)://[^/]+?(?<port>\\d+)/?\" \"x\"}}{{this}}{{/Regex.Match}}")
.WithTransformer();

// Act
var response = await responseBuilder.ProvideResponseAsync(request, _settings);

// assert
Check.That(response.Message.BodyData.BodyAsString).Equals("x");
}

[Fact]
public void Response_ProvideResponseAsync_Handlebars_RegexMatch2_Throws()
{
Expand Down