public void formattedMessage() { Nack nack = new Nack(); nack.args = new Object[] { "foo", "bar" }; nack.message = "There was a %1 in the %2 (%1, %2) %3 %"; String formattedMessage = nack.FormattedMessage; Assert.AreEqual("There was a foo in the bar (foo, bar) %3 %", formattedMessage); }
public InvalidSubscriptionException(Message request, Nack nack) : base(TextForErrorCode(nack.error) + ": " + nack.FormattedMessage) { switch (request.TypeId) { case SubAddRqst.ID: Expression = ((SubAddRqst)request).subscriptionExpr; break; case SubModRqst.ID: Expression = ((SubModRqst)request).subscriptionExpr; break; default: Expression = ""; break; } Reason = nack.error == NackError.ExpisTrivial ? SubscriptionError.TrivialExpression : SubscriptionError.SyntaxError; }
public RouterNackException(XidMessage request, Nack nack) : base("Router rejected " + request.Name + ": " + nack.ErrorCodeText + ": " + nack.FormattedMessage) { }