github
250 of 331 branches covered (75.53%)
Branch coverage included in aggregate %.
218 of 259 new or added lines in 22 files covered. (84.17%)
3 existing lines in 1 file now uncovered.1529 of 1739 relevant lines covered (87.92%)
19.95 hits per line
1 |
using System.Collections.Generic;
|
|
2 |
using System.Linq;
|
|
3 |
using System.Text;
|
|
4 |
|
|
5 |
namespace Kyameru.Core.Entities
|
|
6 |
{ |
|
7 |
public class RouteConfigComponent |
|
8 |
{ |
|
NEW
|
public string Component { get; set; } |
× |
NEW
|
public string Path { get; set; } |
× |
NEW
|
public Dictionary<string, string> Headers { get; set; } |
× |
12 |
|
|
|
public string Uri { get; set; } |
12✔ |
14 |
|
|
15 |
public override string ToString() |
|
|
{ |
4✔ |
|
if (string.IsNullOrWhiteSpace(Uri)) |
|
NEW
|
{ |
× |
NEW
|
var builder = new StringBuilder();
|
× |
NEW
|
builder.Append($"{Component.ToLower()}///");
|
× |
NEW
|
builder.Append($"{Path}?");
|
× |
NEW
|
var lastHeader = Headers.Last(); |
× |
NEW
|
foreach (var header in Headers.Keys) |
|
NEW
|
{ |
× |
NEW
|
builder.Append($"{header}={Headers[header]}");
|
× |
NEW
|
if (lastHeader.Key != header)
|
|
NEW
|
{ |
× |
NEW
|
builder.Append("&");
|
× |
NEW
|
} |
× |
NEW
|
} |
× |
31 |
|
|
NEW
|
Uri = builder.ToString(); |
× |
NEW
|
} |
× |
34 |
|
|
|
return Uri;
|
4✔ |
|
} |
4✔ |
37 |
} |
|
38 |
} |