private string HandleToken(string className, Rule rule, Token token)
        {
            Func<string, Rule, Token, string> handler;
            tokenStringifiers.TryGetValue(token.Id, out handler);

            return handler != null ? handler(className, rule, token) : null;
        }
        public string Document(string className, Rule rule)
        {
            var tokens = rule.Details.ToArray();
            if (tokens.Length == 0)
            {
                return string.Empty;
            }

            var ruleDetails = string.Join(" and ", tokens.Where(w => w.Id != "when").Select(t => HandleToken(className, rule, t)));
            var conditionalDetails = string.Join(" and ", tokens.Where(w => w.Id == "when").Select(t => HandleToken(className, rule, t)));
            return rule.Name + " " +
                   ruleDetails +
                   (ruleDetails != string.Empty && conditionalDetails != string.Empty ? " " : string.Empty) +
                   conditionalDetails;
        }
        private string MustParser(string className, Rule rule, Token token)
        {
            var info = token.Info as SimpleLambdaExpressionSyntax;

            var details =
                info != null ?
                "satisfy " + lamdaDocumenter.Document(friendly.Get(rule.Name), info) :
                friendly.Get(token.Info.ToString());
            return "must " + details;
        }
 private string WhenParser(string className, Rule rule, Token token)
 {
     var info = token.Info as SimpleLambdaExpressionSyntax;
     var details = info != null ? lamdaDocumenter.Document(friendly.Get(className), info) : friendly.Get(token.Info.ToString());
     return "when " + details;
 }