Skip to content

Commit 1769fee

Browse files
committed
refactor: replace PasswordGenerator with GenerateParameterDefault
1 parent a5c98aa commit 1769fee

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

tests/CommunityToolkit.Aspire.SurrealDb.Tests/CommunityToolkit.Aspire.SurrealDb.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<Compile Include="$(SharedDir)\PasswordGenerator.cs" Link="Utils\PasswordGenerator.cs" />
1817
<Compile Include="$(RepoRoot)src\CommunityToolkit.Aspire.Hosting.SurrealDb\SurrealDbContainerImageTags.cs" />
1918
</ItemGroup>
2019

tests/CommunityToolkit.Aspire.SurrealDb.Tests/SurrealDbContainerFixture.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ public async Task InitializeAsync()
3232
{
3333
if (RequiresDockerAttribute.IsSupported)
3434
{
35-
_password = PasswordGenerator.Generate(minLength: 8, lower: true, upper: true, numeric: true, special: false, minLower: 1, minUpper: 1, minNumeric: 1, minSpecial: 0);
35+
var paramGenerator = new GenerateParameterDefault
36+
{
37+
MinLength = 8,
38+
Lower = true,
39+
Upper = true,
40+
Numeric = true,
41+
Special = false,
42+
MinLower = 1,
43+
MinUpper = 1,
44+
MinNumeric = 1,
45+
MinSpecial = 0
46+
};
47+
48+
_password = paramGenerator.GetDefaultValue();
3649

3750
Container = new ContainerBuilder()
3851
.WithImage($"{SurrealDbContainerImageTags.Registry}/{SurrealDbContainerImageTags.Image}:{SurrealDbContainerImageTags.Tag}")

0 commit comments

Comments
 (0)