From 36bb10b6c5a24437ab6bc0c6982d287d15214584 Mon Sep 17 00:00:00 2001 From: ChaosEngine Date: Mon, 16 Oct 2023 20:52:12 +0200 Subject: [PATCH] bump: Google.Apis.YouTube.v3 small refactoring of test users creation --- .../DotnetPlayground.Web.csproj | 2 +- .../Helpers/ContextFactory.cs | 30 +++++++------------ InkBall | 2 +- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/DotnetPlayground.Web/DotnetPlayground.Web.csproj b/DotnetPlayground.Web/DotnetPlayground.Web.csproj index d7549c1c..db888529 100644 --- a/DotnetPlayground.Web/DotnetPlayground.Web.csproj +++ b/DotnetPlayground.Web/DotnetPlayground.Web.csproj @@ -49,7 +49,7 @@ - + diff --git a/DotnetPlayground.Web/Helpers/ContextFactory.cs b/DotnetPlayground.Web/Helpers/ContextFactory.cs index 8e166d9f..80742099 100644 --- a/DotnetPlayground.Web/Helpers/ContextFactory.cs +++ b/DotnetPlayground.Web/Helpers/ContextFactory.cs @@ -192,30 +192,20 @@ private static async Task SeedUsers(IServiceProvider scopedServices) using var userManager = scopedServices.GetRequiredService>(); // Seed the database with test data. - var user_pass_pairs = new (ApplicationUser user, string pass)[] + const int test_users_count = 4; + for (int i = 1; i <= test_users_count; i++) { - ( new ApplicationUser + var pair = (user: + new ApplicationUser { - UserName = "Playwright1@test.domain.com", - Email = "Playwright1@test.domain.com", + UserName = $"Playwright{i}@test.domain.com", + Email = $"Playwright{i}@test.domain.com", //example email: Playwright1@test.domain.com UserSettingsJSON = "{}", - Name = "Playwright1" + Name = $"Playwright{i}" }, - "Playwright1!" - ), - ( new ApplicationUser - { - UserName = "Playwright2@test.domain.com", - Email = "Playwright2@test.domain.com", - UserSettingsJSON = "{}", - Name = "Playwright2" - }, - "Playwright2!" - ) - }; - - foreach (var pair in user_pass_pairs) - { + pass: $"Playwright{i}!" //example pass: Playwright1!, Playwright2!... + ); + var existing_usr = await userManager.FindByEmailAsync(pair.user.Email); if (existing_usr == null) { diff --git a/InkBall b/InkBall index d6126829..b9ec6941 160000 --- a/InkBall +++ b/InkBall @@ -1 +1 @@ -Subproject commit d61268292d2c0322baec7fc46affc6138447ef89 +Subproject commit b9ec6941a66f5ab291fa494fb5725e764421317a