From a09c105e044fd3a1163d218f5bb46ff6e310c38c Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 18 Jul 2018 09:30:15 +0300 Subject: [PATCH] Added audit logging mongodb test project --- .../audit-logging/Volo.Abp.AuditLogging.sln | 19 +++++++---- ...Volo.Abp.AuditLogging.MongoDB.Tests.csproj | 24 +++++++++++++ .../AbpAuditLoggingMongoDbTestModule.cs | 34 +++++++++++++++++++ .../AuditLogging/AbpAuditLoggingTestModule.cs | 4 ++- 4 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj create mode 100644 modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs diff --git a/modules/audit-logging/Volo.Abp.AuditLogging.sln b/modules/audit-logging/Volo.Abp.AuditLogging.sln index 08fd018a6d..747abf454a 100644 --- a/modules/audit-logging/Volo.Abp.AuditLogging.sln +++ b/modules/audit-logging/Volo.Abp.AuditLogging.sln @@ -5,21 +5,23 @@ VisualStudioVersion = 15.0.27703.2035 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.Domain.Shared", "src\Volo.Abp.AuditLogging.Domain.Shared\Volo.Abp.AuditLogging.Domain.Shared.csproj", "{6BFAB2F3-230A-45C2-8C94-4955CE3FF93E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.Domain", "src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj", "{1878DA13-BFA0-4EEA-A268-272DC1C34B43}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.Domain", "src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj", "{1878DA13-BFA0-4EEA-A268-272DC1C34B43}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.EntityFrameworkCore", "src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj", "{E1B915D0-7F7B-4F92-B8D5-6C7DECE75E45}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.EntityFrameworkCore", "src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj", "{E1B915D0-7F7B-4F92-B8D5-6C7DECE75E45}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.MongoDB", "src\Volo.Abp.AuditLogging.MongoDB\Volo.Abp.AuditLogging.MongoDB.csproj", "{FA5154D2-26B2-4DBC-8A12-536A7323F3CD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.MongoDB", "src\Volo.Abp.AuditLogging.MongoDB\Volo.Abp.AuditLogging.MongoDB.csproj", "{FA5154D2-26B2-4DBC-8A12-536A7323F3CD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CFAB155F-5255-4D99-94E2-3361D8EA4B15}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{971E31E2-FC37-41D3-8B6E-96848105C446}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.Tests", "test\Volo.Abp.AuditLogging.Tests\Volo.Abp.AuditLogging.Tests.csproj", "{9946C645-1234-49D9-98C1-152311FBBAB5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.Tests", "test\Volo.Abp.AuditLogging.Tests\Volo.Abp.AuditLogging.Tests.csproj", "{9946C645-1234-49D9-98C1-152311FBBAB5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.TestBase", "test\Volo.Abp.AuditLogging.TestBase\Volo.Abp.AuditLogging.TestBase.csproj", "{6CDB588F-B5FD-4F2A-9599-49ACE2D7AF83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.TestBase", "test\Volo.Abp.AuditLogging.TestBase\Volo.Abp.AuditLogging.TestBase.csproj", "{6CDB588F-B5FD-4F2A-9599-49ACE2D7AF83}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.EntityFrameworkCore.Tests", "test\Volo.Abp.AuditLogging.EntityFrameworkCore.Tests\Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj", "{CBED3E11-0A33-4B56-A75C-A57D25C98C38}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AuditLogging.EntityFrameworkCore.Tests", "test\Volo.Abp.AuditLogging.EntityFrameworkCore.Tests\Volo.Abp.AuditLogging.EntityFrameworkCore.Tests.csproj", "{CBED3E11-0A33-4B56-A75C-A57D25C98C38}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AuditLogging.MongoDB.Tests", "test\Volo.Abp.AuditLogging.MongoDB.Tests\Volo.Abp.AuditLogging.MongoDB.Tests.csproj", "{9F04C908-F4B9-45B4-BB9A-26A1462D4D7F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -55,6 +57,10 @@ Global {CBED3E11-0A33-4B56-A75C-A57D25C98C38}.Debug|Any CPU.Build.0 = Debug|Any CPU {CBED3E11-0A33-4B56-A75C-A57D25C98C38}.Release|Any CPU.ActiveCfg = Release|Any CPU {CBED3E11-0A33-4B56-A75C-A57D25C98C38}.Release|Any CPU.Build.0 = Release|Any CPU + {9F04C908-F4B9-45B4-BB9A-26A1462D4D7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F04C908-F4B9-45B4-BB9A-26A1462D4D7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F04C908-F4B9-45B4-BB9A-26A1462D4D7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F04C908-F4B9-45B4-BB9A-26A1462D4D7F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -67,6 +73,7 @@ Global {9946C645-1234-49D9-98C1-152311FBBAB5} = {971E31E2-FC37-41D3-8B6E-96848105C446} {6CDB588F-B5FD-4F2A-9599-49ACE2D7AF83} = {971E31E2-FC37-41D3-8B6E-96848105C446} {CBED3E11-0A33-4B56-A75C-A57D25C98C38} = {971E31E2-FC37-41D3-8B6E-96848105C446} + {9F04C908-F4B9-45B4-BB9A-26A1462D4D7F} = {971E31E2-FC37-41D3-8B6E-96848105C446} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9F36BAE5-A9CF-460C-8E7E-4580347F71F6} diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj new file mode 100644 index 0000000000..a9ccec677d --- /dev/null +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj @@ -0,0 +1,24 @@ + + + + netcoreapp2.1 + Volo.Abp.AuditLogging.MongoDB.Tests + Volo.Abp.AuditLogging.MongoDB.Tests + true + false + false + false + + + + + + + + + + + + + + diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs new file mode 100644 index 0000000000..523eea651a --- /dev/null +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.DependencyInjection; +using Mongo2Go; +using Volo.Abp.Data; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AuditLogging.MongoDB +{ + [DependsOn( + typeof(AbpAuditLoggingTestBaseModule), + typeof(AbpAuditLoggingMongoDbModule) + )] + public class AbpAuditLoggingMongoDbTestModule : AbpModule + { + private MongoDbRunner _mongoDbRunner; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + _mongoDbRunner = MongoDbRunner.Start(); + + context.Services.Configure(options => + { + options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString; + }); + + context.Services.AddAssemblyOf(); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _mongoDbRunner.Dispose(); + } + + } +} \ No newline at end of file diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AbpAuditLoggingTestModule.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AbpAuditLoggingTestModule.cs index d4d93faab5..28ea455b54 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AbpAuditLoggingTestModule.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AbpAuditLoggingTestModule.cs @@ -4,7 +4,9 @@ using Volo.Abp.Modularity; namespace Volo.Abp.AuditLogging { - [DependsOn(typeof(AbpAuditLoggingEntityFrameworkCoreTestModule))] + [DependsOn( + typeof(AbpAuditLoggingEntityFrameworkCoreTestModule) + )] public class AbpAuditLoggingTestModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context)