Moved all UnitTests to a single project. Implemented parts of AspNetCore UnitTests.
This commit is contained in:
@@ -7,6 +7,7 @@ namespace Microsoft.Extensions.Hosting
|
||||
/// Wrapper class to start a background service.
|
||||
/// </summary>
|
||||
/// <typeparam name="TService">The service type.</typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
|
||||
public class BackgroundServiceStarter<TService> : IHostedService
|
||||
where TService : class, IHostedService
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace AMWD.Common.AspNetCore.Utilities
|
||||
public static bool IsDarkColor(string color)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(color))
|
||||
return false;
|
||||
throw new ArgumentNullException(nameof(color));
|
||||
|
||||
int r, g, b;
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace AMWD.Common.AspNetCore.Utilities
|
||||
|
||||
if (rgbMatch.Success)
|
||||
{
|
||||
r = Convert.ToInt32(rgbMatch.Groups[1].Value);
|
||||
g = Convert.ToInt32(rgbMatch.Groups[2].Value);
|
||||
b = Convert.ToInt32(rgbMatch.Groups[3].Value);
|
||||
r = Convert.ToInt32(rgbMatch.Groups[1].Value, 10);
|
||||
g = Convert.ToInt32(rgbMatch.Groups[2].Value, 10);
|
||||
b = Convert.ToInt32(rgbMatch.Groups[3].Value, 10);
|
||||
}
|
||||
else if (hexMatchFull.Success)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ namespace AMWD.Common.AspNetCore.Utilities
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
throw new NotSupportedException($"Unknown color value '{color}'");
|
||||
}
|
||||
|
||||
double luminance = (r * 0.299 + g * 0.587 + b * 0.114) / 255;
|
||||
|
||||
Reference in New Issue
Block a user