mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-11 21:12:16 +01:00
get_routes (#12)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@@ -11,24 +10,6 @@ using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Server;
|
||||
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.ReadabilityRules",
|
||||
"SA1101:PrefixLocalCallsWithThis",
|
||||
Justification = "Reviewed. Suppression is OK here, as it conflicts with internal naming rules.")]
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.NamingRules",
|
||||
"SA1309:FieldNamesMustNotBeginWithUnderscore",
|
||||
Justification = "Reviewed. Suppression is OK here, as it conflicts with internal naming rules.")]
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.DocumentationRules",
|
||||
"SA1600:ElementsMustBeDocumented",
|
||||
Justification = "Reviewed. Suppression is OK here, as it's a tests class.")]
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.DocumentationRules",
|
||||
"SA1633:FileMustHaveHeader",
|
||||
Justification = "Reviewed. Suppression is OK here, as unknown copyright and company.")]
|
||||
// ReSharper disable ArrangeThisQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
namespace WireMock.Net.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
@@ -37,6 +18,24 @@ namespace WireMock.Net.Tests
|
||||
{
|
||||
private FluentMockServer _server;
|
||||
|
||||
[Test]
|
||||
public void FluentMockServer_get_routes()
|
||||
{
|
||||
_server = FluentMockServer.Start();
|
||||
|
||||
_server.Given(Request.Create().WithUrl("/foo1").UsingGet())
|
||||
.RespondWith(Response.Create().WithStatusCode(201).WithBody("1"));
|
||||
|
||||
_server.Given(Request.Create().WithUrl("/foo2").UsingGet())
|
||||
.RespondWith(Response.Create().WithStatusCode(202).WithBody("2"));
|
||||
|
||||
var routes = _server.Routes;
|
||||
|
||||
Check.That(routes).HasSize(2);
|
||||
Check.That(routes.First().RequestMatcher).IsNotNull();
|
||||
Check.That(routes.First().Provider).IsNotNull();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Should_respond_to_request()
|
||||
{
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using NFluent;
|
||||
using NUnit.Framework;
|
||||
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.DocumentationRules",
|
||||
"SA1600:ElementsMustBeDocumented",
|
||||
Justification = "Reviewed. Suppression is OK here, as it's a tests class.")]
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.DocumentationRules",
|
||||
"SA1633:FileMustHaveHeader",
|
||||
Justification = "Reviewed. Suppression is OK here, as unknown copyright and company.")]
|
||||
// ReSharper disable InconsistentNaming
|
||||
namespace WireMock.Net.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
|
||||
Reference in New Issue
Block a user