mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-19 23:41:41 +02:00
add example static .json
This commit is contained in:
@@ -80,6 +80,9 @@
|
|||||||
<None Update="__admin\mappings\00000002-ee28-4f29-ae63-1ac9b0802d87.json">
|
<None Update="__admin\mappings\00000002-ee28-4f29-ae63-1ac9b0802d87.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="__admin\mappings\351f0240-bba0-4bcb-93c6-1feba0fe8799.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="__admin\mappings\array.json">
|
<None Update="__admin\mappings\array.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ namespace WireMock.Net.Tests
|
|||||||
string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings");
|
string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings");
|
||||||
server.ReadStaticMappings(folder);
|
server.ReadStaticMappings(folder);
|
||||||
|
|
||||||
Check.That(server.Mappings).HasSize(5);
|
Check.That(server.Mappings).HasSize(6);
|
||||||
Check.That(server.MappingModels).HasSize(5);
|
Check.That(server.MappingModels).HasSize(6);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
server.ResetMappings();
|
server.ResetMappings();
|
||||||
@@ -218,7 +218,7 @@ namespace WireMock.Net.Tests
|
|||||||
server.ReadStaticMappings(folder);
|
server.ReadStaticMappings(folder);
|
||||||
|
|
||||||
var mappings = server.Mappings.ToArray();
|
var mappings = server.Mappings.ToArray();
|
||||||
Check.That(mappings).HasSize(5);
|
Check.That(mappings).HasSize(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"Guid": "351f0240-bba0-4bcb-93c6-1feba0fe8799",
|
||||||
|
"Title": "Playground",
|
||||||
|
"Request": {
|
||||||
|
"Path": {
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "/playground",
|
||||||
|
"IgnoreCase": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Methods": [
|
||||||
|
"POST"
|
||||||
|
],
|
||||||
|
"Headers": [
|
||||||
|
{
|
||||||
|
"Name": "Content-Type",
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "application/json; charset=utf-8",
|
||||||
|
"IgnoreCase": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "Accept",
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "application/json",
|
||||||
|
"IgnoreCase": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "Authorization",
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "Bearer 4d911614-fa48-484f-b8e6-98674fd73964",
|
||||||
|
"IgnoreCase": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "Content-Length",
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "*",
|
||||||
|
"IgnoreCase": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Body": {
|
||||||
|
"Matcher": {
|
||||||
|
"Name": "JsonMatcher",
|
||||||
|
"Pattern": {},
|
||||||
|
"IgnoreCase": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Response": {
|
||||||
|
"StatusCode": 201,
|
||||||
|
"BodyAsJson": {},
|
||||||
|
"Headers": {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Connection": "keep-alive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user