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


C# MessageWriter.WritePredicate方法代码示例

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


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

示例1: WriteDescriptionTo

        /// <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));
            }
        }
开发者ID:zyh329,项目名称:nbi,代码行数:29,代码来源:ContainConstraint.cs

示例2: WriteDescriptionTo

 /// <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);
     }
 }
开发者ID:xplatform,项目名称:Portable.NUnitLite,代码行数:13,代码来源:AttributeConstraint.cs

示例3: WriteDescriptionTo

 /// <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);
     }
 }
开发者ID:gezidan,项目名称:ZYSOCKET,代码行数:14,代码来源:PropertyConstraint.cs

示例4: WriteDescriptionTo

		public override void WriteDescriptionTo(MessageWriter writer)
		{
			writer.WritePredicate("just value");


			if (_valueConstraint is EqualConstraint)
				writer.WritePredicate("equal to");

			_valueConstraint.WriteDescriptionTo(writer);
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:10,代码来源:ValueConstraint.cs

示例5: WriteDescriptionTo

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

示例6: WriteDescriptionTo

 /// <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");
 }
开发者ID:pjcollins,项目名称:Andr.Unit,代码行数:11,代码来源:RegexConstraint.cs

示例7: WriteDescriptionTo

        /// <summary>
        /// Write a description of this constraint to a MessageWriter
        /// </summary>
        /// <param name="writer"></param>
        public override void WriteDescriptionTo(MessageWriter writer)
        {
            switch(expectedCount)
            {
                case 0:
                    writer.WritePredicate("no item");
                    break;
                case 1:
                    writer.WritePredicate("exactly one item");
                    break;
                default:
                    writer.WritePredicate("exactly " + expectedCount.ToString() + " items");
                    break;
            }

            baseConstraint.WriteDescriptionTo(writer);
        }
开发者ID:minhhh,项目名称:nunit-unity3d,代码行数:21,代码来源:ExactCountConstraint.cs

示例8: WriteDescriptionTo

        /// <summary>
        /// Write a description of the constraint to a MessageWriter
        /// </summary>
        /// <param name="writer"></param>
        public override void WriteDescriptionTo(MessageWriter writer)
        {
            if (Command != null)
            {
                var description = new DescriptionStructureHelper();
                var filterExpression = description.GetFilterExpression(Command.Description.Filters);
                var nextTargetExpression = description.GetNextTargetPluralExpression(Command.Description.Target);
                var expectationExpression = new StringBuilder();
                foreach (string item in Expected)
                    expectationExpression.AppendFormat("<{0}>, ", item);
                expectationExpression.Remove(expectationExpression.Length - 2, 2);

                writer.WritePredicate(string.Format("All {0} are defined in the set '{1}' for {2}",
                    nextTargetExpression,
                    expectationExpression.ToString(),
                    filterExpression));
            }
        }
开发者ID:Waltervondehans,项目名称:NBi,代码行数:22,代码来源:SubsetOfConstraint.cs

示例9: WriteDescriptionTo

        /// <summary>
        /// Write a description of the constraint to a MessageWriter
        /// </summary>
        /// <param name="writer"></param>
        public override void WriteDescriptionTo(MessageWriter writer)
        {
            if (Request != null)
            {
                var description = new DescriptionStructureHelper();
                var filterExpression = description.GetFilterExpression(Request.GetAllFilters());
                var nextTargetExpression = description.GetTargetPluralExpression(Request.Target);
                var expectationExpression = new StringBuilder();
                foreach (string item in Expected)
                    expectationExpression.AppendFormat("<{0}>, ", item);
                expectationExpression.Remove(expectationExpression.Length - 2, 2);

                writer.WritePredicate(string.Format("find an exact list of {0} named '{1}' contained {2}",
                    nextTargetExpression,
                    expectationExpression,
                    filterExpression));

            }
        }
开发者ID:zyh329,项目名称:nbi,代码行数:23,代码来源:EquivalentToConstraint.cs

示例10: WriteDescriptionTo

 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate("A fake object wrapper.");
 }
开发者ID:patrik-hagne,项目名称:FakeItEasy,代码行数:4,代码来源:WrappingFakeConstraint.cs

示例11: WriteDescriptionTo

 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate("build target description depending on ");
     writer.WriteExpectedValue(_dependency);
 }
开发者ID:SealedSun,项目名称:prx,代码行数:5,代码来源:DependingOnConstraint.cs

示例12: WriteDescriptionTo

 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate("dictionary containing key ");
     writer.WriteExpectedValue(expected);
 }
开发者ID:serilog-trace-listener,项目名称:serilog-tests-support,代码行数:5,代码来源:DictionaryContainsKeyConstraint.cs

示例13: WriteDescriptionTo

 /// <summary>
 /// Write a description of this constraint to a MessageWriter
 /// </summary>
 /// <param name="writer"></param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate( "subset of" );
     writer.WriteExpectedValue(expected);
 }
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:CollectionConstraints.cs

示例14: WriteDescriptionTo

        /// <summary>
        /// Write a description of the constraint to a MessageWriter
        /// </summary>
        /// <param name="writer"></param>
        public override void WriteDescriptionTo(MessageWriter writer)
        {
            var description = new DescriptionDataTypeHelper();
            var filterExpression = description.GetFilterExpression(Command.Description.Filters.Where(f => f.Target != Command.Description.Target));
            var targetExpression = description.GetTargetExpression(Command.Description.Target);
            var captionExpression = Command.Description.Filters.Single(f => f.Target == Command.Description.Target).Caption;

            writer.WritePredicate(string.Format("the type of {0} '{1}' ({2}) is '{3}'"
                        , targetExpression
                        , captionExpression
                        , filterExpression
                        , expected.ToString()));
        }
开发者ID:Waltervondehans,项目名称:NBi,代码行数:17,代码来源:IsConstraint.cs

示例15: WriteDescriptionTo

 /// <summary>
 /// Write a description of this constraint to a MessageWriter
 /// </summary>
 /// <param name="writer">The MessageWriter to use</param>
 public override void WriteDescriptionTo(MessageWriter writer)
 {
     writer.WritePredicate("instance of");
     writer.WriteExpectedValue(expectedType);
 }
开发者ID:karun10,项目名称:KML2SQL,代码行数:9,代码来源:TypeConstraints.cs


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