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 void Setup() { 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(GetSomePaths(1)); Share2.Setup(s => s.ListAsync(It.IsAny <IPathFilter>(), It.IsAny <CancellationToken>())) .Returns(GetNoPaths()); }
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(GetSomePaths()); Share2.Setup(s => s.ListAsync(It.IsAny <IPathFilter>(), It.IsAny <CancellationToken>())) .Returns(GetSomePaths()); _output = await ClassInTest.GetTransactionsAsync(_input, CancellationToken.None); }
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); }