Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Jun 5, 2021
1 parent 82c152e commit 1eceec9
Showing 1 changed file with 0 additions and 38 deletions.
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:https://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:https://localhost:1234"), "POST", ClientIp, body);

var responseBuilder = Response.Create()
.WithBody("{{#Regex.Match request.body \"^(?<proto>\\w+):https://[^/]+?(?<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

0 comments on commit 1eceec9

Please sign in to comment.