logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class InMemoryAchievementStore

    In-memory IAchievementStore used for tests. Honors the port's upsert-if-newer contract: a write carrying a revision at or below the stored row is discarded, exactly as a structured backend's UpsertIfBetterAsync would discard it.

    Inheritance
    object
    InMemoryAchievementStore
    Implements
    IAchievementStore
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Achievements.Tests.Fakes
    Assembly: Tests.dll
    Syntax
    public class InMemoryAchievementStore : IAchievementStore

    Constructors

    InMemoryAchievementStore()

    Declaration
    public InMemoryAchievementStore()

    Properties

    EnsureSchemaCallCount

    How many times EnsureSchemaAsync(CancellationToken) has been called.

    Declaration
    public int EnsureSchemaCallCount { get; }
    Property Value
    Type Description
    int

    UpsertProgressCallCount

    How many progress writes reached the store, including the ones the revision check discarded.

    Declaration
    public int UpsertProgressCallCount { get; }
    Property Value
    Type Description
    int

    UpsertUnlockCallCount

    How many unlock writes reached the store, including the ones the revision check discarded.

    Declaration
    public int UpsertUnlockCallCount { get; }
    Property Value
    Type Description
    int

    Methods

    ClearAsync(PlayerId, CancellationToken)

    Declaration
    public Task ClearAsync(PlayerId player, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    PlayerId player
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    EnsureSchemaAsync(CancellationToken)

    Declaration
    public Task EnsureSchemaAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    GetProgressAsync(PlayerId, CancellationToken)

    Declaration
    public Task<IReadOnlyList<AchievementProgress>> GetProgressAsync(PlayerId player, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    PlayerId player
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IReadOnlyList<AchievementProgress>>

    GetUnlocksAsync(PlayerId, CancellationToken)

    Declaration
    public Task<IReadOnlyList<AchievementUnlockRecord>> GetUnlocksAsync(PlayerId player, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    PlayerId player
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IReadOnlyList<AchievementUnlockRecord>>

    HealthCheckAsync(CancellationToken)

    Declaration
    public Task<bool> HealthCheckAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<bool>

    UpsertProgressAsync(PlayerId, AchievementProgress, CancellationToken)

    Declaration
    public Task UpsertProgressAsync(PlayerId player, AchievementProgress progress, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    PlayerId player
    AchievementProgress progress
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    UpsertUnlockAsync(AchievementUnlockRecord, CancellationToken)

    Declaration
    public Task UpsertUnlockAsync(AchievementUnlockRecord record, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AchievementUnlockRecord record
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    Implements

    IAchievementStore
    In this article
    © 2026 Serenity. All Rights Reserved