public async void BanUserProfile_UserNotFound()
        {
            var store = new Mock <IUserRoleStore <UserProfile> >();

            store.Setup(s => s.FindByIdAsync(It.IsAny <string>(), It.IsAny <CancellationToken>())).ReturnsAsync(() => null);
            store.Setup(s => s.GetRolesAsync(null, It.IsAny <CancellationToken>())).ThrowsAsync(new ArgumentNullException());
            store.Setup(s => s.UpdateAsync(null, It.IsAny <CancellationToken>())).ThrowsAsync(new ArgumentNullException());
            var userManager           = new UserManager <UserProfile>(store.Object, null, null, null, null, null, null, null, null);
            var administrationService = new AdministrationService(null, userManager);

            await Assert.ThrowsAsync(new ArgumentNullException().GetType(), () => administrationService.BanUserProfile(""));
        }
        public async void BanUserProfile_NoChangesForAdmin()
        {
            var testUser = new UserProfile {
                IsBanned = false
            };
            var store = new Mock <IUserRoleStore <UserProfile> >();

            store.Setup(s => s.FindByIdAsync(It.IsAny <string>(), It.IsAny <CancellationToken>())).ReturnsAsync(testUser);
            store.Setup(s => s.GetRolesAsync(It.IsAny <UserProfile>(), It.IsAny <CancellationToken>())).ReturnsAsync(new List <string>()
            {
                "admin"
            });
            store.Setup(s => s.UpdateAsync(It.IsAny <UserProfile>(), It.IsAny <CancellationToken>())).ReturnsAsync(IdentityResult.Success).Callback(() => testUser.IsBanned = true);
            var userManager           = new UserManager <UserProfile>(store.Object, null, null, null, null, null, null, null, null);
            var administrationService = new AdministrationService(null, userManager);

            await administrationService.BanUserProfile("");

            Assert.False(testUser.IsBanned);
        }