using e_suite.API.Common.models;
using e_suite.Database.Audit;
using Microsoft.AspNetCore.Mvc;
using Moq;
using NUnit.Framework;

namespace eSuite.API.UnitTests.Controllers.SiteControllerUnitTests;

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

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

        var site = new EditSite();

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

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