首页 > 解决方案 > xUnit and test output in VSTS (to logs)

问题描述

I have a .NET Standard 2.0 library and xUnit test project for it. The test runs fine locally (Debug and Release, it has different settings) and then it doesn't work when published to VSTS. So I need some king of tracing/logging when it runs there. What to use with xUnit to be able to see test output in the VSTS logs?

The test looks like this:

public class BlobHelperShould : TestBase
{
    public BlobHelperShould(ITestOutputHelper output) : base(output)
    {
        LoggerFactoryFixture loggerFactoryFixture = new LoggerFactoryFixture();
        // ... skip
    }

    // ... and then the tests go here

}

So I have ITestOutputHelper available. But if I use WriteLine I don't get anything in VSTS logs.

标签: c#testingazure-devopsxunit

解决方案


推荐阅读