本文整理汇总了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("...");
}
}
}
示例2: AppendCallList
private static void AppendCallList(IEnumerable<IFakeObjectCall> calls, CallWriter callWriter, IOutputWriter writer)
{
using (writer.Indent())
{
callWriter.WriteCalls(calls, writer);
}
}
示例3: AppendCallList
private void AppendCallList(IOutputWriter writer)
{
using (writer.Indent())
{
this.callWriter.WriteCalls(this.Calls, writer);
}
}
示例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();
}
}
示例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);
}
}
}