Beispiel #1
0
    public void Write_lines()
    {
        XunitLogging.Write("part1");
        XunitLogging.Write(" part2");
        XunitLogging.WriteLine();
        XunitLogging.WriteLine("part3");
        var logs = XunitLogging.Flush();

        ObjectApprover.Verify(logs);
    }
Beispiel #2
0
 public override void WriteLine(string value)
 {
     if (value == null)
     {
         XunitLogging.WriteLine();
     }
     else
     {
         XunitLogging.WriteLine(value);
     }
 }
    public void Usage()
    {
        XunitLogging.WriteLine("From Test");

        ClassBeingTested.Method();

        var logs = XunitLogging.Logs;

        Assert.Contains("From Test", logs);
        Assert.Contains("From Trace", logs);
        Assert.Contains("From Debug", logs);
        Assert.Contains("From Console", logs);
        Assert.Contains("From Console Error", logs);
    }
Beispiel #4
0
    public async Task Async()
    {
        await Task.Delay(1);

        XunitLogging.WriteLine("part1");
        await Task.Delay(1).ConfigureAwait(false);

        XunitLogging.WriteLine("part2");
        await Task.Delay(1).ConfigureAwait(false);

        var logs = XunitLogging.Flush();

        ObjectApprover.Verify(logs);
    }
Beispiel #5
0
    public void Null()
    {
        XunitLogging.WriteLine("XunitLogger.WriteLine");
        XunitLogging.WriteLine();
        XunitLogging.WriteLine("Console.WriteLine(null)");
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
        Console.WriteLine((string)null);
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
        XunitLogging.WriteLine("Debug.WriteLine(null)");
        Debug.WriteLine(null);
        XunitLogging.WriteLine("Debug.Write(null)");
        Debug.Write(null);
        XunitLogging.WriteLine("Trace.WriteLine(null)");
        Trace.WriteLine(null);
        XunitLogging.WriteLine("Trace.Write(null)");
        Trace.Write(null);
        var logs = XunitLogging.Flush();
        ObjectApprover.Verify(logs);
    }
Beispiel #6
0
 public override void WriteLine()
 {
     XunitLogging.WriteLine();
 }