Here are the examples of the csharp api Xunit.Context.WriteLine(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : Context.cs
with MIT License
from SimonCropp
with MIT License
from SimonCropp
public void Write(string value)
{
Guard.AgainstNull(value, nameof(value));
lock (locker)
{
ThrowIfFlushed(value);
// Split on '\n'
var start = 0;
do
{
var pos = value.IndexOf('\n', start);
if (pos < 0)
{
// No more '\n' characters.
break;
}
if (pos < 1)
{
// Trim any trailing '\r' in Builder
var end = (Builder?.Length ?? 0) - 1;
if (end > -1 && Builder![Builder.Length - 1] == '\r')
{
Builder.Remove(end, 1);
}
}
var count = (pos > start && value[pos - 1] == '\r' ? pos - 1 : pos) - start;
WriteLine(count > 0 ? value.Substring(start, count) : string.Empty);
start = pos + 1;
} while (start < value.Length);
if (start >= value.Length)
return;
InitBuilder();
Builder?.Append(start > 0 ? value.Substring(start) : value);
}
}
19
Source : Context.cs
with MIT License
from SimonCropp
with MIT License
from SimonCropp
public void WriteLine(object value)
{
Guard.AgainstNull(value, nameof(value));
WriteLine(value.ToString());
}