using Cleanuparr.Infrastructure.Features.Auth; namespace Cleanuparr.Api.Tests.Features.Auth; /// /// Spy wrapper around that tracks calls to /// for behavioral assertions in timing tests. /// public sealed class TrackingPasswordService : IPasswordService { private readonly PasswordService _inner = new(); private int _verifyPasswordCallCount; public int VerifyPasswordCallCount => _verifyPasswordCallCount; public string DummyHash => _inner.DummyHash; public string HashPassword(string password) { return _inner.HashPassword(password); } public bool VerifyPassword(string password, string hash) { Interlocked.Increment(ref _verifyPasswordCallCount); return _inner.VerifyPassword(password, hash); } public void Reset() { Interlocked.Exchange(ref _verifyPasswordCallCount, 0); } }