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

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

    [Test]
    public async Task GetUsers_WhenCalled_ReturnsPagedData()
    {
        //Arrange
        var user = new EditUser();
        var cancellationToken = CancellationToken.None;

        //Act
        var actualResult = await _userManagerController.EditUser(user, cancellationToken);

        //Assert
        Assert.That(actualResult.GetType(), Is.EqualTo(typeof(OkResult)));
        _userManagerMock.Verify(x => x.EditUser(It.IsAny<AuditUserDetails>(), user, cancellationToken), Times.Once);
    }
}