public async Task Setup()
        {
            base.SharedSetup();

            _input = new GetTransactionsRequestV1
            {
                Filter = new FileStoreFilterV1
                {
                    TimestampRangeStart = DateTimeOffset.MinValue,
                    TimestampRangeEnd   = DateTimeOffset.MaxValue
                }
            };

            Share1.Setup(s => s.ListAsync(It.IsAny <IPathFilter>(), It.IsAny <CancellationToken>()))
            .Returns(_paths1 = GetSomePaths(1));

            Share2.Setup(s => s.ListAsync(It.IsAny <IPathFilter>(), It.IsAny <CancellationToken>()))
            .Returns(GetNoPaths());

            var fileId = Guid.NewGuid();

            JsonSerialiser.Setup(s => s.Deserialize <TransactionAdapationEventMetadataFile>(It.IsAny <MemoryStream>(), It.IsAny <Encoding>()))
            .ReturnsAsync(_expectedMetadata = new TransactionAdapationEventMetadataFile
            {
                Events = new []
                {
                    TransactionAdaptionEventModel.NewDocumentEvent(fileId)
                }
            });

            _output = await ClassInTest.GetTransactionsAsync(_input, CancellationToken.None);
        }
        public async Task Bad_FileId_Is_FilteredOut_Filter()
        {
            var badEvent = TransactionAdaptionEventModel.NewDocumentEvent();

            badEvent.Properties["FileId"] = "Rgsjrjgkisjghr";
            JsonSerialiser.Setup(s => s.Deserialize <TransactionAdapationEventMetadataFile>(It.IsAny <MemoryStream>(), It.IsAny <Encoding>()))
            .ReturnsAsync(_expectedMetadata = new TransactionAdapationEventMetadataFile
            {
                Events = new[]
                {
                    TransactionAdaptionEventModel.AnalysisCompletedEvent(_fileId),
                    TransactionAdaptionEventModel.FileTypeDetectedEvent(FileType.Bmp, _fileId),
                    TransactionAdaptionEventModel.NcfsCompletedEvent(NcfsOutcome.Blocked, _fileId),
                    TransactionAdaptionEventModel.NcfsStartedEvent(_fileId),
                    badEvent,
                    TransactionAdaptionEventModel.RebuildCompletedEvent(GwOutcome.Failed, _fileId),
                    TransactionAdaptionEventModel.RebuildEventStarting(_fileId),
                }
            });

            _input.Filter.FileIds = new List <Guid> {
                {
                    Guid.NewGuid()
                }
            };

            _output = await ClassInTest.GetTransactionsAsync(_input, CancellationToken.None);

            Assert.That(_output.Count, Is.EqualTo(0));
        }
        public async Task Setup()
        {
            base.SharedSetup();

            _input = new GetTransactionsRequestV1
            {
                Filter = new FileStoreFilterV1
                {
                    TimestampRangeStart = DateTimeOffset.MinValue,
                    TimestampRangeEnd   = DateTimeOffset.MaxValue
                }
            };

            Share1.Setup(s => s.ListAsync(It.IsAny <IPathFilter>(), It.IsAny <CancellationToken>()))
            .Returns(_paths1 = GetSomePaths(1));

            Share2.Setup(s => s.ListAsync(It.IsAny <IPathFilter>(), It.IsAny <CancellationToken>()))
            .Returns(_paths2 = GetSomePaths(2));

            var fileId = Guid.NewGuid();

            JsonSerialiser.Setup(s => s.Deserialize <TransactionAdapationEventMetadataFile>(It.IsAny <MemoryStream>(), It.IsAny <Encoding>()))
            .ReturnsAsync(_expectedMetadata = new TransactionAdapationEventMetadataFile
            {
                Events = new []
                {
                    TransactionAdaptionEventModel.AnalysisCompletedEvent(fileId),
                    TransactionAdaptionEventModel.FileTypeDetectedEvent(FileType.Bmp, fileId),
                    TransactionAdaptionEventModel.NcfsCompletedEvent(NcfsOutcome.Blocked, fileId),
                    TransactionAdaptionEventModel.NcfsStartedEvent(fileId),
                    TransactionAdaptionEventModel.NewDocumentEvent(fileId),
                    TransactionAdaptionEventModel.RebuildCompletedEvent(GwOutcome.Failed, fileId),
                    TransactionAdaptionEventModel.RebuildEventStarting(fileId),
                }
            });

            _output = await ClassInTest.GetTransactionsAsync(_input, CancellationToken.None);
        }