示例#1
0
        public async Task Find_By_Name_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            LetPortal.Identity.Entities.User result = await userStore.FindByNameAsync("ADMIN", new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.NotNull(result);
        }
示例#2
0
        public async Task Add_To_Role_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.AddToRoleAsync(_context.GenerateUser(), "TestRole", new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#3
0
        public async Task Find_By_Id_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            LetPortal.Identity.Entities.User result = await userStore.FindByIdAsync("5ce287ee569d6f23e8504cef", new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.NotNull(result);
        }
示例#4
0
        public async Task Set_UserName_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.SetUserNameAsync(_context.GenerateUser(), "asdasdasd", new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#5
0
        public async Task Update_User_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            Microsoft.AspNetCore.Identity.IdentityResult result = await userStore.UpdateAsync(_context.GenerateUser(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(result.Succeeded);
        }
示例#6
0
        public async Task Set_Lockout_EndDate_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.SetLockoutEndDateAsync(_context.GenerateUser(), DateTimeOffset.UtcNow.AddDays(10), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#7
0
        public async Task Set_Normalized_Email_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.SetNormalizedEmailAsync(_context.GenerateUser(), "*****@*****.**".ToUpper(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#8
0
        public async Task Reset_Access_FailedCount_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.ResetAccessFailedCountAsync(_context.GenerateUser(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#9
0
        public async Task Set_Lockout_Enabled_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.SetLockoutEnabledAsync(_context.GenerateUser(), false, new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#10
0
        public async Task Remove_Claims_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.RemoveClaimsAsync(_context.GenerateUser(), new List <Claim>(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#11
0
        public async Task Is_In_Role_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            bool result = await userStore.IsInRoleAsync(_context.GenerateUser(), "SuperAdmin", new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(result);
        }
示例#12
0
        public async Task Has_Password_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            await userStore.HasPasswordAsync(_context.GenerateUser(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(true);
        }
示例#13
0
        public async Task Get_UserName_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            string result = await userStore.GetUserNameAsync(_context.GenerateUser(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.True(!string.IsNullOrEmpty(result));
        }
示例#14
0
        public async Task Get_Roles_Mongo_Test()
        {
            // Arrange
            LetPortal.Identity.Stores.UserStore userStore = _context.GetUserStore();

            // Act
            IList <string> result = await userStore.GetRolesAsync(_context.GenerateUser(), new System.Threading.CancellationToken());

            userStore.Dispose();
            // Assert
            Assert.NotEmpty(result);
        }