Browse Source
Merge pull request #16390 from abpframework/EphemeralMongo
Use `EphemeralMongo` to replace `Mongo2Go`.
pull/16520/head
Halil İbrahim Kalkan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with
399 additions and
221 deletions
-
.github/workflows/build-and-test.yml
-
framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj
-
framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj
-
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs
-
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs
-
framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs
-
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs
-
modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj
-
modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs
-
modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs
-
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj
-
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs
-
modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs
-
modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs
-
modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs
-
modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj
-
modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj
-
modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs
-
modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs
-
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Pages/MongoPageRepository.cs
-
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs
-
modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs
-
modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/MongoDbFixture.cs
-
modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj
-
modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj
-
modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs
-
modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs
-
modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj
-
modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs
-
modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs
-
modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj
-
modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs
-
modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs
-
modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj
-
modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs
-
modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs
-
modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo.Abp.OpenIddict.MongoDB.Tests.csproj
-
modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo/Abp/OpenIddict/MongoDB/MongoDbFixture.cs
-
modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo/Abp/OpenIddict/MongoDB/OpenIddictMongoDbTestModule.cs
-
modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj
-
modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs
-
modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs
-
modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj
-
modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs
-
modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs
-
modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj
-
modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs
-
modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs
-
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbFixture.cs
-
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs
-
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj
-
templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MongoDbFixture.cs
-
templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs
-
templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj
|
|
|
@ -41,7 +41,7 @@ permissions: |
|
|
|
|
|
|
|
jobs: |
|
|
|
build-test: |
|
|
|
runs-on: windows-latest |
|
|
|
runs-on: ubuntu-latest |
|
|
|
if: ${{ !github.event.pull_request.draft }} |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
@ -49,15 +49,19 @@ jobs: |
|
|
|
with: |
|
|
|
dotnet-version: 7.0.100 |
|
|
|
|
|
|
|
- name: chown |
|
|
|
run: | |
|
|
|
sudo chown -R $USER:$USER /home/runneradmin |
|
|
|
|
|
|
|
- name: Build All |
|
|
|
run: .\build-all.ps1 -f |
|
|
|
working-directory: .\build |
|
|
|
shell: powershell |
|
|
|
run: ./build-all.ps1 |
|
|
|
working-directory: ./build |
|
|
|
shell: pwsh |
|
|
|
|
|
|
|
- name: Test All |
|
|
|
run: .\test-all.ps1 -f |
|
|
|
working-directory: .\build |
|
|
|
shell: powershell |
|
|
|
run: ./test-all.ps1 |
|
|
|
working-directory: ./build |
|
|
|
shell: pwsh |
|
|
|
|
|
|
|
- name: Codecov |
|
|
|
uses: codecov/codecov-action@v2 |
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
</PropertyGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="MongoDB.Driver" Version="2.15.1" /> |
|
|
|
<PackageReference Include="MongoDB.Driver" Version="2.19.1" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
|
|
|
|
@ -15,7 +15,10 @@ |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
|
|
|
|
@ -21,14 +21,9 @@ public class AbpMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
|
|
|
|
context.Services.AddMongoDbContext<TestAppMongoDbContext>(options => |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -10,6 +10,7 @@ using Xunit; |
|
|
|
|
|
|
|
namespace Volo.Abp.MongoDB.Transactions; |
|
|
|
|
|
|
|
[Collection(MongoTestCollection.Name)] |
|
|
|
public class Transaction_Tests : TestAppTestBase<AbpMongoDbTestModule> |
|
|
|
{ |
|
|
|
private readonly IBasicRepository<Person, Guid> _personRepository; |
|
|
|
|
|
|
|
@ -262,7 +262,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon |
|
|
|
.WhereIf(auditLogId.HasValue, e => e.Id == auditLogId) |
|
|
|
.WhereIf(startTime.HasValue, e => e.ChangeTime >= startTime) |
|
|
|
.WhereIf(endTime.HasValue, e => e.ChangeTime <= endTime) |
|
|
|
.WhereIf(changeType.HasValue, e => e.ChangeType == changeType) |
|
|
|
.WhereIf(changeType.HasValue, e => e.ChangeType == changeType.Value) |
|
|
|
.WhereIf(!string.IsNullOrWhiteSpace(entityId), e => e.EntityId == entityId) |
|
|
|
.WhereIf(!string.IsNullOrWhiteSpace(entityTypeFullName), |
|
|
|
e => e.EntityTypeFullName.Contains(entityTypeFullName)); |
|
|
|
|
|
|
|
@ -14,7 +14,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class AbpAuditLoggingMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.AuditLogging.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -14,7 +14,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class AbpBackgroundJobsMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.BackgroundJobs.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class BlobStoringDatabaseMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.BlobStoring.Database.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -7,7 +7,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
<ProjectReference Include="..\..\src\Volo.Abp.BlobStoring.Database.MongoDB\Volo.Abp.BlobStoring.Database.MongoDB.csproj" /> |
|
|
|
<ProjectReference Include="..\Volo.Abp.BlobStoring.Database.TestBase\Volo.Abp.BlobStoring.Database.TestBase.csproj" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
@ -7,7 +7,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
<ProjectReference Include="..\..\src\Volo.Blogging.MongoDB\Volo.Blogging.MongoDB.csproj" /> |
|
|
|
<ProjectReference Include="..\Volo.Blogging.TestBase\Volo.Blogging.TestBase.csproj" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ namespace Volo.Blogging.MongoDB |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,22 +1,32 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Blogging.MongoDB |
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
} |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
MongoDbRunner?.Dispose(); |
|
|
|
} |
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
MongoDbRunner?.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -30,7 +30,7 @@ public class MongoPageRepository : MongoDbRepository<ICmsKitMongoDbContext, Page |
|
|
|
.WhereIf<Page, IMongoQueryable<Page>>( |
|
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
|
u => |
|
|
|
u.Title.ToLower().Contains(filter) || u.Slug.Contains(filter) |
|
|
|
u.Title.ToLower().Contains(filter.ToLower()) || u.Slug.Contains(filter) |
|
|
|
).CountAsync(cancellation); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -99,7 +99,7 @@ public class MongoTagRepository : MongoDbRepository<ICmsKitMongoDbContext, Volo. |
|
|
|
if (!filter.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
mongoQueryable = mongoQueryable.Where(x => |
|
|
|
x.Name.ToLower().Contains(filter) || |
|
|
|
x.Name.ToLower().Contains(filter.ToLower()) || |
|
|
|
x.EntityType.ToLower().Contains(filter)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class CmsKitMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.CmsKit.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -7,7 +7,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
<ProjectReference Include="..\..\src\Volo.CmsKit.MongoDB\Volo.CmsKit.MongoDB.csproj" /> |
|
|
|
<ProjectReference Include="..\Volo.CmsKit.TestBase\Volo.CmsKit.TestBase.csproj" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
@ -7,7 +7,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ namespace Volo.Docs.MongoDB |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,22 +1,32 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Docs.MongoDB |
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
} |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
MongoDbRunner?.Dispose(); |
|
|
|
} |
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
MongoDbRunner?.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -14,7 +14,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -12,14 +12,10 @@ public class AbpFeatureManagementMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.FeatureManagement.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -20,7 +20,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -15,14 +15,9 @@ public class AbpIdentityMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
|
|
|
|
Configure<AbpUnitOfWorkDefaultOptions>(options => |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.Identity.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -20,7 +20,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -16,14 +16,10 @@ public class AbpIdentityServerMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.IdentityServer; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -9,7 +9,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.OpenIddict.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -17,14 +17,10 @@ namespace Volo.Abp.OpenIddict.MongoDB; |
|
|
|
public class OpenIddictMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
private static string _connectionString; |
|
|
|
|
|
|
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
_connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
_connectionString = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = _connectionString; |
|
|
|
|
|
|
|
@ -19,7 +19,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -12,14 +12,9 @@ public class AbpPermissionManagementMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.PermissionManagement.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -18,7 +18,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class AbpSettingManagementMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace Volo.Abp.SettingManagement.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -18,7 +18,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="$(Mongo2GoPackageVersion)" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class AbpTenantManagementMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
using MongoDB.Driver; |
|
|
|
using Volo.Abp.MongoDB; |
|
|
|
|
|
|
|
@ -7,13 +7,26 @@ namespace Volo.Abp.TenantManagement.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace MyCompanyName.MyProjectName.MongoDB; |
|
|
|
|
|
|
|
public class MyProjectNameMongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MyProjectNameMongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -12,14 +12,9 @@ public class MyProjectNameMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MyProjectNameMongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MyProjectNameMongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -15,7 +15,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="3.1.3" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -1,17 +1,30 @@ |
|
|
|
using System; |
|
|
|
using Mongo2Go; |
|
|
|
using EphemeralMongo; |
|
|
|
|
|
|
|
namespace MyCompanyName.MyProjectName.MongoDB; |
|
|
|
|
|
|
|
public class MongoDbFixture : IDisposable |
|
|
|
{ |
|
|
|
private static readonly MongoDbRunner MongoDbRunner; |
|
|
|
public static readonly string ConnectionString; |
|
|
|
public readonly static IMongoRunner MongoDbRunner; |
|
|
|
|
|
|
|
static MongoDbFixture() |
|
|
|
{ |
|
|
|
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
|
|
|
ConnectionString = MongoDbRunner.ConnectionString; |
|
|
|
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions |
|
|
|
{ |
|
|
|
UseSingleNodeReplicaSet = true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetRandomConnectionString() |
|
|
|
{ |
|
|
|
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); |
|
|
|
} |
|
|
|
|
|
|
|
public static string GetConnectionString(string databaseName) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbRunner.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; |
|
|
|
return connectionString; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
|
|
|
|
@ -13,14 +13,9 @@ public class MyProjectNameMongoDbTestModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var stringArray = MongoDbFixture.ConnectionString.Split('?'); |
|
|
|
var connectionString = stringArray[0].EnsureEndsWith('/') + |
|
|
|
"Db_" + |
|
|
|
Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; |
|
|
|
|
|
|
|
Configure<AbpDbConnectionOptions>(options => |
|
|
|
{ |
|
|
|
options.ConnectionStrings.Default = connectionString; |
|
|
|
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -10,7 +10,10 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> |
|
|
|
<PackageReference Include="Mongo2Go" Version="3.1.3" /> |
|
|
|
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" /> |
|
|
|
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" /> |
|
|
|
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.MongoDB\MyCompanyName.MyProjectName.MongoDB.csproj" /> |
|
|
|
<ProjectReference Include="..\MyCompanyName.MyProjectName.TestBase\MyCompanyName.MyProjectName.TestBase.csproj" /> |
|
|
|
</ItemGroup> |
|
|
|
|