diff --git a/WireMock.Net Solution.sln.DotSettings b/WireMock.Net Solution.sln.DotSettings
index 2e1d593a..dadfb7f5 100644
--- a/WireMock.Net Solution.sln.DotSettings
+++ b/WireMock.Net Solution.sln.DotSettings
@@ -15,6 +15,7 @@
True
True
True
+ True
True
True
True
diff --git a/examples/WireMock.Net.Console.Net452.Classic/CustomFileSystemFileHandler.cs b/examples/WireMock.Net.Console.Net452.Classic/CustomFileSystemFileHandler.cs
index aeeefc81..a04adae1 100644
--- a/examples/WireMock.Net.Console.Net452.Classic/CustomFileSystemFileHandler.cs
+++ b/examples/WireMock.Net.Console.Net452.Classic/CustomFileSystemFileHandler.cs
@@ -69,6 +69,12 @@ namespace WireMock.Net.ConsoleApplication
File.WriteAllBytes(AdjustPath(path), bytes);
}
+ public void WriteFile(string folder, string filename, byte[] bytes)
+ {
+ File.WriteAllBytes(Path.Combine(folder, filename), bytes);
+
+ }
+
///
public void DeleteFile(string path)
{
diff --git a/examples/WireMock.Net.Console.Net452.Classic/MainApp.cs b/examples/WireMock.Net.Console.Net452.Classic/MainApp.cs
index bc36cbac..0ad7dfa6 100644
--- a/examples/WireMock.Net.Console.Net452.Classic/MainApp.cs
+++ b/examples/WireMock.Net.Console.Net452.Classic/MainApp.cs
@@ -89,6 +89,8 @@ namespace WireMock.Net.ConsoleApplication
server
.Given(Request.Create().WithPath(p => p.Contains("x")).UsingGet())
.AtPriority(4)
+ .WithTitle("t")
+ .WithDescription("d")
.RespondWith(Response.Create()
.WithStatusCode(200)
.WithHeader("Content-Type", "application/json")
diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs
index 450f77c1..420d95be 100644
--- a/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs
@@ -1,31 +1,30 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
-namespace WireMock.Admin.Mappings
+namespace WireMock.Admin.Mappings;
+
+///
+/// Cookie Model
+///
+[FluentBuilder.AutoGenerateBuilder]
+public class CookieModel
{
///
- /// Cookie Model
+ /// Gets or sets the name.
///
- [FluentBuilder.AutoGenerateBuilder]
- public class CookieModel
- {
- ///
- /// Gets or sets the name.
- ///
- public string Name { get; set; }
+ public string Name { get; set; } = null!;
- ///
- /// Gets or sets the matchers.
- ///
- public IList Matchers { get; set; }
+ ///
+ /// Gets or sets the matchers.
+ ///
+ public IList? Matchers { get; set; }
- ///
- /// Gets or sets the ignore case.
- ///
- public bool? IgnoreCase { get; set; }
+ ///
+ /// Gets or sets the ignore case.
+ ///
+ public bool? IgnoreCase { get; set; }
- ///
- /// Reject on match.
- ///
- public bool? RejectOnMatch { get; set; }
- }
+ ///
+ /// Reject on match.
+ ///
+ public bool? RejectOnMatch { get; set; }
}
\ No newline at end of file
diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs
index 27d967fc..724c11b9 100644
--- a/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
namespace WireMock.Admin.Mappings
{
@@ -11,12 +11,12 @@ namespace WireMock.Admin.Mappings
///
/// Gets or sets the name.
///
- public string Name { get; set; }
+ public string Name { get; set; } = null!;
///
/// Gets or sets the matchers.
///
- public IList Matchers { get; set; }
+ public IList? Matchers { get; set; }
///
/// Gets or sets the ignore case.
diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs
index e889fbc5..e9544e8e 100644
--- a/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs
@@ -24,6 +24,11 @@ namespace WireMock.Admin.Mappings
///
public string Title { get; set; }
+ ///
+ /// The description.
+ ///
+ public string Description { get; set; }
+
///
/// The priority. (A low value means higher priority.)
///
diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/ParamModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/ParamModel.cs
index 5f56a9db..7be363f1 100644
--- a/src/WireMock.Net.Abstractions/Admin/Mappings/ParamModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Mappings/ParamModel.cs
@@ -1,24 +1,23 @@
-namespace WireMock.Admin.Mappings
+namespace WireMock.Admin.Mappings;
+
+///
+/// Param Model
+///
+[FluentBuilder.AutoGenerateBuilder]
+public class ParamModel
{
///
- /// Param Model
+ /// Gets or sets the name.
///
- [FluentBuilder.AutoGenerateBuilder]
- public class ParamModel
- {
- ///
- /// Gets or sets the name.
- ///
- public string Name { get; set; }
+ public string Name { get; set; } = null!;
- ///
- /// Defines if the key should be matched using case-ignore.
- ///
- public bool? IgnoreCase { get; set; }
+ ///
+ /// Defines if the key should be matched using case-ignore.
+ ///
+ public bool? IgnoreCase { get; set; }
- ///
- /// Gets or sets the matchers.
- ///
- public MatcherModel[] Matchers { get; set; }
- }
+ ///
+ /// Gets or sets the matchers.
+ ///
+ public MatcherModel[]? Matchers { get; set; }
}
\ No newline at end of file
diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs
index 1acde2c3..3f396685 100644
--- a/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs
@@ -1,51 +1,50 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
-namespace WireMock.Admin.Mappings
+namespace WireMock.Admin.Mappings;
+
+///
+/// RequestModel
+///
+[FluentBuilder.AutoGenerateBuilder]
+public class RequestModel
{
///
- /// RequestModel
+ /// Gets or sets the ClientIP. (Can be a string or a ClientIPModel)
///
- [FluentBuilder.AutoGenerateBuilder]
- public class RequestModel
- {
- ///
- /// Gets or sets the ClientIP. (Can be a string or a ClientIPModel)
- ///
- public object ClientIP { get; set; }
+ public object? ClientIP { get; set; }
- ///
- /// Gets or sets the Path. (Can be a string or a PathModel)
- ///
- public object Path { get; set; }
+ ///
+ /// Gets or sets the Path. (Can be a string or a PathModel)
+ ///
+ public object? Path { get; set; }
- ///
- /// Gets or sets the Url. (Can be a string or a UrlModel)
- ///
- public object Url { get; set; }
+ ///
+ /// Gets or sets the Url. (Can be a string or a UrlModel)
+ ///
+ public object? Url { get; set; }
- ///
- /// The methods
- ///
- public string[] Methods { get; set; }
+ ///
+ /// The methods
+ ///
+ public string[]? Methods { get; set; }
- ///
- /// Gets or sets the Headers.
- ///
- public IList Headers { get; set; }
+ ///
+ /// Gets or sets the Headers.
+ ///
+ public IList? Headers { get; set; }
- ///
- /// Gets or sets the Cookies.
- ///
- public IList Cookies { get; set; }
+ ///
+ /// Gets or sets the Cookies.
+ ///
+ public IList? Cookies { get; set; }
- ///
- /// Gets or sets the Params.
- ///
- public IList Params { get; set; }
+ ///
+ /// Gets or sets the Params.
+ ///
+ public IList? Params { get; set; }
- ///
- /// Gets or sets the body.
- ///
- public BodyModel Body { get; set; }
- }
+ ///
+ /// Gets or sets the body.
+ ///
+ public BodyModel? Body { get; set; }
}
\ No newline at end of file
diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs
index f9cbc218..40609b7f 100644
--- a/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs
@@ -11,22 +11,22 @@ namespace WireMock.Admin.Mappings
///
/// Gets or sets the HTTP status.
///
- public object StatusCode { get; set; }
+ public object? StatusCode { get; set; }
///
/// Gets or sets the body destination (SameAsSource, String or Bytes).
///
- public string BodyDestination { get; set; }
+ public string? BodyDestination { get; set; }
///
/// Gets or sets the body.
///
- public string Body { get; set; }
+ public string? Body { get; set; }
///
/// Gets or sets the body (as JSON object).
///
- public object BodyAsJson { get; set; }
+ public object? BodyAsJson { get; set; }
///
/// 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.
@@ -36,12 +36,12 @@ namespace WireMock.Admin.Mappings
///
/// Gets or sets the body (as bytearray).
///
- public byte[] BodyAsBytes { get; set; }
+ public byte[]? BodyAsBytes { get; set; }
///
/// Gets or sets the body as a file.
///
- public string BodyAsFile { get; set; }
+ public string? BodyAsFile { get; set; }
///
/// Is the body as file cached?
@@ -51,7 +51,7 @@ namespace WireMock.Admin.Mappings
///
/// Gets or sets the body encoding.
///
- public EncodingModel BodyEncoding { get; set; }
+ public EncodingModel? BodyEncoding { get; set; }
///
/// Use ResponseMessage Transformer.
@@ -61,7 +61,7 @@ namespace WireMock.Admin.Mappings
///
/// Gets the type of the transformer.
///
- public string TransformerType { get; set; }
+ public string? TransformerType { get; set; }
///
/// Use the Handlebars transformer for the content from the referenced BodyAsFile.
@@ -71,17 +71,17 @@ namespace WireMock.Admin.Mappings
///
/// The ReplaceNodeOptions to use when transforming a JSON node.
///
- public string TransformerReplaceNodeOptions { get; set; }
+ public string? TransformerReplaceNodeOptions { get; set; }
///
/// Gets or sets the headers.
///
- public IDictionary Headers { get; set; }
+ public IDictionary? Headers { get; set; }
///
/// Gets or sets the Headers (Raw).
///
- public string HeadersRaw { get; set; }
+ public string? HeadersRaw { get; set; }
///
/// Gets or sets the delay in milliseconds.
@@ -101,21 +101,21 @@ namespace WireMock.Admin.Mappings
///
/// Gets or sets the Proxy URL.
///
- public string ProxyUrl { get; set; }
+ public string? ProxyUrl { get; set; }
///
/// The client X509Certificate2 Thumbprint or SubjectName to use.
///
- public string X509Certificate2ThumbprintOrSubjectName { get; set; }
+ public string? X509Certificate2ThumbprintOrSubjectName { get; set; }
///
/// Gets or sets the fault.
///
- public FaultModel Fault { get; set; }
+ public FaultModel? Fault { get; set; }
///
/// Gets or sets the WebProxy settings.
///
- public WebProxyModel WebProxy { get; set; }
+ public WebProxyModel? WebProxy { get; set; }
}
}
\ No newline at end of file
diff --git a/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs b/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs
index 2a3480e6..ac327fa6 100644
--- a/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs
@@ -1,56 +1,54 @@
-using System;
+using System;
-namespace WireMock.Admin.Requests
+namespace WireMock.Admin.Requests;
+
+///
+/// Request Log Model
+///
+public class LogEntryModel
{
///
- /// Request Log Model
+ /// The unique identifier.
///
- [FluentBuilder.AutoGenerateBuilder]
- public class LogEntryModel
- {
- ///
- /// The unique identifier.
- ///
- public Guid Guid { get; set; }
+ public Guid Guid { get; set; }
- ///
- /// The request.
- ///
- public LogRequestModel Request { get; set; }
+ ///
+ /// The request.
+ ///
+ public LogRequestModel Request { get; set; }
- ///
- /// The response.
- ///
- public LogResponseModel Response { get; set; }
+ ///
+ /// The response.
+ ///
+ public LogResponseModel Response { get; set; }
- ///
- /// The mapping unique identifier.
- ///
- public Guid? MappingGuid { get; set; }
+ ///
+ /// The mapping unique identifier.
+ ///
+ public Guid? MappingGuid { get; set; }
- ///
- /// The mapping unique title.
- ///
- public string MappingTitle { get; set; }
+ ///
+ /// The mapping unique title.
+ ///
+ public string MappingTitle { get; set; }
- ///
- /// The request match result.
- ///
- public LogRequestMatchModel RequestMatchResult { get; set; }
+ ///
+ /// The request match result.
+ ///
+ public LogRequestMatchModel RequestMatchResult { get; set; }
- ///
- /// The partial mapping unique identifier.
- ///
- public Guid? PartialMappingGuid { get; set; }
+ ///
+ /// The partial mapping unique identifier.
+ ///
+ public Guid? PartialMappingGuid { get; set; }
- ///
- /// The partial mapping unique title.
- ///
- public string PartialMappingTitle { get; set; }
+ ///
+ /// The partial mapping unique title.
+ ///
+ public string PartialMappingTitle { get; set; }
- ///
- /// The partial request match result.
- ///
- public LogRequestMatchModel PartialRequestMatchResult { get; set; }
- }
+ ///
+ /// The partial request match result.
+ ///
+ public LogRequestMatchModel PartialRequestMatchResult { get; set; }
}
\ No newline at end of file
diff --git a/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs b/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs
index 8b409c1b..f187867f 100644
--- a/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs
+++ b/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs
@@ -1,51 +1,49 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
-namespace WireMock.Admin.Requests
+namespace WireMock.Admin.Requests;
+
+///
+/// LogRequestMatchModel
+///
+public class LogRequestMatchModel
{
///
- /// LogRequestMatchModel
+ /// Gets or sets the match-score.
///
- [FluentBuilder.AutoGenerateBuilder]
- public class LogRequestMatchModel
- {
- ///
- /// Gets or sets the match-score.
- ///
- ///
- /// The match-score.
- ///
- public double TotalScore { get; set; }
+ ///
+ /// The match-score.
+ ///
+ public double TotalScore { get; set; }
- ///
- /// Gets or sets the total number of matches.
- ///
- ///
- /// The total number of matches.
- ///
- public int TotalNumber { get; set; }
+ ///
+ /// Gets or sets the total number of matches.
+ ///
+ ///
+ /// The total number of matches.
+ ///
+ public int TotalNumber { get; set; }
- ///
- /// Gets or sets a value indicating whether this instance is perfect match.
- ///
- ///
- /// true if this instance is perfect match; otherwise, false.
- ///
- public bool IsPerfectMatch { get; set; }
+ ///
+ /// Gets or sets a value indicating whether this instance is perfect match.
+ ///
+ ///
+ /// true if this instance is perfect match; otherwise, false.
+ ///
+ public bool IsPerfectMatch { get; set; }
- ///
- /// Gets the match percentage.
- ///
- ///
- /// The match percentage.
- ///
- public double AverageTotalScore { get; set; }
+ ///
+ /// Gets the match percentage.
+ ///
+ ///
+ /// The match percentage.
+ ///
+ public double AverageTotalScore { get; set; }
- ///
- /// Gets the match details.
- ///
- ///
- /// The match details.
- ///
- public IList