public void A_FlowMonitor_must_return_Received_after_receiving_a_StreamState_message() { var t = this.SourceProbe <FlowMonitor.Received <string> >() .Monitor(Keep.Both) .ToMaterialized(this.SinkProbe <FlowMonitor.Received <string> >(), Keep.Both) .Run(Materializer); var source = t.Item1.Item1; var monitor = t.Item1.Item2; var sink = t.Item2; var message = new FlowMonitor.Received <string>("message"); source.SendNext(message); sink.RequestNext(message); AwaitAssert(() => { var state = monitor.State as FlowMonitor.Received <FlowMonitor.Received <string> >; if (state != null && state.Message == message) { return; } throw new Exception(); }); }
public void A_FlowMonitor_must_return_Received_after_receiving_a_StreamState_message() { var t = this.SourceProbe<FlowMonitor.Received<string>>() .Monitor(Keep.Both) .ToMaterialized(this.SinkProbe<FlowMonitor.Received<string>>(), Keep.Both) .Run(Materializer); var source = t.Item1.Item1; var monitor = t.Item1.Item2; var sink = t.Item2; var messsage = new FlowMonitor.Received<string>("message"); source.SendNext(messsage); sink.RequestNext(messsage); AwaitAssert(() => { var state = monitor.State as FlowMonitor.Received<FlowMonitor.Received<string>>; if (state != null && state.Message == messsage) return; throw new Exception(); }); }