WireMock.Net version 1.1.x (#363)

* refactor

* rename api

* -preview-01

* logger

* move

* RandomDataGenerator.Net

* .

* ISettings

* renames...

* refactor CommandlineParser logic

* remove standalone

* Remove Interfaces

* Update tests

* WireMock.Net.StandAlone

* .

* fix

* .

* _settings

* Admin

* WireMock.Net.Abstractions

* fix build

* rename WireMockServer

* fix compile errors
This commit is contained in:
Stef Heyenrath
2019-12-27 16:01:13 +01:00
committed by GitHub
parent 368f0e13ac
commit d971144426
141 changed files with 2550 additions and 2320 deletions

View File

@@ -0,0 +1,18 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Body Model
/// </summary>
public class BodyModel
{
/// <summary>
/// Gets or sets the matcher.
/// </summary>
public MatcherModel Matcher { get; set; }
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public MatcherModel[] Matchers { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// ClientIPModel
/// </summary>
public class ClientIPModel
{
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public MatcherModel[] Matchers { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Cookie Model
/// </summary>
public class CookieModel
{
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public IList<MatcherModel> Matchers { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// EncodingModel
/// </summary>
public class EncodingModel
{
/// <summary>
/// Encoding CodePage
/// </summary>
public int CodePage { get; set; }
/// <summary>
/// Encoding EncodingName
/// </summary>
public string EncodingName { get; set; }
/// <summary>
/// Encoding WebName
/// </summary>
public string WebName { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Fault Model
/// </summary>
public class FaultModel
{
/// <summary>
/// Gets or sets the fault. Can be null, "", NONE, EMPTY_RESPONSE, MALFORMED_RESPONSE_CHUNK or RANDOM_DATA_THEN_CLOSE.
/// </summary>
public string Type { get; set; }
/// <summary>
/// Gets or sets the fault percentage.
/// </summary>
public double? Percentage { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Header Model
/// </summary>
public class HeaderModel
{
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public IList<MatcherModel> Matchers { get; set; }
}
}

View File

@@ -0,0 +1,56 @@
using System;
namespace WireMock.Admin.Mappings
{
/// <summary>
/// MappingModel
/// </summary>
public class MappingModel
{
/// <summary>
/// Gets or sets the unique identifier.
/// </summary>
public Guid? Guid { get; set; }
/// <summary>
/// The unique title.
/// </summary>
public string Title { get; set; }
/// <summary>
/// The priority.
/// </summary>
public int? Priority { get; set; }
/// <summary>
/// The Scenario.
/// </summary>
public string Scenario { get; set; }
/// <summary>
/// Execution state condition for the current mapping.
/// </summary>
public string WhenStateIs { get; set; }
/// <summary>
/// The next state which will be signaled after the current mapping execution.
/// In case the value is null state will not be changed.
/// </summary>
public string SetStateTo { get; set; }
/// <summary>
/// The request model.
/// </summary>
public RequestModel Request { get; set; }
/// <summary>
/// The response model.
/// </summary>
public ResponseModel Response { get; set; }
/// <summary>
/// Saves this mapping as a static mapping file.
/// </summary>
public bool? SaveToFile { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// MatcherModel
/// </summary>
public class MatcherModel
{
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the pattern. Can be a string (default) or an object;
/// </summary>
public object Pattern { get; set; }
/// <summary>
/// Gets or sets the patterns. Can be array of strings (default) or an array of objects;
/// </summary>
public object[] Patterns { get; set; }
/// <summary>
/// Gets or sets the ignore case.
/// </summary>
public bool? IgnoreCase { get; set; }
/// <summary>
/// Reject on match.
/// </summary>
public bool? RejectOnMatch { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Param Model
/// </summary>
public class ParamModel
{
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Defines if the key should be matched using case-ignore.
/// </summary>
public bool? IgnoreCase { get; set; }
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public MatcherModel[] Matchers { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// PathModel
/// </summary>
public class PathModel
{
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public MatcherModel[] Matchers { get; set; }
}
}

View File

@@ -0,0 +1,50 @@
using System.Collections.Generic;
namespace WireMock.Admin.Mappings
{
/// <summary>
/// RequestModel
/// </summary>
public class RequestModel
{
/// <summary>
/// Gets or sets the ClientIP. (Can be a string or a ClientIPModel)
/// </summary>
public object ClientIP { get; set; }
/// <summary>
/// Gets or sets the Path. (Can be a string or a PathModel)
/// </summary>
public object Path { get; set; }
/// <summary>
/// Gets or sets the Url. (Can be a string or a UrlModel)
/// </summary>
public object Url { get; set; }
/// <summary>
/// The methods
/// </summary>
public string[] Methods { get; set; }
/// <summary>
/// Gets or sets the Headers.
/// </summary>
public IList<HeaderModel> Headers { get; set; }
/// <summary>
/// Gets or sets the Cookies.
/// </summary>
public IList<CookieModel> Cookies { get; set; }
/// <summary>
/// Gets or sets the Params.
/// </summary>
public IList<ParamModel> Params { get; set; }
/// <summary>
/// Gets or sets the body.
/// </summary>
public BodyModel Body { get; set; }
}
}

View File

@@ -0,0 +1,100 @@
using System.Collections.Generic;
namespace WireMock.Admin.Mappings
{
/// <summary>
/// ResponseModel
/// </summary>
public class ResponseModel
{
/// <summary>
/// Gets or sets the HTTP status.
/// </summary>
public object StatusCode { get; set; }
/// <summary>
/// Gets or sets the body destination (SameAsSource, String or Bytes).
/// </summary>
public string BodyDestination { get; set; }
/// <summary>
/// Gets or sets the body.
/// </summary>
public string Body { get; set; }
/// <summary>
/// Gets or sets the body (as JSON object).
/// </summary>
public object BodyAsJson { get; set; }
/// <summary>
/// Gets or sets a value indicating whether child objects to be indented according to the Newtonsoft.Json.JsonTextWriter.Indentation and Newtonsoft.Json.JsonTextWriter.IndentChar settings.
/// </summary>
public bool? BodyAsJsonIndented { get; set; }
/// <summary>
/// Gets or sets the body (as bytearray).
/// </summary>
public byte[] BodyAsBytes { get; set; }
/// <summary>
/// Gets or sets the body as a file.
/// </summary>
public string BodyAsFile { get; set; }
/// <summary>
/// Is the body as file cached?
/// </summary>
public bool? BodyAsFileIsCached { get; set; }
/// <summary>
/// Gets or sets the body encoding.
/// </summary>
public EncodingModel BodyEncoding { get; set; }
/// <summary>
/// Use Handlebars transformer.
/// </summary>
public bool? UseTransformer { get; set; }
/// <summary>
/// Use the Handlerbars transformer for the content from the referenced BodyAsFile.
/// </summary>
public bool? UseTransformerForBodyAsFile { get; set; }
/// <summary>
/// Gets or sets the headers.
/// </summary>
public IDictionary<string, object> Headers { get; set; }
/// <summary>
/// Gets or sets the Headers (Raw).
/// </summary>
public string HeadersRaw { get; set; }
/// <summary>
/// Gets or sets the delay in milliseconds.
/// </summary>
public int? Delay { get; set; }
/// <summary>
/// Gets or sets the Proxy URL.
/// </summary>
public string ProxyUrl { get; set; }
/// <summary>
/// The client X509Certificate2 Thumbprint or SubjectName to use.
/// </summary>
public string X509Certificate2ThumbprintOrSubjectName { get; set; }
/// <summary>
/// Gets or sets the fault.
/// </summary>
public FaultModel Fault { get; set; }
/// <summary>
/// Gets or sets the WebProxy settings.
/// </summary>
public WebProxyModel WebProxy { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
namespace WireMock.Admin.Mappings
{
/// <summary>
/// Status
/// </summary>
public class StatusModel
{
/// <summary>
/// The optional guid.
/// </summary>
public Guid? Guid { get; set; }
/// <summary>
/// The status (can also contain the error message).
/// </summary>
public string Status { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// UrlModel
/// </summary>
public class UrlModel
{
/// <summary>
/// Gets or sets the matchers.
/// </summary>
public MatcherModel[] Matchers { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
namespace WireMock.Admin.Mappings
{
/// <summary>
/// WebProxy settings
/// </summary>
public class WebProxyModel
{
/// <summary>
/// A string instance that contains the address of the proxy server.
/// </summary>
public string Address { get; set; }
/// <summary>
/// The user name associated with the credentials.
/// </summary>
public string UserName { get; set; }
/// <summary>
/// The password for the user name associated with the credentials.
/// </summary>
public string Password { get; set; }
}
}