Skip to content

Empty LogContext with update of MSTest #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
milbrandt opened this issue Apr 11, 2024 · 2 comments
Closed

Empty LogContext with update of MSTest #71

milbrandt opened this issue Apr 11, 2024 · 2 comments

Comments

@milbrandt
Copy link

The following test works fine with MSTest.TestAdapter 3.2.2 for net6.0. In 3.3.0 the test fails, Only the NuGet was updated.
Maybe a change based on Merge all implementations of TestContext is required in the TestCorrelator?

    [TestMethod]
    public void MessageDataNullCorrelationIdLogContainsMethodName()
    {
        // Arrange
        using (TestCorrelator.CreateContext())
        {
            var msg = new Message<int>(null!, 5, null, null!);

            // Act
            _ = msg.MessageData;

            // Assert
            var logContext = TestCorrelator.GetLogEventsFromCurrentContext().ToList();
            Assert.AreNotEqual(0, logContext.Count, "logContext should contain data");
        }
    }
Repository owner deleted a comment May 26, 2024
@MitchBodmer
Copy link
Owner

I don't see any log events being emitted here, but I'm assuming you expect there to be some in either the constructor or the property access. Does this still happen if you log explicitly within the context?

@MitchBodmer
Copy link
Owner

I've done some testing recently with the most up to date versions of MSTest and never reproduced this. I'm going to close this since I never heard back from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants