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

            AssertEx.ThrowsAggregateException <JsonReaderException>(
                () => service.ListInstanceEventsAsync(GarbageLocator, CancellationToken.None).Wait());
        }
        public async Task WhenObjectsContainEventExports_ThenListInstanceEventsAsyncReturnsEvents(
            [Credential(Role = PredefinedRole.StorageObjectViewer)] ResourceTask <ICredential> credential)
        {
            var service = new AuditLogStorageSinkAdapter(
                new StorageAdapter(await credential),
                new AuditLogAdapter(await credential));

            var events = await service.ListInstanceEventsAsync(
                new[] { EmptyLocator, ValidLocator_Jan1_00 },
                CancellationToken.None);

            Assert.AreEqual(3, events.Count());
        }
        public async Task WhenObjectIsEmpty_ThenListInstanceEventsAsyncReturnsEmptyListOfEvents(
            [Credential(Role = PredefinedRole.StorageObjectViewer)] ResourceTask <ICredential> credential)
        {
            var service = new AuditLogStorageSinkAdapter(
                new StorageAdapter(await credential),
                new AuditLogAdapter(await credential));

            var events = await service.ListInstanceEventsAsync(
                EmptyLocator,
                CancellationToken.None);

            CollectionAssert.IsEmpty(events);
        }