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.DomainControllerUnitTests;

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

    [Test]
    public async Task EditDomain_WhenCalled_ReturnsOKResult()
    {
        //Arrange
        var editDomain = new EditDomain
        {
        };

        var cancellationToken = CancellationToken.None;

        //Act
        var actualResult = await _domainController.EditDomain(editDomain, cancellationToken);

        //Assert
        _domainManagerMock.Verify(x => x.EditDomainAsync(It.IsAny<AuditUserDetails>(), editDomain, cancellationToken), Times.Once);

        Assert.That(actualResult.GetType(), Is.EqualTo(typeof(OkResult)));
    }
}