Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Please check the following before creating a Pull Request

  • If this is a new feature or piece of functionality, have you started a discussion and gotten agreement on it?
  • If it fixes a bug or problem, is there an issue to track it? If not, create one first and link it please so there's clear visibility.
  • Did you write tests to ensure you code works properly?

Description

Documentation was referencing internal APIs (TestDetails, ObjectBag, TestInformation) instead of the public interface-based API. Examples used context.TestDetails.TestName when the correct API is context.Metadata.TestName.

Changes:

  • TestDetails → Metadata: Updated 8 files to use context.Metadata.TestDetails or context.Metadata.TestName instead of direct context.TestDetails access
  • ObjectBag → StateBag: Replaced obsolete ObjectBag with StateBag in 4 files
  • TestInformation → Metadata.TestDetails: Fixed outdated TestInformation.CustomProperties pattern

Before:

Console.WriteLine($"Test: {context.TestDetails.TestName}");
context.ObjectBag["key"] = value;

After:

Console.WriteLine($"Test: {context.Metadata.TestName}");
context.StateBag["key"] = value;

Files updated: 12 total (setup.md, cleanup.md, test-context.md, test-variants.md, extension-points.md, performance-best-practices.md, nunit.md, mstest.md, instrumenting-global-test-ids.md, depends-on.md)

Original prompt

This section details on the original issue you should resolve

<issue_title>Documentation needs to be updated: TestDetails --> Metadata</issue_title>
<issue_description>https://tunit.dev/docs/test-lifecycle/setup

before

[Before(Test)]
public async Task Setup(TestContext context, CancellationToken cancellationToken)
{
    // Access test information via context
    Console.WriteLine($"Setting up test: {context.TestDetails.TestName}");

    // Use cancellation token for timeout-aware operations
    await SomeLongRunningOperation(cancellationToken);
}

after

[Before(Test)]
public async Task Setup(TestContext context, CancellationToken cancellationToken)
{
    // Access test information via context
    Console.WriteLine($"Setting up test: {context.Metadata.TestName}");

    // Use cancellation token for timeout-aware operations
    await SomeLongRunningOperation(cancellationToken);
}
```</issue_description>

<agent_instructions>Check all other documentation points for outdated code snippets and API references </agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 10, 2025 07:29
…Properties → Metadata.TestDetails.CustomProperties

Co-authored-by: thomhurst <[email protected]>
Copilot AI changed the title [WIP] Update documentation to reflect Metadata changes docs: Update API references from TestDetails to Metadata interface Nov 10, 2025
Copilot AI requested a review from thomhurst November 10, 2025 07:38
@thomhurst thomhurst marked this pull request as ready for review November 10, 2025 07:53
@thomhurst thomhurst merged commit 3ea315f into main Nov 10, 2025
17 of 21 checks passed
@thomhurst thomhurst deleted the copilot/update-documentation-metadata branch November 10, 2025 07:54
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

Successfully merging this pull request may close these issues.

Documentation needs to be updated: TestDetails --> Metadata

2 participants