using e_suite.Database.Audit;
using eSuite.Core.Miscellaneous;
using Microsoft.AspNetCore.Mvc;
using Moq;
using NUnit.Framework;

namespace eSuite.API.UnitTests.Controllers.SiteControllerUnitTests;

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

    [Test]
    public async Task DeleteSite_WhenCalled_ReturnsPagedData()
    {
        //Arrange
        var cancellationToken = CancellationToken.None;

        var site = new GeneralIdRef();

        //Act
        var actualResult = await _siteController.DeleteSite(site, cancellationToken);

        //Assert
        _siteManagerMock.Verify(x => x.DeleteSite(It.IsAny<AuditUserDetails>(), site, true, cancellationToken), Times.Once);
        Assert.That(actualResult.GetType(), Is.EqualTo(typeof(OkResult)));
    }
}