Netcore: Health check notifier hosted service (#9295)
* Implemented health check notifier as a hosted service. Added validation to health check settings. * Registered health check notifier as a hosted service. Modified health check nested settings to use concrete classes to align with other configuration models. * Resolved issues with email sending using development server. * PR review comments and fixed failing unit test. * Changed period and delay millisecond and hourly values to TimeSpans. Changed configuration of first run time for health check notifications to use H:mm format. * Set up SecureSocketOptions as a locally defined enum. * Tightened up time format validation to verify input is an actual time (with hours and minutes only) and not a timespan. * Aligned naming and namespace of health check configuration related classes with other configuration classes. * Created constants for hex colors used in formatting health check results as HTML. * Revert "Tightened up time format validation to verify input is an actual time (with hours and minutes only) and not a timespan." This reverts commit f9bb8a7a825bcb58146879f18b47922e09453e2d. * Renamed method to be clear validation is of a TimeSpan and not a time. Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -293,14 +293,23 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.ShortStringHelper
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
#region Cases
|
||||
[TestCase("val$id!ate|this|str'ing", "$!'", '-', "val-id-ate|this|str-ing")]
|
||||
[TestCase("val$id!ate|this|str'ing", "$!'", '*', "val*id*ate|this|str*ing")]
|
||||
#endregion
|
||||
public void ReplaceManyByOneChar(string input, string toReplace, char replacement, string expected)
|
||||
{
|
||||
var output = input.ReplaceMany(toReplace.ToArray(), replacement);
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
[TestCase("", false)]
|
||||
[TestCase("12:34", true)]
|
||||
[TestCase("1:14:23", true)]
|
||||
[TestCase("25:03", false)]
|
||||
[TestCase("18:61", false)]
|
||||
public void IsValidTimeSpan(string input, bool expected)
|
||||
{
|
||||
var result = input.IsValidTimeSpan();
|
||||
Assert.AreEqual(expected, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user