Partial matching

This commit is contained in:
Stef Heyenrath
2017-02-04 17:30:16 +01:00
parent 9b99a7f26b
commit ec2d105db2
19 changed files with 343 additions and 83 deletions

View File

@@ -30,5 +30,13 @@ namespace WireMock.Admin.Requests
/// The response.
/// </value>
public LogResponseModel Response { get; set; }
/// <summary>
/// Gets or sets the request match result.
/// </summary>
/// <value>
/// The request match result.
/// </value>
public LogRequestMatchModel RequestMatchResult { get; set; }
}
}

View File

@@ -0,0 +1,40 @@
namespace WireMock.Admin.Requests
{
/// <summary>
/// LogRequestMatchModel
/// </summary>
public class LogRequestMatchModel
{
/// <summary>
/// Gets or sets the number of matches.
/// </summary>
/// <value>
/// The number of matches.
/// </value>
public int Matched { get; set; }
/// <summary>
/// Gets or sets the total number of matches.
/// </summary>
/// <value>
/// The total number of matches.
/// </value>
public int Total { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is perfect match.
/// </summary>
/// <value>
/// <c>true</c> if this instance is perfect match; otherwise, <c>false</c>.
/// </value>
public bool IsPerfectMatch => Matched == Total;
/// <summary>
/// Gets the match percentage.
/// </summary>
/// <value>
/// The match percentage.
/// </value>
public double MatchPercentage => Total == 0 ? 100 : 100.0 * Matched / Total;
}
}