public async Task DeleteUserAccountAsyncShouldCallUserManager() { var testAccountRepository = await GetTestAcctRepository(); var testAccountManagementService = new AccountManagementService(this.userManager.Object, this.userRepository.Object, testAccountRepository, this.positionService.Object, this.feePaymentsRepository.Object); await testAccountManagementService.DeleteUserAccountAsync("1", 1); this.userManager.Verify(u => u.RemoveFromRoleAsync(It.IsAny <ApplicationUser>(), It.IsAny <string>()), Times.Once); this.userManager.Verify(u => u.AddToRoleAsync(It.IsAny <ApplicationUser>(), It.IsAny <string>()), Times.Once); }
public async Task DeleteUserAccountAsyncShouldWorkCorrectly() { var testAccountRepository = await GetTestAcctRepository(); var testAccountManagementService = new AccountManagementService(this.userManager.Object, this.userRepository.Object, testAccountRepository, this.positionService.Object, this.feePaymentsRepository.Object); await testAccountManagementService.DeleteUserAccountAsync("1", 1); var account = testAccountRepository .AllWithDeleted() .FirstOrDefault(a => a.Id == 1); Assert.IsTrue(account.IsDeleted); }