本文整理汇总了C#中IOutputWriter.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# IOutputWriter.WriteLine方法的具体用法?C# IOutputWriter.WriteLine怎么用?C# IOutputWriter.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOutputWriter
的用法示例。
在下文中一共展示了IOutputWriter.WriteLine方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: 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("...");
}
}
}
示例3: AppendExpectation
private static void AppendExpectation(IEnumerable<IFakeObjectCall> calls, string repeatDescription, int matchedCallCount, IOutputWriter writer)
{
writer.Write("Expected to find it {0} ", repeatDescription);
if (calls.Any())
{
writer.Write("but found it #{0} times among the calls:", matchedCallCount);
}
else
{
writer.Write("but no calls were made to the fake object.");
}
writer.WriteLine();
}
示例4: PrintToConsole
public void PrintToConsole(IOutputWriter writer)
{
writer.WriteLine("\n" + _label + ":");
for (int j = 0; j < NumberOfDecisonVariables; ++j)
{
if (this[j].Get(GRB.DoubleAttr.X) > 0.0001)
{
writer.WriteLine(this[j].Get(GRB.StringAttr.VarName) + " " +
this[j].Get(GRB.DoubleAttr.X));
}
}
}
示例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);
}
}
}
示例6: AppendExpectation
private void AppendExpectation(string repeatDescription, int repeat, IOutputWriter writer)
{
writer.Write("Expected to find it {0} ", repeatDescription);
if (this.Calls.Any())
{
writer.Write("but found it #{0} times among the calls:", repeat);
}
else
{
writer.Write("but no calls were made to the fake object.");
}
writer.WriteLine();
}