public async Task ConfirmUserAccountAsyncShouldCallUserManager()
        {
            var context                      = ApplicationDbContextInMemoryFactory.InitializeContext();
            var testUserRepository           = new EfDeletableEntityRepository <ApplicationUser>(context);
            var testNotConfirmedUsers        = TestDataHelpers.GetTestNotConfirmedUsers();
            var testAccountManagementService = new AccountManagementService(this.userManager.Object, testUserRepository, this.accountRepository.Object, this.positionService.Object, this.feePaymentsRepository.Object);

            foreach (var tester in testNotConfirmedUsers)
            {
                await testUserRepository.AddAsync(tester);

                await testUserRepository.SaveChangesAsync();
            }

            var user = new ClientToBeConfirmedViewModel
            {
                UserId     = "11",
                Username   = "******",
                Email      = "[email protected]",
                Balance    = 5000,
                TradeFee   = 50,
                MonthlyFee = 100,
                Notes      = null,
            };

            await testAccountManagementService.ConfirmUserAccountAsync(user);

            this.userManager.Verify(u => u.RemoveFromRoleAsync(It.IsAny <ApplicationUser>(), GlobalConstants.NotConfirmedUserRoleName), Times.Once);
            this.userManager.Verify(u => u.AddToRoleAsync(It.IsAny <ApplicationUser>(), GlobalConstants.ConfirmedUserRoleName), Times.Once);
        }
        public async Task ConfirmUserAccountAsyncWorkCorrectly()
        {
            var context                      = ApplicationDbContextInMemoryFactory.InitializeContext();
            var testUserRepository           = new EfDeletableEntityRepository <ApplicationUser>(context);
            var testNotConfirmedUsers        = TestDataHelpers.GetTestNotConfirmedUsers();
            var testAccountManagementService = new AccountManagementService(this.userManager.Object, testUserRepository, this.accountRepository.Object, this.positionService.Object, this.feePaymentsRepository.Object);

            foreach (var tester in testNotConfirmedUsers)
            {
                await testUserRepository.AddAsync(tester);

                await testUserRepository.SaveChangesAsync();
            }

            var user = new ClientToBeConfirmedViewModel
            {
                UserId     = "11",
                Username   = "******",
                Email      = "[email protected]",
                Balance    = 5000,
                TradeFee   = 50,
                MonthlyFee = 100,
                Notes      = null,
            };

            var testUser = testUserRepository.All().FirstOrDefault(u => u.Id == "11");

            Assert.IsNull(testUser.Account);

            await testAccountManagementService.ConfirmUserAccountAsync(user);

            Assert.IsNotNull(testUser.Account);
        }