mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-25 02:41:53 +01:00
Add Random Regex (using Fare) (#236)
* Xeger * update example * 1.0.7 * Fix tests for Handlebars_Xeger * ReplaceNodeValue * 1.0.5 * readme
This commit is contained in:
@@ -34,9 +34,30 @@ namespace WireMock.Net.Tests.ResponseBuilders
|
||||
|
||||
// Assert
|
||||
JObject j = JObject.FromObject(responseMessage.BodyData.BodyAsJson);
|
||||
Check.That(j["Text"]).IsNotNull();
|
||||
Check.That(j["Text"].Value<string>()).IsNotEmpty();
|
||||
Check.That(j["Integer"].Value<int>()).IsEqualTo(1000);
|
||||
Check.That(j["Long"].Value<int>()).IsStrictlyGreaterThan(77777777).And.IsStrictlyLessThan(99999999);
|
||||
Check.That(j["Long"].Value<long>()).IsStrictlyGreaterThan(77777777).And.IsStrictlyLessThan(99999999);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Response_ProvideResponseAsync_Handlebars_Random1_Boolean()
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost:1234"), "GET", ClientIp);
|
||||
|
||||
var response = Response.Create()
|
||||
.WithBodyAsJson(new
|
||||
{
|
||||
Value = "{{Random Type=\"Boolean\"}}"
|
||||
})
|
||||
.WithTransformer();
|
||||
|
||||
// Act
|
||||
var responseMessage = await response.ProvideResponseAsync(request);
|
||||
|
||||
// Assert
|
||||
JObject j = JObject.FromObject(responseMessage.BodyData.BodyAsJson);
|
||||
Check.That(j["Value"].Type).IsEqualTo(JTokenType.Boolean);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user