Fixed issue with same Mapping Guid (#73)

This commit is contained in:
Stef Heyenrath
2017-12-20 20:51:51 +01:00
parent d0fc889f42
commit 71196b51c9
4 changed files with 24 additions and 20 deletions

View File

@@ -117,20 +117,24 @@ namespace WireMock.Net.Tests
var guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05");
_server = FluentMockServer.Start();
_server.Given(Request.Create().WithPath("/1").UsingGet())
var response1 = Response.Create().WithStatusCode(500);
_server.Given(Request.Create().UsingGet())
.WithGuid(guid)
.RespondWith(Response.Create().WithStatusCode(500));
.RespondWith(response1);
var mappings = _server.Mappings.ToArray();
Check.That(mappings).HasSize(1);
Check.That(mappings.First().Guid).Equals(guid);
var mappings1 = _server.Mappings.ToArray();
Check.That(mappings1).HasSize(1);
Check.That(mappings1.First().Guid).Equals(guid);
var response2 = Response.Create().WithStatusCode(400);
_server.Given(Request.Create().WithPath("/2").UsingGet())
.WithGuid(guid)
.RespondWith(Response.Create().WithStatusCode(500));
.RespondWith(response2);
Check.That(mappings).HasSize(1);
Check.That(mappings.First().Guid).Equals(guid);
var mappings2 = _server.Mappings.ToArray();
Check.That(mappings2).HasSize(1);
Check.That(mappings2.First().Guid).Equals(guid);
Check.That(mappings2.First().Provider).Equals(response2);
}
[Fact]