public override void WriteDescriptionTo(MessageWriter writer) { writer.Write("["); leftConstraint.WriteDescriptionTo(writer); writer.WriteConnector("AND"); rightConstraint.WriteDescriptionTo(writer); writer.Write("]"); }
public override void WriteActualValueTo (MessageWriter writer) { var ex = actual as XamlParseException; writer.WriteActualValue ((actual == null) ? null : actual.GetType ()); if (ex != null) { if (ex.XmlInfo != null && ex.XmlInfo.HasLineInfo ()) writer.Write (" line {0}, position {1}", ex.XmlInfo.LineNumber, ex.XmlInfo.LinePosition); else writer.Write (" no line info"); writer.WriteLine (" ({0})", ex.Message); writer.Write (ex.StackTrace); } }
public override void WriteMessageTo(MessageWriter writer) { if (leftConstraint is BinaryOperator) leftConstraint.WriteMessageTo(writer); else writer.Write("false "); writer.Write("OR"); if (rightConstraint is BinaryOperator) rightConstraint.WriteMessageTo(writer); else writer.Write("false "); base.WriteMessageTo(writer); }
public override void WriteActualValueTo(MessageWriter writer) { writer.WriteActualValue(" found count (" + MatchCount.ToString() + ")"); writer.Write("["); baseConstraint.WriteDescriptionTo(writer); writer.WriteMessageLine("] expected count of {0}", countOccurrence ); }
public override void WriteMessageTo(MessageWriter writer) { foreach (var pair in _Members.Where(item => !item.Value.IsSuccess)) { var member = pair.Key; var result = pair.Value; var type = "void"; if (member is PropertyInfo) { type = (member as PropertyInfo).PropertyType.Name; } if (member is FieldInfo) { type = (member as FieldInfo).FieldType.Name; } writer.Write( "{0}Property [{1} {2}.{3}]\n", _Prefix, type, member.DeclaringType.Name, member.Name ); var twin = result as TwinConstraintResult; if (twin != null) { twin._Prefix = string.Concat(_Prefix, "-- "); } result.WriteMessageTo(writer); } }
/// <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) { //if (actual is string) // writer.WriteExpected(string.Empty); //else writer.Write("<empty>"); }
/// <summary> /// Write the actual value for a failing constraint test to a /// MessageWriter. The default implementation simply writes /// the raw value of actual, leaving it to the writer to /// perform any formatting. /// </summary> /// <param name="writer">The writer on which the actual 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); }
/// <summary> /// Writes the value of the actual object. /// </summary> public void WriteActual(MessageWriter writer) { if (Actual is IMissingMember) { writer.Write("member was missing"); } else if (Actual is IMissingElement) { writer.Write("element was missing"); } else if (Actual is IUnexpectedElement) { writer.WriteActualValue(((IUnexpectedElement)Actual).Element); } else { writer.WriteActualValue(Actual); } }
public override void WriteActualValueTo(MessageWriter writer) { writer.WriteLine("When called with the following arguments the method did not throw the apporpriate exception:"); foreach (var failingCall in this.state.GetFailingCallsDescriptions()) { writer.Write(" "); writer.WriteLine(failingCall); } }
/// <summary> /// Write the actual value for a failing constraint test to a /// MessageWriter. The default implementation simply writes /// the raw value of actual, leaving it to the writer to /// perform any formatting. /// </summary> /// <param name="writer">The writer on which the actual value is displayed</param> public override void WriteActualValueTo(MessageWriter writer) { DirectoryInfo dir = actual as DirectoryInfo; if (dir == null) base.WriteActualValueTo(writer); else { writer.WriteActualValue(dir); writer.Write(" with {0} files and {1} directories", files, subdirs); } }
/// <summary> /// Write the actual value for a failing constraint test to a /// MessageWriter. Overriden to write additional information /// in the case of an Exception. /// </summary> /// <param name="writer">The MessageWriter to use</param> public override void WriteActualValueTo(MessageWriter writer) { Exception ex = actual as Exception; base.WriteActualValueTo(writer); if (ex != null) { writer.WriteLine(" ({0})", ex.Message); writer.Write(ex.StackTrace); } }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { if (Configuration?.FailureReportProfile.Format == FailureReportFormat.Json) writer.Write(failure.RenderMessage()); else { writer.WritePredicate("Execution of the query returns duplicated rows"); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(failure.RenderAnalysis()); } }
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); } }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { writer.Write(Failure.RenderMessage()); } else { base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(); WriteFilterMessageTo(writer); writer.WriteLine(Failure.RenderAnalysis()); } }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { writer.Write(Failure.RenderMessage()); } else { writer.WritePredicate("Execution of the query doesn't match the expected result"); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(Failure.RenderAnalysis()); } }
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"); } }
public override void WriteDescriptionTo(MessageWriter writer) { if (!this.comparisonResults.Any()) return; var sb = new StringBuilder(); foreach (var result in this.comparisonResults) { var difference = result.Differences.Single(); sb.AppendFormat("{0} between: {1} and: {2}\n", result.DifferencesString, difference.ParentObject1.Target, difference.ParentObject2.Target); } writer.Write("Items in collection are not same. Please inspect differences:\n\n{0}", sb); }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { writer.Write(Failure.RenderMessage()); } else { writer.WritePredicate("Score is not sufficient."); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(Failure.RenderMessage()); } }
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"); } }
public override void WriteDescriptionTo(MessageWriter writer) { writer.Write($"No Exception to be thrown"); }
/// <summary> /// Write the actual value for a failing constraint test to a /// MessageWriter. The default implementation simply writes /// the raw value of actual, leaving it to the writer to /// perform any formatting. /// </summary> /// <param name="writer">The writer on which the actual value is displayed</param> public override void WriteActualValueTo(MessageWriter writer) { writer.Write("<{0}>", actual.GetType().Name); }
/// <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"); }
/// <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" ); }
/// <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("xml serializable"); }
/// <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 constraint description to a MessageWriter /// </summary> /// <param name="writer"></param> public override void WriteDescriptionTo(MessageWriter writer) { writer.Write("<empty>"); }
/// <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("<empty>"); }
/// <summary> /// Write the actual 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 actual 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(description); }
public override void WriteDescriptionTo(MessageWriter writer) { if (Same) { writer.WriteExpectedValue(expected1); } else { writer.WritePredicate("To be between"); writer.WriteExpectedValue(expected1); writer.Write(" and "); writer.WriteExpectedValue(expected2); } }
public override void WriteDescriptionTo (MessageWriter writer) { base.WriteDescriptionTo (writer); if (haslineinfo) writer.Write (string.Format (" line {0}, position {1}", linenumber, lineposition)); }
public override void WriteDescriptionTo(MessageWriter writer) { writer.Write("in range ({0},{1})", from, to); }
/// <summary> /// Display the failure information for two collections that did not match. /// </summary> /// <param name="writer">The MessageWriter on which to display</param> /// <param name="expected">The expected collection.</param> /// <param name="actual">The actual collection</param> /// <param name="depth">The depth of this failure in a set of nested collections</param> private void DisplayCollectionDifferences(MessageWriter writer, ICollection expected, ICollection actual, int depth) { DisplayTypesAndSizes(writer, expected, actual, depth); if (failurePoints.Count > depth) { NUnitEqualityComparer.FailurePoint failurePoint = (NUnitEqualityComparer.FailurePoint)failurePoints[depth]; DisplayFailurePoint(writer, expected, actual, failurePoint, depth); if (failurePoint.ExpectedHasData && failurePoint.ActualHasData) DisplayDifferences( writer, failurePoint.ExpectedValue, failurePoint.ActualValue, ++depth); else if (failurePoint.ActualHasData) { writer.Write(" Extra: "); writer.WriteCollectionElements(actual, failurePoint.Position, 3); } else { writer.Write(" Missing: "); writer.WriteCollectionElements(expected, failurePoint.Position, 3); } } }
/// <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"); }
public override void WriteMessageTo(MessageWriter writer) { if (_badProperty != null) writer.Write("{0} does not implement GetHashCode appropriately. {1} does not appear to be included.", ((Type)actual).Name, _badProperty.Name); else writer.Write("{0} does not implement GetHashCode appropriately.", ((Type)actual).Name); }
public override void WriteActualValueTo(MessageWriter writer) { writer.Write(_failedActualValue); }
/// <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")); }
public override void WriteDescriptionTo(MessageWriter writer) { writer.Write(_failedExpectedValue); }
/// <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"); }
/// <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"); }
public override void WriteDescriptionTo(MessageWriter writer) { writer.Write("Link header containing link with "); writer.WriteExpectedValue("rel=" + _expectedRel + " and location=<"+_expectedUri+ ">"); }
/// <summary> /// Display the failure information for two collections that did not match. /// </summary> /// <param name="writer">The MessageWriter on which to display</param> /// <param name="expected">The expected collection.</param> /// <param name="actual">The actual collection</param> /// <param name="depth">The depth of this failure in a set of nested collections</param> private void DisplayCollectionDifferences(MessageWriter writer, ICollection expected, ICollection actual, int depth) { int failurePoint = failurePoints.Count > depth ? (int)failurePoints[depth] : -1; DisplayCollectionTypesAndSizes(writer, expected, actual, depth); if (failurePoint >= 0) { DisplayFailurePoint(writer, expected, actual, failurePoint, depth); if (failurePoint < expected.Count && failurePoint < actual.Count) DisplayDifferences( writer, GetValueFromCollection(expected, failurePoint), GetValueFromCollection(actual, failurePoint), ++depth); else if (expected.Count < actual.Count) { writer.Write( " Extra: " ); writer.WriteCollectionElements( actual, failurePoint, 3 ); } else { writer.Write( " Missing: " ); writer.WriteCollectionElements( expected, failurePoint, 3 ); } } }
/// <summary> /// Displays elements from a collection on a line /// </summary> /// <param name="label">Text to prefix the line with</param> /// <param name="list">The list of items to display</param> /// <param name="index">The index in the collection of the first element to display</param> /// <param name="max">The maximum number of elements to display</param> private void DisplayElements(MessageWriter writer, string prefix, ICollection collection, int index, int max) { writer.Write(prefix + "< "); if (collection == null) writer.Write("null"); else if (collection.Count == 0) writer.Write("empty"); else { for (int i = 0; i < max && index < collection.Count; i++) { if (i > 0) writer.Write(", "); writer.WriteValue(GetValueFromCollection(collection, index++)); } if (index < collection.Count) writer.Write("..."); } writer.Write(" >"); }
/// <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)); }