Class FailableAchievementStore
Decorates an IAchievementStore so a test can make it fail on demand — the way
a remote backend fails: by throwing, not by returning a flag.
Inheritance
FailableAchievementStore
Assembly: Tests.dll
Syntax
public class FailableAchievementStore : IAchievementStore
Constructors
FailableAchievementStore(IAchievementStore)
Wraps a store that works, so failures can be switched on around it.
Declaration
public FailableAchievementStore(IAchievementStore inner)
Parameters
| Type |
Name |
Description |
| IAchievementStore |
inner |
The store every call is forwarded to while no failure is armed.
|
Properties
AlwaysFail
When set, every call throws until it is cleared.
Declaration
public bool AlwaysFail { get; set; }
Property Value
FailNextCall
When set, the next call throws and the flag clears itself.
Declaration
public bool FailNextCall { get; set; }
Property Value
FailOnlyOperationsContaining
When set, only calls whose name contains this text fail. Null fails every call.
Declaration
public string FailOnlyOperationsContaining { get; set; }
Property Value
FailedCallCount
How many calls were made to throw.
Declaration
public int FailedCallCount { get; }
Property Value
Methods
ClearAsync(PlayerId, CancellationToken)
Declaration
public Task ClearAsync(PlayerId player, CancellationToken cancellationToken)
Parameters
Returns
EnsureSchemaAsync(CancellationToken)
Declaration
public Task EnsureSchemaAsync(CancellationToken cancellationToken)
Parameters
Returns
GetProgressAsync(PlayerId, CancellationToken)
Declaration
public Task<IReadOnlyList<AchievementProgress>> GetProgressAsync(PlayerId player, CancellationToken cancellationToken)
Parameters
Returns
GetUnlocksAsync(PlayerId, CancellationToken)
Declaration
public Task<IReadOnlyList<AchievementUnlockRecord>> GetUnlocksAsync(PlayerId player, CancellationToken cancellationToken)
Parameters
Returns
HealthCheckAsync(CancellationToken)
Declaration
public Task<bool> HealthCheckAsync(CancellationToken cancellationToken)
Parameters
Returns
UpsertProgressAsync(PlayerId, AchievementProgress, CancellationToken)
Declaration
public Task UpsertProgressAsync(PlayerId player, AchievementProgress progress, CancellationToken cancellationToken)
Parameters
Returns
UpsertUnlockAsync(AchievementUnlockRecord, CancellationToken)
Declaration
public Task UpsertUnlockAsync(AchievementUnlockRecord record, CancellationToken cancellationToken)
Parameters
Returns
Implements