public async Task GetDeletionAuditRecords_FiltersOnMinTimestamp_EntryMissing() { // Arrange var auditingStorage = new MemoryStorage(); var minTimestamp = DefaultAuditRecordTimeStamp.Add(new TimeSpan(1, 0, 0)); AddDummyAuditRecords(auditingStorage); // Act var auditEntries = await DeletionAuditEntry.GetAsync(auditingStorage, CancellationToken.None, minTime : minTimestamp, logger : _logger); // Assert Assert.Empty(auditEntries); }
public async Task GetDeletionAuditRecords_FiltersOnMinTimestamp_EntryExists() { // Arrange var auditingStorage = new MemoryStorage(); var minTimestamp = DefaultAuditRecordTimeStamp.Add(new TimeSpan(1, 0, 0)); AddAuditRecordToMemoryStorage(auditingStorage, package: null, timestamp: minTimestamp); AddDummyAuditRecords(auditingStorage); // Act var auditEntries = await DeletionAuditEntry.GetAsync(auditingStorage, CancellationToken.None, minTime : minTimestamp, logger : _logger); // Assert Assert.Equal(1, auditEntries.Count()); var auditEntry = auditEntries.ElementAt(0); Assert.True(auditEntry.TimestampUtc.HasValue); Assert.True(auditEntry.TimestampUtc.Value.Ticks >= minTimestamp.Ticks); }