public void A_Partition_must_complete_stage_after_upstream_completes()
{
this.AssertAllStagesStopped(() =>
{
var c1 = TestSubscriber.CreateProbe<string>(this);
var c2 = TestSubscriber.CreateProbe<string>(this);
RunnableGraph.FromGraph(GraphDsl.Create(b =>
{
var partition = b.Add(new Partition<string>(2, s => s.Length > 4 ? 0 : 1));
var source = Source.From(new[] {"this", "is", "just", "another", "test"});
b.From(source).To(partition.In);
b.From(partition.Out(0)).To(Sink.FromSubscriber(c1));
b.From(partition.Out(1)).To(Sink.FromSubscriber(c2));
return ClosedShape.Instance;
})).Run(Materializer);
c1.Request(1);
c2.Request(4);
c1.ExpectNext("another");
c2.ExpectNext("this", "is", "just", "test");
c1.ExpectComplete();
c2.ExpectComplete();
}, Materializer);
}