fix(database): qualify RD21 saves against pinned MariaDB 12.2.2
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using JobTrackerApi.Models;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
|
||||
namespace JobTrackerApi.MariaDb.Tests;
|
||||
|
||||
internal static class TestHostFactory
|
||||
{
|
||||
public static Mock<UserManager<ApplicationUser>> CreateUserManager(ApplicationUser? lookupUser = null)
|
||||
{
|
||||
var manager = new Mock<UserManager<ApplicationUser>>(
|
||||
Mock.Of<IUserStore<ApplicationUser>>(), Options.Create(new IdentityOptions()),
|
||||
new PasswordHasher<ApplicationUser>(), Array.Empty<IUserValidator<ApplicationUser>>(),
|
||||
Array.Empty<IPasswordValidator<ApplicationUser>>(), new UpperInvariantLookupNormalizer(),
|
||||
new IdentityErrorDescriber(), null!, NullLogger<UserManager<ApplicationUser>>.Instance);
|
||||
if (lookupUser is not null)
|
||||
manager.Setup(x => x.FindByIdAsync(It.IsAny<string>()))
|
||||
.ReturnsAsync((string id) => lookupUser.Id == id ? lookupUser : null);
|
||||
return manager;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user