mirror of https://github.com/Squidex/squidex.git
Browse Source
* Batch processing for events. * Improve error handling. * Fix tests * More test fixespull/1224/head
committed by
GitHub
52 changed files with 5549 additions and 189 deletions
@ -0,0 +1,52 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using System.Data.Common; |
||||
|
|
||||
|
namespace Squidex.Infrastructure.Migrations; |
||||
|
|
||||
|
public class ConnectionStringParser |
||||
|
{ |
||||
|
public string? GetHostName(string? source) |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(source)) |
||||
|
{ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
return GetProviderSpecificHostName(source); |
||||
|
} |
||||
|
catch |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
var builder = new DbConnectionStringBuilder |
||||
|
{ |
||||
|
ConnectionString = source |
||||
|
}; |
||||
|
|
||||
|
if (builder.TryGetValue("Server", out var server)) |
||||
|
{ |
||||
|
return server?.ToString(); |
||||
|
} |
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
catch |
||||
|
{ |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected virtual string? GetProviderSpecificHostName(string source) |
||||
|
{ |
||||
|
throw new NotFiniteNumberException(); |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,74 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Squidex.Providers.MySql.App.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class MakeAssetPropertiesNullable : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Slug", |
||||
|
table: "Assets", |
||||
|
type: "longtext", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "longtext") |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "FileHash", |
||||
|
table: "Assets", |
||||
|
type: "longtext", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "longtext") |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.UpdateData( |
||||
|
table: "Assets", |
||||
|
keyColumn: "Slug", |
||||
|
keyValue: null, |
||||
|
column: "Slug", |
||||
|
value: ""); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Slug", |
||||
|
table: "Assets", |
||||
|
type: "longtext", |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "longtext", |
||||
|
oldNullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.UpdateData( |
||||
|
table: "Assets", |
||||
|
keyColumn: "FileHash", |
||||
|
keyValue: null, |
||||
|
column: "FileHash", |
||||
|
value: ""); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "FileHash", |
||||
|
table: "Assets", |
||||
|
type: "longtext", |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "longtext", |
||||
|
oldNullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using MySqlConnector; |
||||
|
using Squidex.Infrastructure.Migrations; |
||||
|
|
||||
|
namespace Squidex.Providers.MySql; |
||||
|
|
||||
|
public sealed class MySqlConnectionStringParser : ConnectionStringParser |
||||
|
{ |
||||
|
protected override string? GetProviderSpecificHostName(string source) |
||||
|
{ |
||||
|
var builder = new MySqlConnectionStringBuilder(source); |
||||
|
|
||||
|
return builder.Server; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using OpenTelemetry.Trace; |
||||
|
using Squidex.Infrastructure; |
||||
|
|
||||
|
namespace Squidex.Providers.MySql; |
||||
|
|
||||
|
public sealed class MySqlDiagnostics : ITelemetryConfigurator |
||||
|
{ |
||||
|
public void Configure(TracerProviderBuilder builder) |
||||
|
{ |
||||
|
builder.AddSource("MySqlConnector"); |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,54 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Squidex.Providers.Postgres.App.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class MakeAssetPropertiesNullable : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Slug", |
||||
|
table: "Assets", |
||||
|
type: "text", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "FileHash", |
||||
|
table: "Assets", |
||||
|
type: "text", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text"); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Slug", |
||||
|
table: "Assets", |
||||
|
type: "text", |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text", |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "FileHash", |
||||
|
table: "Assets", |
||||
|
type: "text", |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "text", |
||||
|
oldNullable: true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Npgsql; |
||||
|
using Squidex.Infrastructure.Migrations; |
||||
|
|
||||
|
namespace Squidex.Providers.Postgres; |
||||
|
|
||||
|
public class PostgresConnectionStringParser : ConnectionStringParser |
||||
|
{ |
||||
|
protected override string? GetProviderSpecificHostName(string source) |
||||
|
{ |
||||
|
var builder = new NpgsqlConnectionStringBuilder(source); |
||||
|
|
||||
|
return builder.Host; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Npgsql; |
||||
|
using OpenTelemetry.Trace; |
||||
|
using Squidex.Infrastructure; |
||||
|
|
||||
|
namespace Squidex.Providers.Postgres; |
||||
|
|
||||
|
public sealed class PostgresDiagnostics : ITelemetryConfigurator |
||||
|
{ |
||||
|
public void Configure(TracerProviderBuilder builder) |
||||
|
{ |
||||
|
builder.AddNpgsql(); |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,54 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Squidex.Providers.SqlServer.App.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class MakeAssetPropertiesNullable : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Slug", |
||||
|
table: "Assets", |
||||
|
type: "nvarchar(max)", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "nvarchar(max)"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "FileHash", |
||||
|
table: "Assets", |
||||
|
type: "nvarchar(max)", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "nvarchar(max)"); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Slug", |
||||
|
table: "Assets", |
||||
|
type: "nvarchar(max)", |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "nvarchar(max)", |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "FileHash", |
||||
|
table: "Assets", |
||||
|
type: "nvarchar(max)", |
||||
|
nullable: false, |
||||
|
defaultValue: "", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "nvarchar(max)", |
||||
|
oldNullable: true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Microsoft.Data.SqlClient; |
||||
|
using Squidex.Infrastructure.Migrations; |
||||
|
|
||||
|
namespace Squidex.Providers.SqlServer; |
||||
|
|
||||
|
public sealed class SqlServerConnectionStringParser : ConnectionStringParser |
||||
|
{ |
||||
|
protected override string? GetProviderSpecificHostName(string source) |
||||
|
{ |
||||
|
var builder = new SqlConnectionStringBuilder(source); |
||||
|
|
||||
|
return builder.DataSource; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using OpenTelemetry.Trace; |
||||
|
using Squidex.Infrastructure; |
||||
|
|
||||
|
namespace Squidex.Providers.SqlServer; |
||||
|
|
||||
|
public sealed class SqlServerDiagnostics : ITelemetryConfigurator |
||||
|
{ |
||||
|
public void Configure(TracerProviderBuilder builder) |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
@ -1,86 +1,105 @@ |
|||||
Param( |
Param( |
||||
[switch]$infrastructure, |
[switch]$testInfrastructure, |
||||
[switch]$appsCore, |
[switch]$testAppsCore, |
||||
[switch]$appsEntities, |
[switch]$testAppsEntities, |
||||
[switch]$users, |
[switch]$testUsers, |
||||
[switch]$web, |
[switch]$testWeb, |
||||
[switch]$all |
[switch]$testAll, |
||||
|
[switch]$noClean |
||||
) |
) |
||||
|
|
||||
$ErrorActionPreference = "Stop" |
$ErrorActionPreference = "Stop" |
||||
|
|
||||
$folderReports = ".\_test-output" |
$folderReports = ".\_test-output" |
||||
$folderHome = $env:USERPROFILE |
|
||||
$folderWorking = Get-Location |
$folderWorking = Get-Location |
||||
|
$versionOpenCover = "4.7.1221" |
||||
|
$versionReportGenerator = "5.4.1" |
||||
|
|
||||
if (Test-Path $folderReports) { |
if ($testAll) { |
||||
Remove-Item $folderReports -recurse |
$testInfrastructure = $true |
||||
|
$testAppsCore = $true |
||||
|
$testAppsEntities = $true |
||||
|
$testUsers = $true |
||||
|
$testWeb = $true |
||||
} |
} |
||||
|
|
||||
Write-Host "Recreated '$folderReports' folder" |
Write-Host "Test Infrastructure: $testInfrastructure" |
||||
|
Write-Host "Test Apps Core: $testAppsCore" |
||||
|
Write-Host "Test Apps Entities: $testAppsEntities" |
||||
|
Write-Host "Test Users: $testUsers" |
||||
|
Write-Host "Test Web: $testWeb" |
||||
|
|
||||
New-Item -ItemType directory -Path $folderReports |
if (!$noClean) { |
||||
|
if (Test-Path $folderReports) { |
||||
|
Remove-Item $folderReports -recurse |
||||
|
|
||||
if ($all -Or $infrastructure) { |
Write-Host "Recreated '$folderReports' folder" |
||||
&"$folderHome\.nuget\packages\OpenCover\4.7.1221\tools\OpenCover.Console.exe" ` |
} |
||||
-register:user ` |
|
||||
-target:"C:\Program Files\dotnet\dotnet.exe" ` |
|
||||
-targetargs:"test --filter Category!=Dependencies $folderWorking\Squidex.Infrastructure.Tests\Squidex.Infrastructure.Tests.csproj" ` |
|
||||
-filter:"+[Squidex.*]* -[*.Tests]* -[Squidex.*]*CodeGen*" ` |
|
||||
-excludebyattribute:*.ExcludeFromCodeCoverage* ` |
|
||||
-skipautoprops ` |
|
||||
-output:"$folderWorking\$folderReports\Infrastructure.xml" ` |
|
||||
-oldStyle |
|
||||
} |
} |
||||
|
|
||||
if ($all -Or $appsCore) { |
if (!(Test-Path $folderReports)) { |
||||
&"$folderHome\.nuget\packages\OpenCover\4.7.1221\tools\OpenCover.Console.exe" ` |
New-Item -ItemType directory -Path $folderReports |
||||
-register:user ` |
|
||||
-target:"C:\Program Files\dotnet\dotnet.exe" ` |
|
||||
-targetargs:"test --filter Category!=Dependencies $folderWorking\Squidex.Domain.Apps.Core.Tests\Squidex.Domain.Apps.Core.Tests.csproj" ` |
|
||||
-filter:"+[Squidex.*]* -[*.Tests]* -[Squidex.*]*CodeGen*" ` |
|
||||
-excludebyattribute:*.ExcludeFromCodeCoverage* ` |
|
||||
-skipautoprops ` |
|
||||
-output:"$folderWorking\$folderReports\Core.xml" ` |
|
||||
-oldStyle |
|
||||
} |
} |
||||
|
|
||||
if ($all -Or $appsEntities) { |
if ($testInfrastructure) { |
||||
&"$folderHome\.nuget\packages\OpenCover\4.7.1221\tools\OpenCover.Console.exe" ` |
$projectName = "Squidex.Infrastructure.Tests" |
||||
-register:user ` |
|
||||
-target:"C:\Program Files\dotnet\dotnet.exe" ` |
dotnet test "$folderWorking\$projectName\$projectName.csproj" ` |
||||
-targetargs:"test --filter Category!=Dependencies $folderWorking\Squidex.Domain.Apps.Entities.Tests\Squidex.Domain.Apps.Entities.Tests.csproj" ` |
--no-restore ` |
||||
-filter:"+[Squidex.*]* -[*.Tests]* -[Squidex.*]*CodeGen*" ` |
--filter "Category!=Dependencies & Category!=TestContainer" ` |
||||
-excludebyattribute:*.ExcludeFromCodeCoverage* ` |
--collect "XPlat Code Coverage" ` |
||||
-skipautoprops ` |
--results-directory "$folderReports" ` |
||||
-output:"$folderWorking\$folderReports\Entities.xml" ` |
--settings "$folderWorking\coverlet.runsettings.xml" |
||||
-oldStyle |
} |
||||
|
|
||||
|
if ($testAppsCore) { |
||||
|
$projectName = "Squidex.Domain.Apps.Core.Tests" |
||||
|
|
||||
|
dotnet test "$folderWorking\$projectName\$projectName.csproj" ` |
||||
|
--no-restore ` |
||||
|
--filter "Category!=Dependencies & Category!=TestContainer" ` |
||||
|
--collect "XPlat Code Coverage" ` |
||||
|
--results-directory "$folderReports" ` |
||||
|
--settings "$folderWorking\coverlet.runsettings.xml" |
||||
} |
} |
||||
|
|
||||
if ($all -Or $users) { |
if ($testAppsEntities) { |
||||
&"$folderHome\.nuget\packages\OpenCover\4.7.1221\tools\OpenCover.Console.exe" ` |
$projectName = "Squidex.Domain.Apps.Entities.Tests" |
||||
-register:user ` |
|
||||
-target:"C:\Program Files\dotnet\dotnet.exe" ` |
dotnet test "$folderWorking\$projectName\$projectName.csproj" ` |
||||
-targetargs:"test --filter Category!=Dependencies $folderWorking\Squidex.Domain.Users.Tests\Squidex.Domain.Users.Tests.csproj" ` |
--no-restore ` |
||||
-filter:"+[Squidex.*]* -[*.Tests]* -[Squidex.*]*CodeGen*" ` |
--filter "Category!=Dependencies & Category!=TestContainer" ` |
||||
-excludebyattribute:*.ExcludeFromCodeCoverage* ` |
--collect "XPlat Code Coverage" ` |
||||
-skipautoprops ` |
--results-directory "$folderReports" ` |
||||
-output:"$folderWorking\$folderReports\Users.xml" ` |
--settings "$folderWorking\coverlet.runsettings.xml" |
||||
-oldStyle |
|
||||
} |
} |
||||
|
|
||||
if ($all -Or $web) { |
if ($testUsers) { |
||||
&"$folderHome\.nuget\packages\OpenCover\4.7.1221\tools\OpenCover.Console.exe" ` |
$projectName = "Squidex.Domain.Users.Tests" |
||||
-register:user ` |
|
||||
-target:"C:\Program Files\dotnet\dotnet.exe" ` |
dotnet test "$folderWorking\$projectName\$projectName.csproj" ` |
||||
-targetargs:"test --filter Category!=Dependencies $folderWorking\Squidex.Web.Tests\Squidex.Web.Tests.csproj" ` |
--no-restore ` |
||||
-filter:"+[Squidex.*]* -[*.Tests]* -[Squidex.*]*CodeGen*" ` |
--filter "Category!=Dependencies & Category!=TestContainer" ` |
||||
-excludebyattribute:*.ExcludeFromCodeCoverage* ` |
--collect "XPlat Code Coverage" ` |
||||
-skipautoprops ` |
--results-directory "$folderReports" ` |
||||
-output:"$folderWorking\$folderReports\Web.xml" ` |
--settings "$folderWorking\coverlet.runsettings.xml" |
||||
-oldStyle |
|
||||
} |
} |
||||
|
|
||||
&"$folderHome\.nuget\packages\ReportGenerator\5.1.9\tools\net47\ReportGenerator.exe" ` |
if ($testWeb) { |
||||
-reports:"$folderWorking\$folderReports\*.xml" ` |
$projectName = "Squidex.Web.Tests" |
||||
-targetdir:"$folderWorking\$folderReports\Output" |
|
||||
|
dotnet test "$folderWorking\$projectName\$projectName.csproj" ` |
||||
|
--no-restore ` |
||||
|
--filter "Category!=Dependencies & Category!=TestContainer" ` |
||||
|
--collect "XPlat Code Coverage" ` |
||||
|
--results-directory "$folderReports" ` |
||||
|
--settings "$folderWorking\coverlet.runsettings.xml" |
||||
|
} |
||||
|
|
||||
|
|
||||
|
dotnet tool install -g dotnet-reportgenerator-globaltool |
||||
|
|
||||
|
reportgenerator ` |
||||
|
-reports:"$folderReports\**\coverage.cobertura.xml" ` |
||||
|
-targetdir:"$folderReports\report" ` |
||||
|
-reporttypes:Html |
||||
@ -0,0 +1,23 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Squidex.Providers.MySql; |
||||
|
|
||||
|
namespace Squidex.EntityFramework.Infrastructure.Migrations; |
||||
|
|
||||
|
public class MySqlConnectionStringParserTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Should_parse_host_name() |
||||
|
{ |
||||
|
var sut = new MySqlConnectionStringParser(); |
||||
|
|
||||
|
var result = sut.GetHostName("Server=localhost;Port=33060;Database=test;User=mysql;Password=mysql"); |
||||
|
|
||||
|
Assert.Equal("localhost", result); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Squidex.Providers.Postgres; |
||||
|
|
||||
|
namespace Squidex.EntityFramework.Infrastructure.Migrations; |
||||
|
|
||||
|
public class PostgresConnectionStringParserTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Should_parse_host_name() |
||||
|
{ |
||||
|
var sut = new PostgresConnectionStringParser(); |
||||
|
|
||||
|
var result = sut.GetHostName("Server=localhost;Port=54320;Database=test;User=postgres;Password=postgres"); |
||||
|
|
||||
|
Assert.Equal("localhost", result); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Squidex.Providers.SqlServer; |
||||
|
|
||||
|
namespace Squidex.EntityFramework.Infrastructure.Migrations; |
||||
|
|
||||
|
public class SqlServerConnectionStringParserTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Should_parse_host_name() |
||||
|
{ |
||||
|
var sut = new SqlServerConnectionStringParser(); |
||||
|
|
||||
|
var result = sut.GetHostName("Server=localhost;Port=14330;Database=test;User=sa;Password=sqlserver"); |
||||
|
|
||||
|
Assert.Equal("localhost", result); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<RunSettings> |
||||
|
<DataCollectionRunSettings> |
||||
|
<DataCollectors> |
||||
|
<DataCollector friendlyName="XPlat Code Coverage"> |
||||
|
<Configuration> |
||||
|
<ExcludeAssembliesWithoutSources>MissingAll</ExcludeAssembliesWithoutSources> |
||||
|
<Exclude>[*.Tests]*,[Squidex.Extensions]*</Exclude> |
||||
|
<ExcludeByAttribute>Obsolete,GeneratedCode,CompilerGenerated,ExcludeFromCodeCoverage</ExcludeByAttribute> |
||||
|
<ExcludeByFile>*.g.cs,**/Migrations/*.cs</ExcludeByFile> |
||||
|
<IncludeTestAssembly>false</IncludeTestAssembly> |
||||
|
</Configuration> |
||||
|
</DataCollector> |
||||
|
</DataCollectors> |
||||
|
</DataCollectionRunSettings> |
||||
|
</RunSettings> |
||||
@ -0,0 +1,60 @@ |
|||||
|
Microsoft Visual Studio Solution File, Format Version 12.00 |
||||
|
# Visual Studio Version 17 |
||||
|
VisualStudioVersion = 17.5.2.0 |
||||
|
MinimumVisualStudioVersion = 10.0.40219.1 |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Data.Tests", "Squidex.Data.Tests\Squidex.Data.Tests.csproj", "{36FAF7D1-52B7-F128-1967-AC4160DE4528}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Data.Tests.CodeGenerator", "Squidex.Data.Tests.CodeGenerator\Squidex.Data.Tests.CodeGenerator.csproj", "{F724DB40-7C2F-4C19-7B97-77AA2268F1B5}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Domain.Apps.Core.Tests", "Squidex.Domain.Apps.Core.Tests\Squidex.Domain.Apps.Core.Tests.csproj", "{F631204E-94A4-4F1A-5011-E3255AD95AFC}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Domain.Apps.Entities.Tests", "Squidex.Domain.Apps.Entities.Tests\Squidex.Domain.Apps.Entities.Tests.csproj", "{EEC6B0AB-FA33-D18F-5620-A2CDDDA184A1}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Domain.Users.Tests", "Squidex.Domain.Users.Tests\Squidex.Domain.Users.Tests.csproj", "{F16187EF-3B10-BABF-4BEF-674DDF9177AC}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Infrastructure.Tests", "Squidex.Infrastructure.Tests\Squidex.Infrastructure.Tests.csproj", "{9C47E947-D228-B141-2B67-0D2348052F23}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squidex.Web.Tests", "Squidex.Web.Tests\Squidex.Web.Tests.csproj", "{0811601F-4F56-C9D8-3DDE-334B32B6BF7D}" |
||||
|
EndProject |
||||
|
Global |
||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
|
Debug|Any CPU = Debug|Any CPU |
||||
|
Release|Any CPU = Release|Any CPU |
||||
|
EndGlobalSection |
||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
|
{36FAF7D1-52B7-F128-1967-AC4160DE4528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{36FAF7D1-52B7-F128-1967-AC4160DE4528}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{36FAF7D1-52B7-F128-1967-AC4160DE4528}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{36FAF7D1-52B7-F128-1967-AC4160DE4528}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{F724DB40-7C2F-4C19-7B97-77AA2268F1B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{F724DB40-7C2F-4C19-7B97-77AA2268F1B5}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{F724DB40-7C2F-4C19-7B97-77AA2268F1B5}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{F724DB40-7C2F-4C19-7B97-77AA2268F1B5}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{F631204E-94A4-4F1A-5011-E3255AD95AFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{F631204E-94A4-4F1A-5011-E3255AD95AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{F631204E-94A4-4F1A-5011-E3255AD95AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{F631204E-94A4-4F1A-5011-E3255AD95AFC}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{EEC6B0AB-FA33-D18F-5620-A2CDDDA184A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{EEC6B0AB-FA33-D18F-5620-A2CDDDA184A1}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{EEC6B0AB-FA33-D18F-5620-A2CDDDA184A1}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{EEC6B0AB-FA33-D18F-5620-A2CDDDA184A1}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{F16187EF-3B10-BABF-4BEF-674DDF9177AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{F16187EF-3B10-BABF-4BEF-674DDF9177AC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{F16187EF-3B10-BABF-4BEF-674DDF9177AC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{F16187EF-3B10-BABF-4BEF-674DDF9177AC}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{9C47E947-D228-B141-2B67-0D2348052F23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{9C47E947-D228-B141-2B67-0D2348052F23}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{9C47E947-D228-B141-2B67-0D2348052F23}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{9C47E947-D228-B141-2B67-0D2348052F23}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{0811601F-4F56-C9D8-3DDE-334B32B6BF7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{0811601F-4F56-C9D8-3DDE-334B32B6BF7D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{0811601F-4F56-C9D8-3DDE-334B32B6BF7D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{0811601F-4F56-C9D8-3DDE-334B32B6BF7D}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
EndGlobalSection |
||||
|
GlobalSection(SolutionProperties) = preSolution |
||||
|
HideSolutionNode = FALSE |
||||
|
EndGlobalSection |
||||
|
GlobalSection(ExtensibilityGlobals) = postSolution |
||||
|
SolutionGuid = {A39F744B-33DA-4770-9FF1-0E73834C34ED} |
||||
|
EndGlobalSection |
||||
|
EndGlobal |
||||
Loading…
Reference in new issue