Introduced interface on BackOfficeUserManager (#8913)

* Introduced IBackOfficeUserManager

* Fixed test

* Moved class into own file

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
This commit is contained in:
Bjarke Berg
2020-09-22 14:44:41 +02:00
committed by GitHub
parent e6fba11279
commit 0c908a7bbb
15 changed files with 316 additions and 25 deletions

View File

@@ -15,14 +15,14 @@ namespace Umbraco.Tests.Web.Controllers
{
[Test,AutoMoqData]
public void PostUnlockUsers_When_User_Lockout_Update_Fails_Expect_Failure_Response(
[Frozen] IUserStore<BackOfficeIdentityUser> userStore,
[Frozen] IBackOfficeUserManager backOfficeUserManager,
UsersController sut,
BackOfficeIdentityUser user,
int[] userIds,
string expectedMessage)
{
Mock.Get(userStore)
.Setup(x => x.FindByIdAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()))
Mock.Get(backOfficeUserManager)
.Setup(x => x.FindByIdAsync(It.IsAny<string>()))
.ReturnsAsync(user);
Assert.ThrowsAsync<HttpResponseException>(() => sut.PostUnlockUsers(userIds));