public void Verify()
    {
        Assert.EndsWith("StaticConstructor.cs", XunitLogging.Context.SourceFile);
        var logs = XunitLogging.Flush();

        ObjectApprover.Verify(logs);
    }
Beispiel #2
0
    public void Overwrites()
    {
        Console.WriteLine("from Console");
        Debug.WriteLine("from Debug");
        Trace.WriteLine("from Trace");
        var logs = XunitLogging.Flush();

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

        ObjectApprover.Verify(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 void Dispose()
 {
     XunitLogging.Flush();
 }