Exemple #1
0
        /// <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)
        {
            var dir = internalActual as DirectoryInfo;

            if (dir == null)
            {
                base.WriteActualValueTo(writer);
            }
            else
            {
                writer.WriteActualValue(dir);
                writer.Write(" with {0} files and {1} directories", files, subdirs);
            }
        }
Exemple #2
0
 /// <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)
 {
     if (caughtException == null)
     {
         writer.Write("no exception thrown");
     }
     else if (baseConstraint != null)
     {
         baseConstraint.WriteActualValueTo(writer);
     }
     else
     {
         writer.WriteActualValue(caughtException);
     }
 }
Exemple #3
0
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter. TypeConstraints override this method to write
 ///     the name of the type.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(internalActual == null ? null : internalActual.GetType());
 }
Exemple #4
0
 /// <summary>
 ///     Writes the internalActual value supplied to the specified writer.
 /// </summary>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(attrFound);
 }
 /// <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.WriteActualValue(propValue);
 }
Exemple #6
0
 /// <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 virtual void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(internalActual);
 }
Exemple #7
0
 /// <summary>
 ///     Write the internalActual value for a failing constraint test to a
 ///     MessageWriter.
 /// </summary>
 /// <param name="writer">The writer on which the internalActual value is displayed</param>
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(actualType);
 }