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


C# IOutputWriter.Indent方法代码示例

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


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

示例1: WriteCalls

        private static void WriteCalls(IEnumerable<CallInfo> callInfos, IOutputWriter writer)
        {
            var lastCall = callInfos.Last();
            var numberOfDigitsInLastCallNumber = lastCall.NumberOfDigitsInCallNumber();
            
            foreach (var call in callInfos)
            {
                if (call.CallNumber > 1)
                {
                    writer.WriteLine();
                }

                writer.Write(call.CallNumber);
                writer.Write(": ");

                WriteSpaces(writer, numberOfDigitsInLastCallNumber - call.NumberOfDigitsInCallNumber());

                using (writer.Indent())
                {
                    writer.Write(call.StringRepresentation);
                }
                
                if (call.Repeat > 1)
                {
                    writer.Write(" repeated ");
                    writer.Write(call.Repeat);
                    writer.Write(" times");
                    writer.WriteLine();
                    writer.Write("...");
                }
            }
        }
开发者ID:NameOfTheDragon,项目名称:FakeItEasy,代码行数:32,代码来源:CallWriter.cs

示例2: AppendCallList

 private static void AppendCallList(IEnumerable<IFakeObjectCall> calls, CallWriter callWriter, IOutputWriter writer)
 {
     using (writer.Indent())
     {
         callWriter.WriteCalls(calls, writer);
     }
 }
开发者ID:bman61,项目名称:FakeItEasy,代码行数:7,代码来源:FakeAsserter.cs

示例3: AppendCallList

 private void AppendCallList(IOutputWriter writer)
 {
     using (writer.Indent())
     {
         this.callWriter.WriteCalls(this.Calls, writer);
     }
 }
开发者ID:rajeshpillai,项目名称:FakeItEasy,代码行数:7,代码来源:FakeAsserter.cs

示例4: AppendCallDescription

        private static void AppendCallDescription(string callDescription, IOutputWriter writer)
        {
            writer.WriteLine();
            writer.Write("Assertion failed for the following call:");
            writer.WriteLine();

            using (writer.Indent())
            {
                writer.Write(callDescription);
                writer.WriteLine();
            }
        }
开发者ID:bman61,项目名称:FakeItEasy,代码行数:12,代码来源:FakeAsserter.cs

示例5: WriteDescriptionOfValidCall

        /// <summary>
        /// Writes a description of calls the rule is applicable to.
        /// </summary>
        /// <param name="writer">The writer to write the description to.</param>
        public void WriteDescriptionOfValidCall(IOutputWriter writer)
        {
            writer.Write(this.DescriptionOfValidCall);

            Func<string> wherePrefix = () =>
            {
                wherePrefix = () => "and";
                return "where";
            };

            using (writer.Indent())
            {
                foreach (var wherePredicateDescriptionWriter in this.wherePredicates.Select(x => x.Item2))
                {
                    writer.WriteLine();
                    writer.Write(wherePrefix.Invoke());
                    writer.Write(" ");
                    wherePredicateDescriptionWriter.Invoke(writer);
                }
            }
        }
开发者ID:bverburg,项目名称:FakeItEasy,代码行数:25,代码来源:BuildableCallRule.cs


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