public void Timed_Source_must_measure_time_it_takes_from_start_to_complete_by_wrapping_operations()
{
var testActor = CreateTestProbe();
var n = 50;
Action<TimeSpan> printInfo = d =>
{
testActor.Tell(d);
_helper.WriteLine($"Processing {n} elements took {d}");
};
var testRuns = new[] {1, 2, 3};
Func<Script<int, int>> script =
() =>
Script.Create(
Enumerable.Range(1, n)
.Select(x => new Tuple<ICollection<int>, ICollection<int>>(new[] {x}, new[] {x})).ToArray());
testRuns.ForEach(
_ => RunScript(script(), Materializer.Settings, flow => flow.Timed(f => f.Select(x => x), printInfo)));
testRuns.ForEach(_ => testActor.ExpectMsg<TimeSpan>());
testActor.ExpectNoMsg(TimeSpan.FromSeconds(1));
}