public void A_Scan_must_fail_properly()
{
var scan = Flow.Create<int>().Scan(0, (old, current) =>
{
if (current <= 0)
throw new ArgumentException("current must be greater than zero");
return old + current;
}).WithAttributes(ActorAttributes.CreateSupervisionStrategy(Deciders.RestartingDecider));
Source.From(new[] {1, 3, -1, 5, 7})
.Via(scan)
.RunWith(this.SinkProbe<int>(), Materializer)
.ToStrict(TimeSpan.FromSeconds(1))
.ShouldAllBeEquivalentTo(new[] {0, 1, 4, 0, 5, 12});
}
}