public async Task WhenEndTimeBeforeStartTime_ThenFindExportObjectsThrowsException(
            [Credential(Role = PredefinedRole.StorageObjectViewer)] ResourceTask <ICredential> credential)
        {
            var service = new AuditLogStorageSinkAdapter(
                new StorageAdapter(await credential),
                new AuditLogAdapter(await credential));

            AssertEx.ThrowsAggregateException <ArgumentException>(
                () => service.FindAuditLogExportObjectsGroupedByDay(
                    GcsTestData.Bucket,
                    new DateTime(2020, 1, 2, 0, 0, 0, DateTimeKind.Utc),
                    new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc),
                    CancellationToken.None).Wait());
        }
        public async Task WhenNoObjectsInRange_ThenFindExportObjectsReturnsEmptyDictionary(
            [Credential(Role = PredefinedRole.StorageObjectViewer)] ResourceTask <ICredential> credential)
        {
            var service = new AuditLogStorageSinkAdapter(
                new StorageAdapter(await credential),
                new AuditLogAdapter(await credential));

            var locators = await service.FindAuditLogExportObjectsGroupedByDay(
                GcsTestData.Bucket,
                new DateTime(2020, 2, 1, 0, 0, 0, DateTimeKind.Utc),
                new DateTime(2020, 2, 2, 0, 0, 0, DateTimeKind.Utc),
                CancellationToken.None);

            CollectionAssert.IsEmpty(locators);
        }
        public async Task WhenObjectsInRange_ThenFindExportObjectsReturnsList(
            [Credential(Role = PredefinedRole.StorageObjectViewer)] ResourceTask <ICredential> credential)
        {
            var service = new AuditLogStorageSinkAdapter(
                new StorageAdapter(await credential),
                new AuditLogAdapter(await credential));

            var jan1 = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc);
            var jan2 = new DateTime(2020, 1, 2, 0, 0, 0, DateTimeKind.Utc);

            var locators = await service.FindAuditLogExportObjectsGroupedByDay(
                GcsTestData.Bucket,
                jan1,
                jan2,
                CancellationToken.None);

            Assert.AreEqual(2, locators.Count()); // 2 days
            Assert.AreEqual(2, locators[jan1].Count());
            Assert.AreEqual(1, locators[jan2].Count());
        }