Namespace Serenity.UnityLeaderboard.Tests.Infrastructure
Classes
LeaderboardPlayerIdentityResolverTests
Focused coverage for Serenity.Leaderboard.Infrastructure.Services.LeaderboardPlayerIdentityResolver's
Custom branch — the single source of truth for player-identity
resolution shared by UnityLeaderboardScoreBridge, UnityLeaderboardView and
UnityLeaderboardBestEntryCache, previously exercised only indirectly through those three.
Visible to this assembly via [InternalsVisibleTo("Tests")]
(Unity/Leaderboard/Infrastructure/AssemblyInfo.cs), matching the same pattern the Business
Leaderboard layer already uses for its own internal types.
UnityLeaderboardBestEntryCacheTests
PlayMode tests for UnityLeaderboardBestEntryCache: the cached value stays "not found" until a query completes, a refresh fetches the local player's rank through ILeaderboardService, a LeaderboardEntrySubmittedSignal for the configured board re-triggers a refresh (a different board's does not), and disabling unsubscribes so a later signal no longer reacts.
UnityLeaderboardEndToEndTests
End-to-end PlayMode test: submit through UnityLeaderboardService backed by a real StructuredStoreLeaderboardAdapter over a real KeyValueStructuredStore over a real PlayerPrefs-backed key-value store, then read the top entries back.
UnityLeaderboardScoreSubmitterTests
PlayMode tests for UnityLeaderboardScoreSubmitter: a configured board with a valued
source metric submits (after saving the score snapshot first), an unknown board id is a silent
no-op, an empty board id warns exactly once across repeated calls without touching any service,
unresolved dependencies warn without throwing, and SubmitNow()
stays the void shape a UnityEvent can bind to.
UnityLeaderboardSettingsTests
PlayMode tests for UnityLeaderboardSettings's explicit ILeaderboardSettings mapping from inspector rows to domain definitions.
UnityLeaderboardTopEntryServiceTests
Tests for UnityLeaderboardTopEntryService: an unread board self-primes and returns "not found" until its fetch completes, a fetched board's effective top is served synchronously, LeaderboardEntrySubmittedSignal/LeaderboardClearedSignal re-fetch a tracked board (never an untracked one), a signal-triggered refresh cancels and supersedes one already in flight for that board, and the local player's live IScoreService value overlays the cached top per the board's sort direction when requested.
UnityLeaderboardViewCancelTests
PlayMode tests for UnityLeaderboardView's cancel-return path: pressing Cancel while the
view is shown must route back to ReturnViewId AND pop the navigation-history entry the opener
menu pushed when it transitioned here — otherwise the opener's own next cancel pops that stale entry
and "navigates" to the screen already on display (one dead cancel press). A top entry that does not
name the return target (the view was opened by a signal, not a menu transition) must be left alone.
Inheriting UnityEngine.InputSystem.InputTestFixture isolates and resets the input system per test.
UnityLeaderboardViewRankingModeTests
PlayMode tests proving UnityLeaderboardView's TopEntries query threads RankingMode through to the four-argument GetTopAsync(BoardId, int, LeaderboardRankingMode, CancellationToken) overload — the read path an AllEntries-authored view (wizard or Leaderboard View Designer) relies on to actually show every stored row instead of the collapsed one.