using ZB.MOM.WW.Secrets.Abstractions;

namespace ZB.MOM.WW.Secrets.Tests.Fakes;

/// <summary>Records every eviction so tests can assert the resolver cache was cleared.</summary>
public sealed class RecordingCacheInvalidator : ISecretCacheInvalidator
{
    private readonly List<SecretName> _invalidated = [];

    /// <summary>The names evicted, in call order.</summary>
    public IReadOnlyList<SecretName> Invalidated => _invalidated;

    /// <inheritdoc />
    public void Invalidate(SecretName name) => _invalidated.Add(name);
}
