MessageWriter is the abstract base for classes that write constraint descriptions and messages in some form. The class has separate methods for writing various components of a message, allowing implementations to tailor the presentation as needed.
Inheritance: System.IO.StringWriter
 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(" found count (" + MatchCount.ToString() + ")");
     writer.Write("[");
     baseConstraint.WriteDescriptionTo(writer);
     writer.WriteMessageLine("] expected count of {0}", countOccurrence );
 }
示例#2
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.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() );
		}
示例#4
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)
 {
     if (baseConstraint == null)
         writer.WritePredicate("an exception");
     else
         baseConstraint.WriteDescriptionTo(writer);
 }
示例#5
0
        public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer)
        {
            if (Configuration?.FailureReportProfile.Format == FailureReportFormat.Json)
                return;

            writer.WriteLine("No duplicated row.");
        }
示例#6
0
        public override void WriteActualValueTo(NUnitCtr.MessageWriter writer)
        {
            if (Configuration?.FailureReportProfile.Format == FailureReportFormat.Json)
                return;

            writer.WriteLine(failure.RenderActual());
        }
示例#7
0
        /// <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");
 }
示例#10
0
        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);
                }
            }
        }
示例#11
0
 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);
 }
示例#12
0
 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());
 }
示例#13
0
 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());
 }
示例#14
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)
 {
     //if (actual is string)
     //    writer.WriteExpected(string.Empty);
     //else
         writer.Write("<empty>");
 }
示例#15
0
		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);
            }
        }
示例#17
0
        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();
            }
        }
示例#18
0
        /// <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);
     });
 }
示例#20
0
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.Write("[");
     leftConstraint.WriteDescriptionTo(writer);
     writer.WriteConnector("AND");
     rightConstraint.WriteDescriptionTo(writer);
     writer.Write("]");
 }
示例#21
0
 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);
         }
     }
 }
示例#23
0
 public override void WriteMessageTo(NUnitCtr.MessageWriter writer)
 {
     base.WriteMessageTo(writer);
     writer.WriteLine();
     writer.WriteLine();
     WriteFilterMessageTo(writer);
     writer.WriteLine(Failure.RenderFiltered());
 }
示例#24
0
 public virtual void WriteFilterMessageTo(NUnitCtr.MessageWriter writer)
 {
     if (Configuration.FailureReportProfile.Format == FailureReportFormat.Json)
     {
         return;
     }
     writer.WriteLine("Filtered version of the result-set:");
 }
示例#25
0
 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);
 }
示例#26
0
 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 + "\"");
 }
示例#27
0
 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);
     }
 }
示例#28
0
 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())));
     
 }
示例#30
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(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));
 }
示例#31
0
 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());
 }
示例#32
0
 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());
 }
示例#33
0
 /// <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);
 }
示例#34
0
        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);
     }
 }
示例#36
0
        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()}'.");
        }
示例#37
0
 /// <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);
     }
 }
示例#38
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.WritePredicate("property " + name);
     if (baseConstraint != null)
     {
         if (baseConstraint is EqualConstraint)
             writer.WritePredicate("equal to");
         baseConstraint.WriteDescriptionTo(writer);
     }
 }
示例#39
0
        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);
            }
        }
示例#42
0
        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);
            }
        }
示例#44
0
 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));
     }
 }
示例#45
0
        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());
 }
示例#47
0
        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);
     }
 }
示例#49
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(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);
            }
        }
示例#50
0
        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);
        }
示例#51
0
 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);
			}
		}
示例#53
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 )
			{
				writer.WriteConnector("+/-");
				writer.WriteExpectedValue(tolerance);
			}

			if ( this.caseInsensitive )
				writer.WriteModifier("ignoring case");
        }
示例#54
0
 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());
     }
 }
示例#55
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(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);
            }
        }
示例#56
0
 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()}'.");
     }
 }
示例#57
0
 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));
         }
     }
 }
示例#58
0
 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());
     }
 }
示例#60
0
 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());
     }
 }