public override void WriteActualValueTo(MessageWriter writer) { writer.WriteActualValue(" found count (" + MatchCount.ToString() + ")"); writer.Write("["); baseConstraint.WriteDescriptionTo(writer); writer.WriteMessageLine("] expected count of {0}", countOccurrence ); }
/// <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.WritePredicate("String matching"); writer.WriteExpectedValue(this.expected); if (this.caseInsensitive) writer.WriteModifier("ignoring case"); }
/// <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 ( propertyExists ) writer.WriteActualValue( propValue ); else writer.WriteActualValue( actual.GetType() ); }
/// <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 (baseConstraint == null) writer.WritePredicate("an exception"); else baseConstraint.WriteDescriptionTo(writer); }
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { if (Configuration?.FailureReportProfile.Format == FailureReportFormat.Json) return; writer.WriteLine("No duplicated row."); }
public override void WriteActualValueTo(NUnitCtr.MessageWriter writer) { if (Configuration?.FailureReportProfile.Format == FailureReportFormat.Json) return; writer.WriteLine(failure.RenderActual()); }
/// <summary> /// Write a description of the constraint to a MessageWriter /// </summary> /// <param name="writer"></param> public override void WriteDescriptionTo(MessageWriter writer) { var description = new DescriptionStructureHelper(); var filterExpression = description.GetFilterExpression(Request.GetAllFilters()); if (Expected.Count() == 1) { writer.WritePredicate(string.Format("find a {0} named '{1}' contained {2}", description.GetTargetExpression(Request.Target), Expected.First(), filterExpression)); } else { var expectationExpression = new StringBuilder(); foreach (string item in Expected) expectationExpression.AppendFormat("<{0}>, ", item); expectationExpression.Remove(expectationExpression.Length - 2, 2); writer.WritePredicate(string.Format("find the {0} named '{1}' contained {2}", description.GetTargetPluralExpression(Request.Target), expectationExpression.ToString(), filterExpression)); } }
protected override void WriteFailureMessageTo(MessageWriter writer) { if (caseInsensitive) writer.WriteMessageLine(msg_DoesNotContain_IC); else writer.WriteMessageLine(msg_DoesNotContain); }
public override void WriteDescriptionTo(MessageWriter writer) { //WritePredicateTo(writer); writer.WriteExpectedValue(expected); //if (ignoreCase) // writer.Write(" ignoring case"); }
public override void WriteActualValueTo(MessageWriter writer) { //IF actual is not empty it means we've an issue with Casing or a space at the end if (actual is IEnumerable<IField> && ((IEnumerable<IField>)actual).Count() == 1) { if (((IEnumerable<IField>)actual).ToArray()[0].Caption.ToLowerInvariant() == Expected.ToLowerInvariant()) writer.WriteActualValue(string.Format("< <{0}> > (case not matching)", ((IEnumerable<IField>)actual).ToArray()[0].Caption)); else if (((IEnumerable<IField>)actual).ToArray()[0].Caption.EndsWith(" ")) writer.WriteActualValue(string.Format("< <{0}> > (with ending space(s))", ((IEnumerable<IField>)actual).ToArray()[0].Caption)); else writer.WriteActualValue(string.Format("< <{0}> > (small difference)", ((IEnumerable<IField>)actual).ToArray()[0].Caption)); } else { Investigate(); if (actual is IEnumerable<IField> && ((IEnumerable<IField>)actual).Count() > 0) base.WriteActualValueTo(writer); else writer.WriteActualValue(new WriterHelper.NothingFoundMessage()); var closeMatch = GetCloseMatch(); if (!string.IsNullOrEmpty(closeMatch)) { writer.WriteMessageLine(""); writer.WriteMessageLine(""); writer.WriteMessageLine(string.Format("The value '{0}' is close to your expectation.", closeMatch)); writer.DisplayStringDifferences(Expected, closeMatch, -1, false, true); } } }
public override void WriteActualValueTo(MessageWriter writer) { writer.WriteMessageLine("Left part failed reason:\n\t"); leftConstraint.WriteActualValueTo(writer); writer.WriteMessageLine("Right part failed reason:\n\t"); rightConstraint.WriteActualValueTo(writer); }
public override void WriteActualValueTo(MessageWriter writer) { if (actual is IEnumerable<IField> && ((IEnumerable<IField>)actual).Count() > 0) base.WriteActualValueTo(writer); else writer.WriteActualValue(new WriterHelper.NothingFoundMessage()); }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine("Actual result-set returned by the query:"); writer.WriteLine(Failure.RenderActual()); }
/// <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>"); }
public override void WriteMessageTo(MessageWriter writer) { if (this.actual is IProperty) { writer.WriteMessageLine("Expected {0} to have an empty {1} accessor but it was not empty {2}.", this.actual, this.accessorText, this.RegionToTest); } else { writer.WriteMessageLine("{0} is not an IProperty; cannot test for the emptiness of a {1} accessor.", this.actual, this.accessorText); } }
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); } }
protected void DisplayDifferences(NUnitCtr.MessageWriter writer, ResultSetCompareResult compareResult) { if (compareResult.Unexpected.Count > 0) { writer.WriteLine(" Unexpected rows:"); writer.WriteLine(); FormatResultSet(writer, compareResult.Unexpected, false); writer.WriteLine(); } if (compareResult.Missing.Count > 0) { writer.WriteLine(" Missing rows:"); writer.WriteLine(); FormatResultSet(writer, compareResult.Missing, false); writer.WriteLine(); } if (compareResult.Duplicated.Count > 0) { writer.WriteLine(" Duplicated rows:"); writer.WriteLine(); FormatResultSet(writer, compareResult.Duplicated, true); writer.WriteLine(); } if (compareResult.NonMatchingValue.Count > 0) { writer.WriteLine(" Non matching value rows:"); writer.WriteLine(); FormatResultSet(writer, compareResult.NonMatchingValue, true); writer.WriteLine(); } }
/// <summary> /// /// </summary> /// <param name="writer"></param> public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { var sb = new System.Text.StringBuilder(); sb.AppendLine("Execution of the query is slower than expected"); sb.AppendFormat("Maximum expected was {0}ms", maxTimeMilliSeconds); writer.WritePredicate(sb.ToString()); }
public override void WriteDescriptionTo(MessageWriter writer) { this.actual = "Found " + differencies.Count + " differencies between two objects"; differencies.ForEach(s => { writer.WriteMessageLine(s); }); }
public override void WriteDescriptionTo(MessageWriter writer) { writer.Write("["); leftConstraint.WriteDescriptionTo(writer); writer.WriteConnector("AND"); rightConstraint.WriteDescriptionTo(writer); writer.Write("]"); }
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { return; } writer.WritePredicate($"no rows validate the predicate '{filter.Describe()}'."); }
public override void WriteMessageTo(MessageWriter writer) { if (writer != null) { foreach (var failure in _failures) { failure.WriteMessageTo(writer); } } }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(); WriteFilterMessageTo(writer); writer.WriteLine(Failure.RenderFiltered()); }
public virtual void WriteFilterMessageTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { return; } writer.WriteLine("Filtered version of the result-set:"); }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { writer.WritePredicate("Execution of the query doesn't match the expected result"); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); DisplayDifferences(writer, result); }
public override void WriteDescriptionTo(MessageWriter writer) { writer.WriteMessageLine("Expected to find element with css selector: {0}\nin:\n{1}", _expectedCss, _actualContent); if (exactText != null) writer.WriteMessageLine("With text: \"" + exactText + "\""); if (textPattern != null) writer.WriteMessageLine("With text matching: \"" + textPattern + "\""); }
public override void WriteMessageTo(MessageWriter writer) { if (this.actual is IMethod) { writer.WriteMessageLine("Expected {0} to have an empty BodyRegion but it was not empty {1}.", this.m, this.m.BodyRegion); } else { writer.WriteMessageLine("{0} is not an IMethod; cannot test for the emptiness of a it's BodyRegion.", this.actual); } }
public override void WriteFilterMessageTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { return; } writer.WriteLine("Rows validating the predicate:"); }
public override void WriteDescriptionTo(MessageWriter writer) { writer.WriteMessageLine("Expected to find elements from css selector: {0}\r\nContaining only:\r\n", _expectedCss); if (exactText != null) writer.WriteMessageLine(string.Format("[{0}]", string.Join(",", exactText))); if (textPattern != null) writer.WriteMessageLine(string.Format("[{0}]", string.Join(",", textPattern.Select(p => p.ToString()).ToArray()))); }
/// <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(NUnitCtr.MessageWriter writer) { writer.WritePredicate(string.Format("On perspective \"{0}\", the {1} of \"{2}\" are ordered {3}{4}" , Request.Perspective , Request.Function.ToLower() , Request.Path , Comparer == null ? "specifically" : ((IComparerWithLabel)Comparer).Label , reversed ? "(descending)" : string.Empty)); }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { writer.WritePredicate("Execution of the query returns duplicated rows"); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(failure.RenderDuplicated()); }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { writer.WritePredicate("Execution of the query doesn't match the expected result"); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(Failure.RenderCompared()); }
/// <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); }
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { var sb = new System.Text.StringBuilder(); sb.AppendLine(); sb.AppendFormat("Successful execution of the etl."); sb.AppendLine(); writer.WritePredicate(sb.ToString()); }
/// <summary> /// Writes a description of the attribute to the specified writer. /// </summary> public override void WriteDescriptionTo(MessageWriter writer) { writer.WritePredicate("attribute " + expectedType.FullName); if (baseConstraint != null) { if (baseConstraint is EqualConstraint) writer.WritePredicate("equal to"); baseConstraint.WriteDescriptionTo(writer); } }
public override void WriteActualValueTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { return; } var value = filterResultSet.Rows.Count; writer.WriteLine($"{value} row{(value > 1 ? "s" : string.Empty)} validate{(value == 1 ? "s" : string.Empty)} the predicate '{filter.Describe()}'."); }
/// <summary/> public override void WriteMessageTo(MessageWriter writer) { writer.WriteMessageLine(GetType().FullName + " Failed!"); using (StringReader reader = new StringReader(message.ToString())) { string line; while ((line = reader.ReadLine()) != null) writer.WriteMessageLine(line); } }
/// <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.WritePredicate("property " + name); if (baseConstraint != null) { if (baseConstraint is EqualConstraint) writer.WritePredicate("equal to"); baseConstraint.WriteDescriptionTo(writer); } }
protected virtual void FormatResultSet(NUnitCtr.MessageWriter writer, ResultSetCompareResult.Sample sample, bool compare) { var textCreator = new ResultSetTextWriter(); var output = textCreator.BuildContent(sample.Rows, sample.Count, compare); foreach (var line in output) { writer.WriteLine(line); } }
public override void WriteDescriptionTo(MessageWriter writer) { writer.WritePredicate("just value"); if (_valueConstraint is EqualConstraint) writer.WritePredicate("equal to"); _valueConstraint.WriteDescriptionTo(writer); }
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); } }
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { return; } writer.WriteLine(); writer.WriteLine(Failure.RenderExpected()); }
/// <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 WriteActualValueTo(NUnitCtr.MessageWriter writer) { if (performanceResult.IsTimeOut) { writer.WriteActualValue(string.Format("query interrupted after {0}ms (timeout)", performanceResult.TimeOut)); } else { writer.WriteActualValue(string.Format("{0}ms", performanceResult.TimeElapsed.TotalMilliseconds)); } }
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { var sb = new System.Text.StringBuilder(); sb.AppendLine("Query is not syntactically correct."); foreach (var failure in parserResult.Errors) { sb.AppendLine(failure); } writer.WritePredicate(sb.ToString()); }
public override void WriteMessageTo(NUnitCtr.MessageWriter writer) { writer.WritePredicate(string.Format("On perspective \"{0}\", {1} " , Request.Perspective , GetPredicate())); writer.WriteLine(); writer.WriteLine(); base.WriteMessageTo(writer); writer.WriteLine(); writer.WriteLine(Failure.RenderAnalysis()); }
protected virtual void FormatResultSet(NUnitCtr.MessageWriter writer, ResultSet resultSet) { var rows = resultSet.Rows.Cast <DataRow>().ToList(); var textCreator = new ResultSetTextWriter(); var output = textCreator.BuildContent(rows, rows.Count(), false); foreach (var line in output) { writer.WriteLine(line); } }
/// <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 constraint description to a MessageWriter /// </summary> /// <param name="writer">The writer on which the description is displayed</param> public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { //writer.WriteActualValue(actual); writer.WritePredicate(string.Format("The formatted value of each cell matchs the")); if (!string.IsNullOrEmpty(regex)) { writer.WritePredicate(" regex pattern "); writer.WritePredicate(regex); } }
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer) { var sb = new System.Text.StringBuilder(); sb.Append("execution of the query returns a row-count"); if (child is NUnitCtr.EqualConstraint) { sb.Append(" equal to"); } writer.WritePredicate(sb.ToString()); child.WriteDescriptionTo(writer); }
public override void WriteActualValueTo(MessageWriter writer) { if (!leftOk) { writer.WriteMessageLine("Left part of the And is false because "); leftConstraint.WriteActualValueTo(writer); } else if (!rightOk) { writer.WriteMessageLine("Right part of the And is false because ", leftOk); rightConstraint.WriteActualValueTo(writer); } else { Debug.Fail("This code should be not reached"); } }
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); } }
/// <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 ) { writer.WriteConnector("+/-"); writer.WriteExpectedValue(tolerance); } if ( this.caseInsensitive ) writer.WriteModifier("ignoring case"); }
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()); } }
/// <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(NUnitCtr.MessageWriter writer) { //writer.WriteActualValue(actual); writer.WritePredicate(string.Format("On perspective \"{0}\", the {1} of \"{2}\" match the" , Request.Perspective , Request.Function.ToLower() , Request.Path)); if (!string.IsNullOrEmpty(regex)) { writer.WritePredicate("regex pattern"); writer.WritePredicate(regex); } }
public override void WriteActualValueTo(NUnitCtr.MessageWriter writer) { if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json) { return; } if (filterResultSet.Rows.Count == 0) { writer.WriteLine($"No row validates the predicate '{filter.Describe()}'."); } else { writer.WriteLine($"{filterResultSet.Rows.Count} rows validate the predicate '{filter.Describe()}'."); } }
public override void WriteActualValueTo(NUnitCtr.MessageWriter writer) { if (invalidMembers.Count == 1) { writer.WriteMessageLine(string.Format("The element <{0}> doesn't validate this pattern", invalidMembers[0])); } else { writer.WriteMessageLine(string.Format("{0} elements don't validate this pattern:", invalidMembers.Count)); foreach (var invalidMember in invalidMembers) { writer.WriteMessageLine(string.Format(" <{0}>", invalidMember)); } } }
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 WriteActualValueTo(NUnitCtr.MessageWriter writer) { if (actual is MemberResult && ((MemberResult)actual).Count() > 0 && ((MemberResult)actual).Count() <= 15) { writer.WriteActualValue((IEnumerable)actual); } else if (actual is MemberResult && ((MemberResult)actual).Count() > 0 && ((MemberResult)actual).Count() > 15) { writer.WriteActualValue(((IEnumerable <NBi.Core.Analysis.Member.Member>)actual).Take(10)); writer.WriteActualValue(string.Format(" ... and {0} others.", ((MemberResult)actual).Count() - 10)); } else { writer.WriteActualValue(new NothingFoundMessage()); } }
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()); } }