Skip to content

[Feature]: IsolatedName is lowercase #6727

Description

@koryphaee

Problem Statement

TestContext.Current.Isolation.GetIsolatedName("db") returns Test_42_db which starts with an uppercase character. This is suboptimal for various use-cases such as Elasticsearch indices which only allow lowercase identifiers.

Proposed Solution

Just change Test_*_* to test_*_*. This tiny change should increase compatibility with external services.

Alternatives Considered

Calling .ToLower() is of course a simple workaround, but I don't see any reason why the default behavior shouldn't be the same with GetIsolatedName() and GetIsolatedPrefix() with the latter already returning a lowercase string.

Feature Category

Test Execution / Lifecycle

How important is this feature to you?

Nice to have - would improve my experience

Additional Context

Technically this is a breaking change but I doubt it will break much. The method only claims to provide a unique value which it will still do afterwards.

Relevant class: https://github.com/thomhurst/TUnit/blob/main/src/TUnit.Core/TestContext.Isolation.cs

Contribution

  • I'm willing to submit a pull request for this feature

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions