本文整理汇总了C#中IOutputWriter.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IOutputWriter.Write方法的具体用法?C# IOutputWriter.Write怎么用?C# IOutputWriter.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOutputWriter
的用法示例。
在下文中一共展示了IOutputWriter.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例3: 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();
}
示例4: 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("...");
}
}
}
示例5: WriteDescription
public void WriteDescription(IOutputWriter writer)
{
writer.Write("[");
bool first = true;
foreach (var constraint in this.Constraints)
{
if (!first)
{
writer.Write(", ");
}
else
{
first = false;
}
constraint.WriteDescription(writer);
}
writer.Write("]");
}
示例6: Render
public void Render(object result, IEndpoint endpoint, IOutputWriter outputWriter)
{
var viewEngineResult = viewEngineCollection.FindView(endpoint);
if (viewEngineResult == null) return;
var viewBuilder = new StringBuilder();
var writer = new StringWriter(viewBuilder);
viewEngineResult.View.Render(new ViewContext(result), writer);
outputWriter.Write(viewBuilder.ToString());
outputWriter.WriteContentType(viewEngineResult.View.ContentType);
}
示例7: WriteSpaces
private static void WriteSpaces(IOutputWriter writer, int numberOfSpaces)
{
for (var i = 0; i < numberOfSpaces; i++)
{
writer.Write(" ");
}
}
示例8: 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);
}
}
}
示例9: WriteDescription
public void WriteDescription(IOutputWriter writer)
{
writer.Write(this.ConstraintDescription);
}
示例10: Render
public void Render(object result, IEndpoint endpoint, IOutputWriter outputWriter)
{
outputWriter.Write(result.ToString());
outputWriter.WriteContentType(ContentType.Text);
}
示例11: WriteDescription
public void WriteDescription(IOutputWriter writer)
{
writer.Write(this.ToString());
}
示例12: WriteDescription
public void WriteDescription(IOutputWriter writer)
{
writer.Write("<out parameter>");
}
示例13: Write
public void Write(IOutputWriter writer, string mimeType)
{
writer.Write(_options.Mimetype, _document.OuterXml);
}
示例14: WriteLineOf
private static void WriteLineOf(IOutputWriter outputWriter, string value, int times)
{
for (int i = 0; i < times; i++)
outputWriter.Write(value);
outputWriter.Write("\n");
}
示例15: WriteLineTo
/// <summary>
/// Writes text followed by a newline
/// </summary>
/// <param name="obj">Object</param>
/// <param name="output">Output</param>
public static void WriteLineTo(this IOutputWritable obj, IOutputWriter output) {
obj.WriteTo(output);
output.Write(Environment.NewLine, BoxedTextColor.ReplScriptOutputText);
}