# Summary

Class: | WireMock.Matchers.MatchScores
Assembly: | WireMock.Net
File(s): | C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\MatchScores.cs
Covered lines: | 11
Uncovered lines: | 0
Coverable lines: | 11
Total lines: | 58
Line coverage: | 100%
Branch coverage: | 100%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
ToScore(...) | 3 | 2 | 100 | 100
ToScore(...) | 1 | 0 | 100 | 100
ToScore(...) | 1 | 0 | 100 | 100

# File(s)

## C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\MatchScores.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Generic;`
|  | `2` |  | `using System.Linq;`
|  | `3` |  | ``
|  | `4` |  | `namespace WireMock.Matchers`
|  | `5` |  | `{`
|  | `6` |  | `/// <summary>`
|  | `7` |  | `/// MatchScores`
|  | `8` |  | `/// </summary>`
|  | `9` |  | `public static class MatchScores`
|  | `10` |  | `{`
|  | `11` |  | `/// <summary>`
|  | `12` |  | `/// The tolerance`
|  | `13` |  | `/// </summary>`
|  | `14` |  | `public const double Tolerance = 0.0001;`
|  | `15` |  | ``
|  | `16` |  | `/// <summary>`
|  | `17` |  | `/// The default mismatch score`
|  | `18` |  | `/// </summary>`
|  | `19` |  | `public const double Mismatch = 0.0;`
|  | `20` |  | ``
|  | `21` |  | `/// <summary>`
|  | `22` |  | `/// The default perfect match score`
|  | `23` |  | `/// </summary>`
|  | `24` |  | `public const double Perfect = 1.0;`
|  | `25` |  | ``
|  | `26` |  | `/// <summary>`
|  | `27` |  | `/// Convert a bool to the score.`
|  | `28` |  | `/// </summary>`
|  | `29` |  | `/// <param name="value">if set to <c>true</c> [value].</param>`
|  | `30` |  | `/// <returns>score</returns>`
|  | `31` |  | `public static double ToScore(bool value)`
| 88 | `32` |  | `{`
| 88 | `33` |  | `return value ? Perfect : Mismatch;`
| 88 | `34` |  | `}`
|  | `35` |  | ``
|  | `36` |  | `/// <summary>`
|  | `37` |  | `/// Calculates the score from multiple funcs.`
|  | `38` |  | `/// </summary>`
|  | `39` |  | `/// <param name="values">The values.</param>`
|  | `40` |  | `/// <returns>score</returns>`
|  | `41` |  | `public static double ToScore(IEnumerable<bool> values)`
| 67 | `42` |  | `{`
| 67 | `43` |  | `var list = values.Select(ToScore).ToList();`
| 67 | `44` |  | `return list.Sum() / list.Count;`
| 67 | `45` |  | `}`
|  | `46` |  | ``
|  | `47` |  | `/// <summary>`
|  | `48` |  | `/// Calculates the score from multiple funcs.`
|  | `49` |  | `/// </summary>`
|  | `50` |  | `/// <param name="values">The values.</param>`
|  | `51` |  | `/// <returns>score</returns>`
|  | `52` |  | `public static double ToScore(IEnumerable<double> values)`
| 4 | `53` |  | `{`
| 4 | `54` |  | `var list = values.ToList();`
| 4 | `55` |  | `return list.Sum() / list.Count;`
| 4 | `56` |  | `}`
|  | `57` |  | `}`
|  | `58` |  | `}`

# Methods/Properties

ToScore(System.Boolean)
ToScore(System.Collections.Generic.IEnumerable`1<System.Boolean>)
ToScore(System.Collections.Generic.IEnumerable`1<System.Double>)