From 0868c3086c84877124f493b91f6fde5cc8d024d0 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 19 Jul 2018 08:50:44 +0300 Subject: [PATCH] Revise tests. --- .../EntityFrameworkCore/AuditStore_Basic_Tests.cs | 7 +++++++ .../AuditLogging/MongoDB/AuditStore_Basic_Tests.cs | 7 +++++++ .../Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs | 12 ++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditStore_Basic_Tests.cs create mode 100644 modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AuditStore_Basic_Tests.cs rename modules/audit-logging/test/{Volo.Abp.AuditLogging.Tests => Volo.Abp.AuditLogging.TestBase}/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs (82%) diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditStore_Basic_Tests.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditStore_Basic_Tests.cs new file mode 100644 index 0000000000..af623d5d5b --- /dev/null +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AuditStore_Basic_Tests.cs @@ -0,0 +1,7 @@ +namespace Volo.Abp.AuditLogging.EntityFrameworkCore +{ + public class AuditStore_Basic_Tests : AuditStore_Basic_Tests + { + + } +} diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AuditStore_Basic_Tests.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AuditStore_Basic_Tests.cs new file mode 100644 index 0000000000..fa7a41ecfd --- /dev/null +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AuditStore_Basic_Tests.cs @@ -0,0 +1,7 @@ +namespace Volo.Abp.AuditLogging.MongoDB +{ + public class AuditStore_Basic_Tests : AuditStore_Basic_Tests + { + + } +} diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs similarity index 82% rename from modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs rename to modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs index bd8891fe17..7b77349b85 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.Tests/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.TestBase/Volo/Abp/AuditLogging/AuditStore_Basic_Tests.cs @@ -4,17 +4,21 @@ using System.Linq; using System.Threading.Tasks; using Shouldly; using Volo.Abp.Auditing; +using Volo.Abp.Modularity; using Xunit; namespace Volo.Abp.AuditLogging { - public class AuditStore_Basic_Tests : AuditLogsTestBase + public abstract class AuditStore_Basic_Tests : AuditLoggingTestBase + where TStartupModule : IAbpModule { private readonly IAuditingStore _auditingStore; + private readonly IAuditLogRepository _auditLogRepository; - public AuditStore_Basic_Tests() + protected AuditStore_Basic_Tests() { _auditingStore = GetRequiredService(); + _auditLogRepository = GetRequiredService(); } [Fact] @@ -41,7 +45,7 @@ namespace Volo.Abp.AuditLogging new EntityChangeInfo { EntityId = Guid.NewGuid().ToString(), - EntityTypeFullName = typeof(AuditStore_Basic_Tests).FullName, + EntityTypeFullName = "Volo.Abp.AuditLogging.TestEntity", ChangeType = EntityChangeType.Created, ChangeTime = DateTime.Now, PropertyChanges = new List @@ -63,7 +67,7 @@ namespace Volo.Abp.AuditLogging //Assert - var insertedLog = GetAuditLogsFromDbContext() + var insertedLog = _auditLogRepository.GetList(true) .FirstOrDefault(al => al.UserId == userId); insertedLog.ShouldNotBeNull();