@@ -129,7 +129,7 @@ public void AnonymousId_ConsentAnonymous_ReturnsPersistedId()
129129 {
130130 ImmutableAudience . Init ( MakeConfig ( ConsentLevel . Anonymous ) ) ;
131131 // Track once so Identity.GetOrCreate runs and writes the id file.
132- ImmutableAudience . Track ( "warmup_event" ) ;
132+ ImmutableAudience . Track ( TestEventNames . WarmupEvent ) ;
133133
134134 var id = ImmutableAudience . AnonymousId ;
135135 Assert . IsFalse ( string . IsNullOrEmpty ( id ) ,
@@ -165,7 +165,7 @@ public void QueueSize_ZeroBeforeInit_GrowsWithEnqueue()
165165 Assert . Greater ( afterInit , 0 ,
166166 "QueueSize should include session_start and game_launch after Init" ) ;
167167
168- ImmutableAudience . Track ( "explicit_track_event" ) ;
168+ ImmutableAudience . Track ( TestEventNames . ExplicitTrackEvent ) ;
169169 Assert . Greater ( ImmutableAudience . QueueSize , afterInit ,
170170 "QueueSize should grow when a new event is enqueued" ) ;
171171 }
@@ -186,7 +186,7 @@ public void ContextProvider_Set_MergesFieldsIntoEveryMessageContext()
186186 } ;
187187
188188 ImmutableAudience . Init ( MakeConfig ( ) ) ;
189- ImmutableAudience . Track ( "unit_test_event" ) ;
189+ ImmutableAudience . Track ( TestEventNames . UnitTestEvent ) ;
190190 ImmutableAudience . Shutdown ( ) ;
191191
192192 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
@@ -234,7 +234,7 @@ public void ContextProvider_ThrowingDelegate_SwallowsAndShipsBaseContext()
234234 ImmutableAudience . ContextProvider = ( ) => throw new InvalidOperationException ( "boom" ) ;
235235
236236 ImmutableAudience . Init ( MakeConfig ( ) ) ;
237- ImmutableAudience . Track ( "unit_test_event" ) ;
237+ ImmutableAudience . Track ( TestEventNames . UnitTestEvent ) ;
238238 ImmutableAudience . Shutdown ( ) ;
239239
240240 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
@@ -250,7 +250,7 @@ public void ContextProvider_ReturnsNull_ShipsBaseContext()
250250 ImmutableAudience . ContextProvider = ( ) => null ;
251251
252252 ImmutableAudience . Init ( MakeConfig ( ) ) ;
253- ImmutableAudience . Track ( "unit_test_event" ) ;
253+ ImmutableAudience . Track ( TestEventNames . UnitTestEvent ) ;
254254 ImmutableAudience . Shutdown ( ) ;
255255
256256 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
@@ -488,7 +488,7 @@ public void Track_CustomEvent_WritesEventToDisk()
488488 {
489489 ImmutableAudience . Init ( MakeConfig ( ) ) ;
490490
491- ImmutableAudience . Track ( "crafting_started" , new Dictionary < string , object >
491+ ImmutableAudience . Track ( TestEventNames . CraftingStarted , new Dictionary < string , object >
492492 {
493493 { "recipe_id" , "iron_sword" }
494494 } ) ;
@@ -511,7 +511,7 @@ public void Track_NoProperties_WritesEvent()
511511 {
512512 ImmutableAudience . Init ( MakeConfig ( ) ) ;
513513
514- ImmutableAudience . Track ( "main_menu_opened" ) ;
514+ ImmutableAudience . Track ( TestEventNames . MainMenuOpened ) ;
515515 ImmutableAudience . Shutdown ( ) ;
516516
517517 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
@@ -525,7 +525,7 @@ public void Track_ConsentNone_DoesNotEnqueue()
525525 {
526526 ImmutableAudience . Init ( MakeConfig ( ConsentLevel . None ) ) ;
527527
528- ImmutableAudience . Track ( "should_not_appear" ) ;
528+ ImmutableAudience . Track ( TestEventNames . ShouldNotAppear ) ;
529529 ImmutableAudience . Shutdown ( ) ;
530530
531531 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
@@ -669,12 +669,12 @@ public void Reset_GeneratesNewAnonymousId()
669669 {
670670 ImmutableAudience . Init ( MakeConfig ( ) ) ;
671671
672- ImmutableAudience . Track ( "before_reset" ) ;
672+ ImmutableAudience . Track ( TestEventNames . BeforeReset ) ;
673673 var id1 = Identity . GetOrCreate ( _testDir , ConsentLevel . Anonymous ) ;
674674
675675 ImmutableAudience . Reset ( ) ;
676676
677- ImmutableAudience . Track ( "after_reset" ) ;
677+ ImmutableAudience . Track ( TestEventNames . AfterReset ) ;
678678 var id2 = Identity . GetOrCreate ( _testDir , ConsentLevel . Anonymous ) ;
679679
680680 Assert . AreNotEqual ( id1 , id2 , "Reset should generate a new anonymousId" ) ;
@@ -685,7 +685,7 @@ public void Reset_DiscardsQueuedEventsOnDisk()
685685 {
686686 ImmutableAudience . Init ( MakeConfig ( ) ) ;
687687
688- ImmutableAudience . Track ( "before_reset" ) ;
688+ ImmutableAudience . Track ( TestEventNames . BeforeReset ) ;
689689 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
690690
691691 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
@@ -707,7 +707,7 @@ public void SetConsent_DowngradeToNone_PurgesQueueOnDiskAndInMemory()
707707 {
708708 ImmutableAudience . Init ( MakeConfig ( ) ) ;
709709
710- ImmutableAudience . Track ( "event_under_old_consent" ) ;
710+ ImmutableAudience . Track ( TestEventNames . EventUnderOldConsent ) ;
711711
712712 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
713713 // Force memory → disk so we can verify the purge wipes both layers.
@@ -746,7 +746,7 @@ public void SetConsent_DowngradeToNone_DropsInFlightTrack_ThatRacesThePurge()
746746 var trackTask = Task . Run ( ( ) =>
747747 {
748748 trackStarted . Set ( ) ;
749- ImmutableAudience . Track ( "racing_event" ) ;
749+ ImmutableAudience . Track ( TestEventNames . RacingEvent ) ;
750750 } ) ;
751751
752752 trackStarted . Wait ( ) ;
@@ -799,7 +799,7 @@ public void SetConsent_DowngradeToNone_StressTest_NoLeak()
799799 trackers [ t ] = Task . Run ( ( ) =>
800800 {
801801 barrier . SignalAndWait ( ) ;
802- ImmutableAudience . Track ( "race_stress" ) ;
802+ ImmutableAudience . Track ( TestEventNames . RaceStress ) ;
803803 } ) ;
804804 }
805805
@@ -988,7 +988,7 @@ public void SetConsent_DowngradeToAnonymous_StressTest_NoUserIdLeak()
988988 trackers [ t ] = Task . Run ( ( ) =>
989989 {
990990 barrier . SignalAndWait ( ) ;
991- ImmutableAudience . Track ( "race_stress" ) ;
991+ ImmutableAudience . Track ( TestEventNames . RaceStress ) ;
992992 } ) ;
993993 }
994994
@@ -1275,7 +1275,7 @@ public void Track_AfterShutdown_IsIgnored()
12751275 ImmutableAudience . Init ( MakeConfig ( ) ) ;
12761276 ImmutableAudience . Shutdown ( ) ;
12771277
1278- Assert . DoesNotThrow ( ( ) => ImmutableAudience . Track ( "should_not_crash" ) ) ;
1278+ Assert . DoesNotThrow ( ( ) => ImmutableAudience . Track ( TestEventNames . ShouldNotCrash ) ) ;
12791279 }
12801280
12811281 [ Test ]
@@ -1291,7 +1291,7 @@ public void Shutdown_ReleasesInitLock_BeforeBlockingTeardown()
12911291 config . ShutdownFlushTimeoutMs = 10_000 ;
12921292
12931293 ImmutableAudience . Init ( config ) ;
1294- ImmutableAudience . Track ( "ensure_nonempty_queue" ) ;
1294+ ImmutableAudience . Track ( TestEventNames . EnsureNonemptyQueue ) ;
12951295 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
12961296
12971297 // Phase 1 flips _initialized and releases the lock; Phase 2 enters
@@ -1327,7 +1327,7 @@ public void FullToAnonymous_StripsUserIdFromQueuedTrackAndDropsIdentifyAlias()
13271327
13281328 ImmutableAudience . Identify ( "player_steam" , IdentityType . Steam ) ;
13291329 ImmutableAudience . Alias ( "player_steam" , IdentityType . Steam , "player_passport" , IdentityType . Passport ) ;
1330- ImmutableAudience . Track ( "tracked_before_downgrade" ) ;
1330+ ImmutableAudience . Track ( TestEventNames . TrackedBeforeDowngrade ) ;
13311331
13321332 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
13331333
@@ -1354,15 +1354,15 @@ public void FullToAnonymous_FutureTracksOmitUserId()
13541354 ImmutableAudience . Identify ( "player_steam" , IdentityType . Steam ) ;
13551355 ImmutableAudience . SetConsent ( ConsentLevel . Anonymous ) ;
13561356
1357- ImmutableAudience . Track ( "tracked_after_downgrade" ) ;
1357+ ImmutableAudience . Track ( TestEventNames . TrackedAfterDowngrade ) ;
13581358 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
13591359
13601360 var queueDir = AudiencePaths . QueueDir ( _testDir ) ;
13611361 var trackFiles = Directory . GetFiles ( queueDir , AudiencePaths . QueueGlob )
13621362 . Select ( f => JsonReader . DeserializeObject ( File . ReadAllText ( f ) ) )
13631363 . Where ( m => ( string ) m [ MessageFields . Type ] == MessageTypes . Track
13641364 && m . ContainsKey ( MessageFields . EventName )
1365- && ( string ) m [ MessageFields . EventName ] == "tracked_after_downgrade" )
1365+ && ( string ) m [ MessageFields . EventName ] == TestEventNames . TrackedAfterDowngrade )
13661366 . ToList ( ) ;
13671367
13681368 Assert . AreEqual ( 1 , trackFiles . Count ) ;
@@ -1382,7 +1382,7 @@ public void SendBatch_ConcurrentTicks_OnlyOneReachesTransport()
13821382 config . HttpHandler = handler ;
13831383
13841384 ImmutableAudience . Init ( config ) ;
1385- ImmutableAudience . Track ( "event_to_send" ) ;
1385+ ImmutableAudience . Track ( TestEventNames . EventToSend ) ;
13861386 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
13871387
13881388 // Kick off one SendBatch on a worker. It will block inside the
@@ -1417,7 +1417,7 @@ public void FlushAsync_ConcurrentCallers_OnlyOneReachesTransport()
14171417 config . HttpHandler = handler ;
14181418
14191419 ImmutableAudience . Init ( config ) ;
1420- ImmutableAudience . Track ( "event_to_send" ) ;
1420+ ImmutableAudience . Track ( TestEventNames . EventToSend ) ;
14211421 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
14221422
14231423 // First caller enters SendAsync and blocks on handler.Release.
@@ -1453,7 +1453,7 @@ public async Task FlushAsync_CancelledToken_Terminates_DoesNotHotLoop()
14531453 config . HttpHandler = handler ;
14541454
14551455 ImmutableAudience . Init ( config ) ;
1456- ImmutableAudience . Track ( "event_to_send" ) ;
1456+ ImmutableAudience . Track ( TestEventNames . EventToSend ) ;
14571457 ImmutableAudience . FlushQueueToDiskForTesting ( ) ;
14581458
14591459 using var cts = new CancellationTokenSource ( ) ;
0 commit comments