public void ParseReceiveExpression()
{
Parser parser = new Parser("receive {Sender, ping} -> io:write(\"ping received\"), Sender ! pong; {Sender, pong} -> io:write(\"pong received\"), Sender ! ping end.");
var expr = parser.ParseExpression();
Assert.IsNotNull(expr);
Assert.IsInstanceOfType(expr, typeof(ReceiveExpression));
var rexpr = (ReceiveExpression)expr;
Assert.IsNotNull(rexpr.Matches);
Assert.AreEqual(2, rexpr.Matches.Count);
Assert.IsInstanceOfType(rexpr.Matches[0].Head, typeof(Tuple));
Assert.IsInstanceOfType(rexpr.Matches[1].Head, typeof(Tuple));
Assert.IsInstanceOfType(rexpr.Matches[0].Body, typeof(CompositeExpression));
Assert.IsInstanceOfType(rexpr.Matches[1].Body, typeof(CompositeExpression));
Assert.IsNull(parser.ParseExpression());
}