public void SupportsBlocksThatAreBothSourceAndTarget() { var sourceNode = new OneSourceNode <int>(); var transformationNode = new TransformationNode <int, string>(i => i.ToString()); var targetNode = new OneTargetNode <string>(); LinkNodes(sourceNode, transformationNode, targetNode); sourceNode.Post1(42); Assert.Equal("42", targetNode.EventuallyReceive1()); }
public void LinksSourceToTargetsOfAssignableType() { var sourceNodeV1 = new OneSourceNode <V1 <int, long> >(); var targetNodeIV0 = new OneTargetNode <IV0 <int> >(); var targetNodeIV1 = new OneTargetNode <IV1 <int, long> >(); var message = new V1 <int, long>(1, 2); LinkNodes(sourceNodeV1, targetNodeIV0, targetNodeIV1); sourceNodeV1.Post1(message); Assert.Equal(message.P1, targetNodeIV0.EventuallyReceive1().P1); Assert.Equal(message, targetNodeIV1.EventuallyReceive1()); }