Skip to content

test: Add normalized number expected values tests#47

Open
liamhughes wants to merge 3 commits intomainfrom
liamhughes/devex-82-add-normalized-number-expected-values-tests
Open

test: Add normalized number expected values tests#47
liamhughes wants to merge 3 commits intomainfrom
liamhughes/devex-82-add-normalized-number-expected-values-tests

Conversation

@liamhughes
Copy link
Copy Markdown
Contributor

Background

We are implementing client-side percentage rollout evaluation to our three OpenFeature provider libraries.

The .NET provider had this added in #45.

These expected values tests are being added as part of implementing the same logic in the Java provider in order to ensure that the same normalised number generation occurs in all of our provider libraries.

See OctopusDeploy/openfeature-provider-java#8 for the Java library equivalent.

@liamhughes liamhughes changed the title Add normalized number expected values tests test: Add normalized number expected values tests Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds cross-provider “expected values” tests to ensure the .NET provider’s normalized number bucketing stays consistent with other Octopus OpenFeature provider implementations (e.g., Java) for percentage rollouts.

Changes:

  • Exposes OctopusFeatureContext.GetNormalizedNumber as internal static so it can be directly asserted in test assemblies.
  • Adds a large set of theory cases asserting exact normalized bucket outputs for known (evaluationKey, targetingKey) pairs.
  • Simplifies the .csproj InternalsVisibleTo declarations into a single ItemGroup (no functional change).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Octopus.OpenFeature.Provider/OctopusFeatureContext.cs Makes normalized bucket generator accessible to tests (internal static).
src/Octopus.OpenFeature.Provider/Octopus.OpenFeature.Provider.csproj Keeps InternalsVisibleTo entries, just removes redundant ItemGroup separation.
src/Octopus.OpenFeature.Provider.Tests/OctopusFeatureContextTests.cs Adds deterministic expected-value coverage for normalized bucketing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants