logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class StubAchievementCondition

    A condition a test drives by hand: it reports whatever the test set, and counts how often it was asked, so a suite can prove a composite really did evaluate every child.

    Inheritance
    object
    StubAchievementCondition
    Namespace: Serenity.Achievements.Tests.Fakes
    Assembly: Tests.dll
    Syntax
    public class StubAchievementCondition : AchievementCondition

    Constructors

    StubAchievementCondition()

    Declaration
    public StubAchievementCondition()

    Properties

    DisplayName

    Declaration
    public override string DisplayName { get; }
    Property Value
    Type Description
    string

    IsMetCallCount

    How many times IsMet(in AchievementEvaluationContext) was called.

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

    KeepsState

    What PersistsState reports.

    Declaration
    public bool KeepsState { get; set; }
    Property Value
    Type Description
    bool

    ListenedSignalTypeNames

    The signal type names this condition claims to listen for.

    Declaration
    public List<string> ListenedSignalTypeNames { get; }
    Property Value
    Type Description
    List<string>

    Met

    Whether this condition currently reports itself as met.

    Declaration
    public bool Met { get; set; }
    Property Value
    Type Description
    bool

    NeedsTick

    Declaration
    public override bool NeedsTick { get; }
    Property Value
    Type Description
    bool

    PersistsState

    Declaration
    public override bool PersistsState { get; }
    Property Value
    Type Description
    bool

    ProgressToReport

    What GetProgress(in AchievementEvaluationContext) reports. Unset means "met or not, nothing between".

    Declaration
    public AchievementConditionProgress? ProgressToReport { get; set; }
    Property Value
    Type Description
    AchievementConditionProgress?

    ResetCallCount

    How many times Reset() was called.

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

    RestoredState

    The last state handed to RestoreState(string).

    Declaration
    public string RestoredState { get; }
    Property Value
    Type Description
    string

    StateToCapture

    What CaptureState() hands back.

    Declaration
    public string StateToCapture { get; set; }
    Property Value
    Type Description
    string

    TicksWithTime

    What NeedsTick reports.

    Declaration
    public bool TicksWithTime { get; set; }
    Property Value
    Type Description
    bool

    ValidationError

    What Validate() reports. Null means valid.

    Declaration
    public string ValidationError { get; set; }
    Property Value
    Type Description
    string

    Methods

    CaptureState()

    Declaration
    public override string CaptureState()
    Returns
    Type Description
    string

    CollectSignalTypeNames(ICollection<string>)

    Declaration
    public override void CollectSignalTypeNames(ICollection<string> sink)
    Parameters
    Type Name Description
    ICollection<string> sink

    GetProgress(in AchievementEvaluationContext)

    Pure on purpose, so a suite counting IsMetCallCount counts evaluations rather than evaluations plus the progress read that follows each one.

    Declaration
    public override AchievementConditionProgress GetProgress(in AchievementEvaluationContext context)
    Parameters
    Type Name Description
    AchievementEvaluationContext context

    What the world looks like at this evaluation.

    Returns
    Type Description
    AchievementConditionProgress

    IsMet(in AchievementEvaluationContext)

    Declaration
    public override bool IsMet(in AchievementEvaluationContext context)
    Parameters
    Type Name Description
    AchievementEvaluationContext context
    Returns
    Type Description
    bool

    Reset()

    Declaration
    public override void Reset()

    RestoreState(string)

    Declaration
    public override void RestoreState(string state)
    Parameters
    Type Name Description
    string state

    Validate()

    Declaration
    public override string Validate()
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved