当前位置: 首页>>代码示例>>C#>>正文


C# MessageWriter.WriteMessageLine方法代码示例

本文整理汇总了C#中NUnit.Framework.Constraints.MessageWriter.WriteMessageLine方法的典型用法代码示例。如果您正苦于以下问题:C# MessageWriter.WriteMessageLine方法的具体用法?C# MessageWriter.WriteMessageLine怎么用?C# MessageWriter.WriteMessageLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NUnit.Framework.Constraints.MessageWriter的用法示例。


在下文中一共展示了MessageWriter.WriteMessageLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteFailureMessageTo

 protected override void WriteFailureMessageTo(MessageWriter writer)
 {
     if (caseInsensitive)
         writer.WriteMessageLine(msg_DoesNotContain_IC);
     else
         writer.WriteMessageLine(msg_DoesNotContain);
 }
开发者ID:RecursosOnline,项目名称:c-sharp,代码行数:7,代码来源:StringConstraints.cs

示例2: WriteActualValueTo

 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);
 }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:7,代码来源:OrOperator.cs

示例3: WriteMessageTo

		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);
			}
		}
开发者ID:pusp,项目名称:o2platform,代码行数:7,代码来源:Constraints.cs

示例4: WriteMessageTo

 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);
     }
 }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:8,代码来源:Constraints.cs

示例5: WriteDescriptionTo

 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 + "\"");
 }
开发者ID:MatteS75,项目名称:coypu,代码行数:8,代码来源:HasCssMatcher.cs

示例6: WriteDescriptionTo

 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())));
     
 }
开发者ID:JamieBenson,项目名称:coypu,代码行数:9,代码来源:HasAllCssInOrderMatcher.cs

示例7: WriteMessageTo

 /// <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);
     }
 }
开发者ID:dotJEM,项目名称:json-nunit,代码行数:11,代码来源:AbstractConstraint.cs

示例8: WriteActualValueTo

 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");
     }
 }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:12,代码来源:AndOperator.cs

示例9: WriteMessageTo

		public override void WriteMessageTo(MessageWriter writer)
		{
			if (_expectedLine == null)
			{
				writer.WriteMessageLine("Expected end of string (null), actual was '{0}'", _actualLine);
				return;
			}
			if (_actualLine == null)
			{
				writer.WriteMessageLine("Expected string '{0}', actual was at end (null)", _expectedLine);
				return;
			}
			writer.DisplayStringDifferences(_expectedLine, _actualLine, 0, false, true);
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:14,代码来源:ConstrainStringByLine.cs

示例10: WriteActualValueTo

 public override void WriteActualValueTo(MessageWriter writer)
 {
     writer.WriteActualValue(" found count (" + MatchCount.ToString() + ")");
     writer.Write("[");
     baseConstraint.WriteDescriptionTo(writer);
     writer.WriteMessageLine("] expected count of {0}", countOccurrence );
 }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:7,代码来源:CountItemConstraint.cs

示例11: WriteDescriptionTo

 public override void WriteDescriptionTo(MessageWriter writer)
 {
     this.actual = "Found " + differencies.Count + " differencies between two objects";
     differencies.ForEach(s =>
     {
         writer.WriteMessageLine(s);
     });
 }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:8,代码来源:ObjectEqualConstraint.cs

示例12: WriteActualValueTo

        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<string>))
                return;

            var isApproximate = false;
            foreach (var actualItem in (actual as IEnumerable<string>))
            {
                var text = string.Empty;
                if (actualItem.ToLowerInvariant() == Expected.ToLowerInvariant())
                    text = string.Format("< <{0}> > (case not matching)", actualItem);
                else if (actualItem.TrimEnd() == Expected)
                    text = string.Format("< <{0}> > (with ending space(s))", actualItem);
                else if (actualItem.TrimStart() == Expected)
                    text = string.Format("< <{0}> > (with leading space(s))", actualItem);
                else if (actualItem.ToLowerInvariant().Trim() == Expected.ToLowerInvariant().Trim())
                    text = string.Format("< <{0}> > (small difference)", actualItem);

                if (!string.IsNullOrEmpty(text))
                {
                    writer.WriteActualValue(text);
                    isApproximate = true;
                }
            }

            if (!isApproximate)
            {

                if (((IEnumerable<string>)actual).Count() == 0)
                    writer.WriteActualValue(new WriterHelper.NothingFoundMessage());
                else
                {
                    base.WriteActualValueTo(writer);
                    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);
                    }
                }
            }
        }
开发者ID:Waltervondehans,项目名称:NBi,代码行数:45,代码来源:ExistsConstraint.cs

示例13: DisplayFailurePoint

        /// <summary>
        /// Displays a single line showing the point in the expected and actual
        /// arrays at which the comparison failed. If the arrays have different
        /// structures or dimensions, both values are shown.
        /// </summary>
        /// <param name="writer">The MessageWriter on which to display</param>
        /// <param name="expected">The expected array</param>
        /// <param name="actual">The actual array</param>
        /// <param name="failurePoint">Index of the failure point in the underlying collections</param>
        /// <param name="indent">The indentation level for the message line</param>
        private void DisplayFailurePoint(MessageWriter writer, ICollection expected, ICollection actual, int failurePoint, int indent)
        {
            Array expectedArray = expected as Array;
            Array actualArray = actual as Array;

            int expectedRank = expectedArray != null ? expectedArray.Rank : 1;
            int actualRank = actualArray != null ? actualArray.Rank : 1;

            bool useOneIndex = expectedRank == actualRank;

            if (expectedArray != null && actualArray != null)
                for (int r = 1; r < expectedRank && useOneIndex; r++)
                    if (expectedArray.GetLength(r) != actualArray.GetLength(r))
                        useOneIndex = false;

            int[] expectedIndices = MsgUtils.GetArrayIndicesFromCollectionIndex(expected, failurePoint);
            if (useOneIndex)
            {
                writer.WriteMessageLine(indent, ValuesDiffer_1, MsgUtils.GetArrayIndicesAsString(expectedIndices));
            }
            else
            {
                int[] actualIndices = MsgUtils.GetArrayIndicesFromCollectionIndex(actual, failurePoint);
                writer.WriteMessageLine(indent, ValuesDiffer_2,
                    MsgUtils.GetArrayIndicesAsString(expectedIndices), MsgUtils.GetArrayIndicesAsString(actualIndices));
            }
        }
开发者ID:RecursosOnline,项目名称:c-sharp,代码行数:37,代码来源:EqualConstraint.cs

示例14: WriteDescriptionTo

     override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WriteMessageLine(
         "meta table of object {0} should contain an entry for key \"{1}\"", actual, _key);
 }
开发者ID:SealedSun,项目名称:prx,代码行数:5,代码来源:Meta.cs

示例15: DisplayStreamDifferences

 private void DisplayStreamDifferences(MessageWriter writer, Stream expected, Stream actual, int depth)
 {
     if (expected.Length == actual.Length)
     {
         long offset = (long)failurePoints[depth];
         writer.WriteMessageLine(StreamsDiffer_1, expected.Length, offset);
     }
     else
         writer.WriteMessageLine(StreamsDiffer_2, expected.Length, actual.Length);
 }
开发者ID:RecursosOnline,项目名称:c-sharp,代码行数:10,代码来源:EqualConstraint.cs


注:本文中的NUnit.Framework.Constraints.MessageWriter.WriteMessageLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。