Use RandomDataGenerator.Net 1.0.3.0 (#231)

* Include="RandomDataGenerator.Net" Version="1.0.3"

* UndefinedBindingResult
This commit is contained in:
Stef Heyenrath
2018-11-13 09:49:46 +00:00
committed by GitHub
parent ac2ecd112f
commit 18af7a41d4
9 changed files with 220 additions and 50 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using System.Net;
using Newtonsoft.Json;
using WireMock.Logging;
@@ -398,7 +399,23 @@ namespace WireMock.Net.ConsoleApplication
server
.Given(Request.Create().WithPath("/random"))
.RespondWith(Response.Create()
.WithBody("Text:{{Random Type=\"Text\" Min=8 Max=20}}\r\nDateTime:{{Random Type=\"DateTime\"}}\r\nGuid:{{Random Type=\"Guid\" Uppercase=true}}")
.WithHeader("Content-Type", "application/json")
.WithBodyAsJson(new
{
Text = "{{Random Type=\"Text\" Min=8 Max=20}}",
TextLipsum = "{{Random Type=\"TextLipsum\"}}",
TimeSpan1 = "{{Random Type=\"TimeSpan\" Format=\"c\" IncludeMilliseconds=false}}",
TimeSpan2 = "{{Random Type=\"TimeSpan\"}}",
DateTime1 = "{{Random Type=\"DateTime\"}}",
DateTime2 = DateTime.Now,
DateTime3 = DateTime.Now.ToString("s", CultureInfo.InvariantCulture),
Guid1 = "{{Random Type=\"Guid\" Uppercase=false}}",
Guid2 = "{{Random Type=\"Guid\"}}",
Integer1 = "{{Random Type=\"Integer\" Min=1000 Max=9999}}",
Integer2 = "{{#Random Type=\"Integer\" Min=10000000 Max=99999999}}{{this}}{{/Random}}",
Double1 = "{{Random Type=\"Double\" Min=10 Max=99}}",
Double2 = "{{Random Type=\"Double\" Min=100 Max=999}}"
})
.WithTransformer()
);