/// <summary> /// Gets the process result. /// </summary> public FlowSnapShot <TTarget> GetProcessResult() { // load results to get the invalid items FlowSnapShot <TTarget> result = _resultRepo.Get(DataSource.FullName); return(result); }
/// <summary> /// Gets the reader function. /// </summary> /// <returns></returns> private static IReader <TIn> GetReader() { return(new GenericResultReader <TIn>(flowFileSource => { var repoository = new FlowSnapshotRepo <FlowSnapShot <TIn> >(flowFileSource); var processResult = repoository.Get(flowFileSource); return processResult.Valid; })); }
protected void ThenShouldNotBeAbleToLoadNonExistingSnapShot() { var flowSnapShot = new FlowSnapShot <TargetType>(_batch); var resultRepo = new FlowSnapshotRepo <FlowSnapShot <TargetType> >(); var loadedSnapShot = resultRepo.Get( new FlowEntity(typeof(TargetType)).EntityTypeId, "SampleFlow", 2); // batch does not exist Assert.Null(loadedSnapShot); }
protected void AndThenShouldBeAbleToRestoreProcessState() { var repo = new FlowSnapshotRepo <FlowSnapShot <Dto1> >(Environment.CurrentDirectory); var targetEntityType = new FlowEntity(typeof(Dto2)); var result = repo.Get(targetEntityType.EntityTypeId, _flow.Code, BatchId); Assert.NotNull(result); Assert.Equal(CsvItemsToCreate - 1, result.ProcessedCount); Assert.Empty(result.Errors); }
protected void ThenShouldBeAbleToLoadTheSnapShot() { var flowSnapShot = new FlowSnapShot <TargetType>(_batch); var resultRepo = new FlowSnapshotRepo <FlowSnapShot <TargetType> >(); var loadedSnapShot = resultRepo.Get( new FlowEntity(typeof(TargetType)).EntityTypeId, "SampleFlow", 1); Assert.NotNull(loadedSnapShot); Assert.NotNull(loadedSnapShot.Valid.FirstOrDefault(m => m.Name == "Name")); Assert.NotNull(loadedSnapShot.Valid.FirstOrDefault(m => m.MaybeInt == 2)); Assert.True(loadedSnapShot.Valid.Last()?.MaybeInt == 3); Assert.NotNull(loadedSnapShot.TargetType); }