/// <summary>
        ///     Write a description of the constraint to a MessageWriter
        /// </summary>
        /// <param name="writer"></param>
        public override void WriteDescriptionTo(MessageWriter writer)
        {
            if (propertyName == null)
            {
                writer.Write("collection ordered");
            }
            else
            {
                writer.WritePredicate("collection ordered by");
                writer.WriteExpectedValue(propertyName);
            }

            if (descending)
            {
                writer.WriteModifier("descending");
            }
        }
Пример #2
0
        /// <summary>
        ///     Write description of this constraint
        /// </summary>
        /// <param name="writer">The MessageWriter to write to</param>
        public override void WriteDescriptionTo(MessageWriter writer)
        {
            writer.WriteExpectedValue(expected);

            if (tolerance != null && !tolerance.IsEmpty)
            {
                writer.WriteConnector("+/-");
                writer.WriteExpectedValue(tolerance.Value);
                if (tolerance.Mode != ToleranceMode.Linear)
                {
                    writer.Write(" {0}", tolerance.Mode);
                }
            }

            if (comparer.IgnoreCase)
            {
                writer.WriteModifier("ignoring case");
            }
        }
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter. The default implementation simply writes
 ///     the raw value of internalActual, leaving it to the writer to
 ///     perform any formatting.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.Write("<{0}>", internalActual.GetType().Name);
 }
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("binary serializable");
 }
Пример #5
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("An empty directory");
 }
Пример #6
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer"></param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("<empty>");
 }
Пример #7
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     baseConstraint.WriteDescriptionTo(writer);
     writer.Write(string.Format(" after {0} millisecond delay", delayInMilliseconds));
 }
Пример #8
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("null or empty string");
 }
Пример #9
0
 /// <summary>
 ///     Write a description of this constraint to a MessageWriter
 /// </summary>
 /// <param name="writer"></param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("all items unique");
 }
Пример #10
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("in range ({0},{1})", from, to);
 }
Пример #11
0
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("property " + name);
 }
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter. Overridden in ThrowsNothingConstraint to write
 ///     information about the exception that was actually caught.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteLine(" ({0})", caughtException.Message);
     writer.Write(caughtException.StackTrace);
 }
 /// <summary>
 ///     Write the constraint description to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write(string.Format("No Exception to be thrown"));
 }