Exemple #1
0
        public static async Task SetRandomPasswordAsync(DbContextOptions <MemCheckDbContext> db, Guid userId)
        {
            using var dbContext = new MemCheckDbContext(db);
            var userToDelete = dbContext.Users.Single(u => u.Id == userId);

            using var userManager = GetUserManager(dbContext);
            var addPasswordResult = await userManager.AddPasswordAsync(userToDelete, RandomHelper.String().ToUpperInvariant() + RandomHelper.String());

            Assert.IsTrue(addPasswordResult.Succeeded);
        }