SponsorkitMock

Mock-mode data for SponsorkitOptions.Mock.

On this page

Mock-mode data for SponsorkitOptions.Mock.

namespace Sponsorkit;

public sealed class SponsorkitMock

Properties#

MemberDescription
PresetNamesThe built-in preset names.
PresetNameThe preset name, or null for custom contributions.
ContributionsCustom contributions, or null for a preset.

PresetNames#

public static IReadOnlyList<string> PresetNames { get; } = new[] { "signed-out", "none", "active-monthly", "one-time", "cancelled", "org" };

The built-in preset names.

Type: IReadOnlyList<string> · Default: new[] { "signed-out", "none", "active-monthly", "one-time", "cancelled", "org" }

PresetName#

public string? PresetName { get; }

The preset name, or null for custom contributions.

Type: string?

Contributions#

public IReadOnlyList<Contribution>? Contributions { get; }

Custom contributions, or null for a preset.

Type: IReadOnlyList<Contribution>? (Contribution)

Methods#

MemberDescription
Preset(string)A built-in preset: signed-out, none, active-monthly, one-time, cancelled or org.
WithContributions(IEnumerable<Contribution>)Signed in, with exactly these contributions.

Preset(string)#

public static SponsorkitMock Preset(string name)

A built-in preset: signed-out, none, active-monthly, one-time, cancelled or org.

Parameters

  • name string: The preset name. Unknown names make the client constructor throw invalid_config.

Returns SponsorkitMock

WithContributions(IEnumerable<Contribution>)#

public static SponsorkitMock WithContributions(IEnumerable<Contribution> contributions)

Signed in, with exactly these contributions.

Parameters

  • contributions IEnumerable<Contribution> (Contribution): The contributions to return.

Returns SponsorkitMock

Operators#

MemberDescription
implicit operator SponsorkitMock(string)Converts a preset name.

implicit operator SponsorkitMock(string)#

public static implicit operator SponsorkitMock(string preset)

Converts a preset name.

Parameters

  • preset string: The preset name.

Returns SponsorkitMock