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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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)); }
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); }