github
189 of 280 branches covered (67.5%)
Branch coverage included in aggregate %.
2 of 2 new or added lines in 1 file covered. (100.0%)
614 of 727 relevant lines covered (84.46%)
19.43 hits per line
1 |
namespace RepoGovernance.Core.Models |
|
2 |
{ |
|
3 |
public class AzureAppRegistration |
|
4 |
{ |
|
5 |
public string? Name { get; set; } |
128✔ |
6 |
public List<DateTimeOffset?> ExpirationDates { get; set; }
|
96✔ |
7 |
public string ExpirationDateString |
|
8 |
{ |
|
9 |
get |
|
10 |
{ |
9✔ |
11 |
if (ExpirationDate != null)
|
|
12 |
{ |
9✔ |
13 |
return "Expiring on " + ExpirationDate?.ToString("R"); |
|
14 |
} |
|
15 |
else
|
|
16 |
{ |
× |
|
return "No expiration date found"; |
× |
18 |
} |
|
19 |
} |
9✔ |
20 |
} |
|
21 |
public DateTimeOffset? ExpirationDate
|
|
22 |
{ |
|
23 |
get |
|
24 |
{ |
28✔ |
25 |
DateTimeOffset? minDate = null; |
28✔ |
26 |
foreach (DateTimeOffset? item in ExpirationDates) |
|
27 |
{ |
31✔ |
|
if (item != null && (minDate == null || item < minDate))
|
|
29 |
{ |
31✔ |
30 |
minDate = item; |
31✔ |
31 |
} |
31✔ |
32 |
} |
31✔ |
33 |
return minDate;
|
28✔ |
34 |
} |
28✔ |
35 |
} |
|
36 |
|
|
37 |
public AzureAppRegistration()
|
29✔ |
38 |
{ |
29✔ |
39 |
ExpirationDates = new();
|
29✔ |
40 |
} |
29✔ |
41 |
} |
|
42 |
} |