|
|
|
@ -119,11 +119,11 @@ namespace Volo.Abp.AuditLogging |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)).ConfigureAwait(false); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)).ConfigureAwait(false); |
|
|
|
|
|
|
|
//Assert
|
|
|
|
var logs = await AuditLogRepository.GetListAsync(); |
|
|
|
var logs = await AuditLogRepository.GetListAsync().ConfigureAwait(false); |
|
|
|
logs.ShouldNotBeNull(); |
|
|
|
logs.ShouldContain(x => x.UserId == userId); |
|
|
|
logs.ShouldContain(x => x.UserId == userId2); |
|
|
|
@ -223,11 +223,11 @@ namespace Volo.Abp.AuditLogging |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)).ConfigureAwait(false); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)).ConfigureAwait(false); |
|
|
|
|
|
|
|
//Assert
|
|
|
|
var logs = await AuditLogRepository.GetCountAsync(); |
|
|
|
var logs = await AuditLogRepository.GetCountAsync().ConfigureAwait(false); |
|
|
|
logs.ShouldBe(2); |
|
|
|
} |
|
|
|
|
|
|
|
@ -325,12 +325,12 @@ namespace Volo.Abp.AuditLogging |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log1)).ConfigureAwait(false); |
|
|
|
await AuditLogRepository.InsertAsync(new AuditLog(GuidGenerator, log2)).ConfigureAwait(false); |
|
|
|
|
|
|
|
//Assert
|
|
|
|
var date = DateTime.Parse("2020-01-01"); |
|
|
|
var results = await AuditLogRepository.GetAverageExecutionDurationPerDayAsync(date, date); |
|
|
|
var results = await AuditLogRepository.GetAverageExecutionDurationPerDayAsync(date, date).ConfigureAwait(false); |
|
|
|
results.Count.ShouldBe(1); |
|
|
|
results.Values.First().ShouldBe(50); // (45 + 55) / 2
|
|
|
|
} |
|
|
|
|