mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-23 17:41:01 +01:00
Add Port and Url property to WireMockServer (#740)
This commit is contained in:
@@ -38,11 +38,21 @@ namespace WireMock.Server
|
||||
/// </summary>
|
||||
List<int> Ports { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the first port.
|
||||
/// </summary>
|
||||
int Port { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the urls.
|
||||
/// </summary>
|
||||
string[] Urls { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the first url.
|
||||
/// </summary>
|
||||
string Url { get; }
|
||||
|
||||
//ConcurrentDictionary<string, ScenarioState> Scenarios { get; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
using Stef.Validation;
|
||||
using WireMock.Admin.Mappings;
|
||||
using WireMock.Authentication;
|
||||
using WireMock.Exceptions;
|
||||
@@ -18,7 +19,6 @@ using WireMock.RequestBuilders;
|
||||
using WireMock.ResponseProviders;
|
||||
using WireMock.Serialization;
|
||||
using WireMock.Settings;
|
||||
using Stef.Validation;
|
||||
|
||||
namespace WireMock.Server
|
||||
{
|
||||
@@ -40,14 +40,22 @@ namespace WireMock.Server
|
||||
[PublicAPI]
|
||||
public bool IsStarted => _httpServer != null && _httpServer.IsStarted;
|
||||
|
||||
/// <inheritdoc cref="IWireMockServer.Ports" />
|
||||
/// <inheritdoc />
|
||||
[PublicAPI]
|
||||
public List<int> Ports { get; }
|
||||
|
||||
/// <inheritdoc cref="IWireMockServer.Urls" />
|
||||
/// <inheritdoc />
|
||||
[PublicAPI]
|
||||
public int Port => Ports?.FirstOrDefault() ?? default(int);
|
||||
|
||||
/// <inheritdoc />
|
||||
[PublicAPI]
|
||||
public string[] Urls { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[PublicAPI]
|
||||
public string Url => Urls?.FirstOrDefault();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the mappings.
|
||||
/// </summary>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="SimMetrics.Net" Version="1.0.5" />
|
||||
<PackageReference Include="Stef.Validation" Version="0.1.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.17" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.18" />
|
||||
<PackageReference Include="RandomDataGenerator.Net" Version="1.0.14" />
|
||||
<PackageReference Include="JmesPath.Net" Version="1.0.125" />
|
||||
<PackageReference Include="AnyOf" Version="0.3.0" />
|
||||
|
||||
Reference in New Issue
Block a user