Class FakeAchievementPlatformGateway
Scriptable IAchievementPlatformGateway used for tests: an in-memory unlocked
set, a switchable availability flag, and a one-shot failure so the offline-retry and
never-throw paths can be exercised without a real storefront SDK.
Inheritance
FakeAchievementPlatformGateway
Assembly: Tests.dll
public class FakeAchievementPlatformGateway : IAchievementPlatformGateway, IDisposable
Constructors
Declaration
public FakeAchievementPlatformGateway()
Properties
The progress reports the gateway accepted, in call order.
Declaration
public List<string> AcceptedProgressReports { get; }
Property Value
How many unlock pushes the gateway accepted.
Declaration
public int AcceptedUnlockCount { get; }
Property Value
Whether the gateway reports itself reachable.
Declaration
public bool Available { get; set; }
Property Value
Declaration
public int ClearCallCount { get; }
Property Value
Declaration
public int DisposeCallCount { get; }
Property Value
When set, the next call fails: it returns false, or throws when ThrowOnFailure is on.
Declaration
public bool FailNextCall { get; set; }
Property Value
When set, only QueryUnlockedAsync(CancellationToken) fails, and it fails every time. Lets a
test reach the "the account could not be read" branch without also failing the
initialize that runs before it.
Declaration
public bool FailQueryUnlockedCalls { get; set; }
Property Value
When set, every call never returns until its token is cancelled — the shape of a
storefront SDK that has stopped answering, which is what the call timeout exists for.
Declaration
public bool HangOnEveryCall { get; set; }
Property Value
Declaration
public bool IsAvailable { get; }
Property Value
Declaration
public string Name { get; set; }
Property Value
Declaration
public string PlatformName { get; }
Property Value
When set, Dispose() throws instead of recording the call.
Declaration
public bool ThrowOnDispose { get; set; }
Property Value
Whether a failing call throws instead of returning false.
Declaration
public bool ThrowOnFailure { get; set; }
Property Value
Methods
Declaration
public Task<bool> ClearAsync(CancellationToken cancellationToken)
Parameters
Returns
Declaration
HasUnlocked(AchievementId)
Whether the platform account carries an achievement.
Declaration
public bool HasUnlocked(AchievementId achievement)
Parameters
| Type |
Name |
Description |
| AchievementId |
achievement |
The achievement to test.
|
Returns
Declaration
public Task<bool> InitializeAsync(CancellationToken cancellationToken)
Parameters
Returns
Declaration
public Task<PlatformUnlockQueryResult> QueryUnlockedAsync(CancellationToken cancellationToken)
Parameters
Returns
SeedUnlocked(AchievementId)
Seeds the platform account with an achievement the local store may not know about.
Declaration
public void SeedUnlocked(AchievementId achievement)
Parameters
| Type |
Name |
Description |
| AchievementId |
achievement |
The achievement the platform already carries.
|
SetProgressAsync(AchievementDefinition, long, long, CancellationToken)
Declaration
public Task<bool> SetProgressAsync(AchievementDefinition definition, long current, long target, CancellationToken cancellationToken)
Parameters
Returns
UnlockAsync(AchievementDefinition, CancellationToken)
Declaration
public Task<bool> UnlockAsync(AchievementDefinition definition, CancellationToken cancellationToken)
Parameters
Returns
Implements