using NUnit.Framework;
using UserManager.UnitTests.Helpers;

namespace UserManager.UnitTests.UserManagerMaintenance;

[TestFixture]
public class ClearOldEmailActionsUnitTests : UserManagerMaintenanceTestBase
{
    [SetUp]
    public override async Task Setup()
    {
        await base.Setup();
    }

    [Test]
    public async Task ClearOldEmail()
    {
        //Arrange

        //Act
        await UserManagerManagerMaintenance.ClearOldEmailActions();

        //Assert
        Assert.That(UserManagerRepository.DeleteExpiredEmailUserActionsCalled, Is.True);
    }
}

[TestFixture]
public class ClearOldSingleUserGuidsUnitTests : UserManagerMaintenanceTestBase
{
    [SetUp]
    public override async Task Setup()
    {
        await base.Setup();
    }

    [Test]
    public async Task ClearOldSingleUserGuids()
    {
        //Arrange

        //Act
        await UserManagerManagerMaintenance.ClearOldSingleUserGuids();

        //Assert
        Assert.That(UserManagerRepository.DeleteExpiredSingleUseGuidsCalled, Is.True);
    }
}