# WireMock.Matchers.Request.RequestMatchResult - Coverage Report

# Summary

Class: | WireMock.Matchers.Request.RequestMatchResult
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMatchResult.cs
Covered lines: | 12
Uncovered lines: | 4
Coverable lines: | 16
Total lines: | 82
Line coverage: | 75%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
.ctor() | 1 | 0 | 100 | 100
AddScore(...) | 1 | 0 | 100 | 100
CompareTo(...) | 1 | 0 | 0 | 0

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMatchResult.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Collections.Generic;`
|  | `3` |  | ``
|  | `4` |  | `namespace WireMock.Matchers.Request`
|  | `5` |  | `{`
|  | `6` |  | `/// <summary>`
|  | `7` |  | `/// RequestMatchResult`
|  | `8` |  | `/// </summary>`
|  | `9` |  | `public class RequestMatchResult : IComparable`
|  | `10` |  | `{`
|  | `11` |  | `/// <summary>`
|  | `12` |  | `/// Gets or sets the match-score.`
|  | `13` |  | `/// </summary>`
|  | `14` |  | `/// <value>`
|  | `15` |  | `/// The match-score.`
|  | `16` |  | `/// </value>`
| 859 | `17` |  | `public double TotalScore { get; private set; }`
|  | `18` |  | ``
|  | `19` |  | `/// <summary>`
|  | `20` |  | `/// Gets or sets the total number of matches.`
|  | `21` |  | `/// </summary>`
|  | `22` |  | `/// <value>`
|  | `23` |  | `/// The total number of matches.`
|  | `24` |  | `/// </value>`
| 862 | `25` |  | `public int TotalNumber { get; private set; }`
|  | `26` |  | ``
|  | `27` |  | `/// <summary>`
|  | `28` |  | `/// Gets or sets a value indicating whether this instance is perfect match.`
|  | `29` |  | `/// </summary>`
|  | `30` |  | `/// <value>`
|  | `31` |  | `/// <c>true</c> if this instance is perfect match; otherwise, <c>false</c>.`
|  | `32` |  | `/// </value>`
| 98 | `33` |  | `public bool IsPerfectMatch => Math.Abs(TotalScore - TotalNumber) < MatchScores.Tolerance;`
|  | `34` |  | ``
|  | `35` |  | `/// <summary>`
|  | `36` |  | `/// Gets the match percentage.`
|  | `37` |  | `/// </summary>`
|  | `38` |  | `/// <value>`
|  | `39` |  | `/// The match percentage.`
|  | `40` |  | `/// </value>`
| 3 | `41` |  | `public double AverageTotalScore => TotalNumber == 0 ? 0.0 : TotalScore / TotalNumber;`
|  | `42` |  | ``
|  | `43` |  | `/// <summary>`
|  | `44` |  | `/// Gets the match details.`
|  | `45` |  | `/// </summary>`
| 379 | `46` |  | `public IList<KeyValuePair<Type, double>> MatchDetails { get; }`
|  | `47` |  | ``
|  | `48` |  | `/// <summary>`
|  | `49` |  | `/// Initializes a new instance of the <see cref="RequestMatchResult"/> class.`
|  | `50` |  | `/// </summary>`
| 418 | `51` |  | `public RequestMatchResult() => MatchDetails = new List<KeyValuePair<Type, double>>();`
|  | `52` |  | ``
|  | `53` |  | `/// <summary>`
|  | `54` |  | `/// Adds the score.`
|  | `55` |  | `/// </summary>`
|  | `56` |  | `/// <param name="matcherType">The matcher Type.</param>`
|  | `57` |  | `/// <param name="score">The score.</param>`
|  | `58` |  | `/// <returns>The score.</returns>`
|  | `59` |  | `public double AddScore(Type matcherType, double score)`
| 379 | `60` |  | `{`
| 379 | `61` |  | `TotalScore += score;`
| 379 | `62` |  | `TotalNumber++;`
| 379 | `63` |  | `MatchDetails.Add(new KeyValuePair<Type, double>(matcherType, score));`
|  | `64` |  | ``
| 379 | `65` |  | `return score;`
| 379 | `66` |  | `}`
|  | `67` |  | ``
|  | `68` |  | `/// <summary>`
|  | `69` |  | `/// Compares the current instance with another object of the same type and returns an integer that indicates whe`
|  | `70` |  | `/// </summary>`
|  | `71` |  | `/// <param name="obj">An object to compare with this instance.</param>`
|  | `72` |  | `/// <returns>`
|  | `73` |  | `/// A value that indicates the relative order of the objects being compared. The return value has these meanings`
|  | `74` |  | `/// </returns>`
|  | `75` |  | `public int CompareTo(object obj)`
| 0 | `76` |  | `{`
| 0 | `77` |  | `var compareObj = (RequestMatchResult)obj;`
|  | `78` |  | ``
| 0 | `79` |  | `return compareObj.AverageTotalScore.CompareTo(AverageTotalScore);`
| 0 | `80` |  | `}`
|  | `81` |  | `}`
|  | `82` |  | `}`

# Methods/Properties

TotalScore()
TotalScore(System.Double)
TotalNumber()
TotalNumber(System.Int32)
IsPerfectMatch()
AverageTotalScore()
MatchDetails()
.ctor()
AddScore(System.Type,System.Double)
CompareTo(System.Object)