test: Add unicode test cases - #48
Conversation
There was a problem hiding this comment.
Pull request overview
Adds additional test coverage to ensure deterministic hashing/bucketing for targeting keys containing non‑Latin and accented Unicode characters in the .NET OpenFeature provider.
Changes:
- Added xUnit
[InlineData]cases covering several Unicode scripts, emoji, and accented Latin characters forGetNormalizedNumber. - Adjusted one existing test’s toggle setup value (unrelated to the Unicode additions).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| var featureToggles = new FeatureToggles([ | ||
| new FeatureToggleEvaluation("testfeature", true, "evaluation-key", [], 100) | ||
| new FeatureToggleEvaluation("testfeature", false, "evaluation-key", [], 100) |
There was a problem hiding this comment.
This test’s setup change flips the toggle’s enabled value from true to false, but the test evaluates a different flag key ("anotherfeature"), so the enabled value is unused. Since this PR is focused on adding Unicode hashing cases, consider reverting this unrelated change (or add a brief note explaining why it’s needed) to keep the diff minimal and avoid confusion about the test’s intent.
| new FeatureToggleEvaluation("testfeature", false, "evaluation-key", [], 100) | |
| new FeatureToggleEvaluation("testfeature", true, "evaluation-key", [], 100) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public void EvaluatesToDefaultValue_IfFeatureIsNotContainedWithinSet() | ||
| { | ||
| var featureToggles = new FeatureToggles([ | ||
| new FeatureToggleEvaluation("testfeature", true, "evaluation-key", [], 100) | ||
| new FeatureToggleEvaluation("testfeature", false, "evaluation-key", [], 100) | ||
| ], []); |
There was a problem hiding this comment.
This hunk changes the existing "EvaluatesToDefaultValue_IfFeatureIsNotContainedWithinSet" setup from an enabled to a disabled toggle. Since it’s unrelated to the stated goal of adding Unicode hashing test cases, consider reverting this change or updating the PR description to mention the test cleanup (to keep the PR focused).
Background
While adding fractional evaluation to the TypeScript provider library, a gap in testing was identified: correct hashing of strings containing non-Latin alphanumeric characters.
Changes
These align with these PRs for the other libraries: