小编Joe*_*uly的帖子

运行 xunit 测试时无法将输出打印到控制台窗口

public class test2InAnotherProject
{
    private readonly ITestOutputHelper output;

    public test2InAnotherProject(ITestOutputHelper output)
    {
        this.output = output;
    }
    int Diff(int a, int b)
    {
        return (a - b);
    }
    int Div(int a, int b)
    {
        return (b / a);
    }

    [Fact]
    public void Test2()
    {
        int a = 2, b = 4;

        output.WriteLine("Test1: Project 2 in old library");
        int c = Diff(a, b);
        Assert.Equal(c, (a - b));
        output.WriteLine("Test1: Asssert done Project 2 in old library");
    }

    [Fact]
    public void Test3()
    {
        int …
Run Code Online (Sandbox Code Playgroud)

c# xunit

4
推荐指数
2
解决办法
2711
查看次数

Nlog Date布局需要获取长日期的日期时间偏移量

尝试过

${longdate:format=yyyy-MM-ddTHH\\:mm:ss.ffffK} 
Run Code Online (Sandbox Code Playgroud)

但它没有使用 Nlog 将偏移量写入文件中。尝试过

${date:format=yyyy-MM-ddTHH\\:mm:ss.ffffK} 
Run Code Online (Sandbox Code Playgroud)

它给出了偏移量和时间输出。甚至尝试zzz代替K.

我们可以给出在 Nlog consoleLayout.Text 中获取 UTC 偏移量的任何其他用法吗?

c# nlog

3
推荐指数
1
解决办法
2645
查看次数

标签 统计

c# ×2

nlog ×1

xunit ×1