private static void AppendFailReason(StringBuilder description, CallThatShouldThrow call) { if (call.Thrown == null) { description.Append("did not throw any exception."); } else { var argumentNullException = call.Thrown as ArgumentNullException; if (argumentNullException != null) { description.Append(CommonExtensions.FormatInvariant("threw ArgumentNullException with wrong argument name, it should be \"{0}\".", call.ArgumentName)); } else { description.Append(CommonExtensions.FormatInvariant("threw unexpected {0}.", call.Thrown.GetType().FullName)); } } }
public override void WriteDescriptionTo(MessageWriter writer) { writer.WritePredicate(CommonExtensions.FormatInvariant("Calls to {0} should be null guarded.", this.state.ToString())); }