Skip to content

Commit

Permalink
bump: Google.Apis.YouTube.v3
Browse files Browse the repository at this point in the history
small refactoring of test users creation
  • Loading branch information
ChaosEngine committed Oct 16, 2023
1 parent e2b3463 commit 36bb10b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DotnetPlayground.Web/DotnetPlayground.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<PackageReference Include="Lib.AspNetCore.ServerTiming" Version="6.0.0" />
<!--<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.16.2" Condition="$(DefineConstants.Contains('INCLUDE_COSMOSDB'))" />-->
<PackageReference Include="MongoDB.Driver" Version="2.22.0" Condition="$(DefineConstants.Contains('INCLUDE_MONGODB'))" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.62.1.3203" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.62.1.3205" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="7.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="7.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="7.0.12" />
Expand Down
30 changes: 10 additions & 20 deletions DotnetPlayground.Web/Helpers/ContextFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,30 +192,20 @@ private static async Task SeedUsers(IServiceProvider scopedServices)
using var userManager = scopedServices.GetRequiredService<UserManager<ApplicationUser>>();

// 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: [email protected]
UserSettingsJSON = "{}",
Name = "Playwright1"
Name = $"Playwright{i}"
},
"Playwright1!"
),
( new ApplicationUser
{
UserName = "[email protected]",
Email = "[email protected]",
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)
{
Expand Down

0 comments on commit 36bb10b

Please sign in to comment.