Skip to content

Commit e9ad00a

Browse files
refactor(audience): rename CurrentConsentForTesting → CurrentConsent
The "ForTesting" suffix signalled a test-only affordance, but the accessor is the canonical internal read of the consent level and is used the same way inside the SDK. Drop the suffix. Internal-only API — no SDK consumers break. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6fb7ab0 commit e9ad00a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Packages/Audience/Runtime/ImmutableAudience.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ internal static void ResetState()
720720
}
721721
}
722722

723-
internal static ConsentLevel CurrentConsentForTesting => _state.Level;
723+
internal static ConsentLevel CurrentConsent => _state.Level;
724724

725725
internal static void FlushQueueToDiskForTesting() => _queue?.FlushSync();
726726

src/Packages/Audience/Tests/Runtime/ImmutableAudienceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ public void Init_ConcurrentWithSetConsent_LeavesConsistentState()
677677
// early-returns, Init then initialises with Anonymous.
678678
// - Init runs first: Init sets Anonymous, SetConsent flips
679679
// to None under the lock, consent ends at None.
680-
var finalConsent = ImmutableAudience.CurrentConsentForTesting;
680+
var finalConsent = ImmutableAudience.CurrentConsent;
681681
Assert.That(finalConsent,
682682
Is.EqualTo(ConsentLevel.None).Or.EqualTo(ConsentLevel.Anonymous),
683683
$"iteration {iter}: unexpected final consent {finalConsent}");
@@ -879,7 +879,7 @@ public void SetConsent_PersistsAcrossInit()
879879
// Re-init with the *original* (Anonymous) config — persisted Full should win.
880880
ImmutableAudience.Init(MakeConfig(ConsentLevel.Anonymous));
881881

882-
Assert.AreEqual(ConsentLevel.Full, ImmutableAudience.CurrentConsentForTesting,
882+
Assert.AreEqual(ConsentLevel.Full, ImmutableAudience.CurrentConsent,
883883
"persisted consent must override the config default after restart");
884884
}
885885

0 commit comments

Comments
 (0)