using System.Linq.Expressions;
using System.Net;
using Umbraco.Cms.Api.Management.Controllers.Relation;

namespace Umbraco.Cms.Tests.Integration.ManagementApi.Relation;

public class ByRelationTypeKeyRelationControllerTests : ManagementApiUserGroupTestBase<ByRelationTypeKeyRelationController>
{
    protected override Expression<Func<ByRelationTypeKeyRelationController, object>> MethodSelector =>
        x => x.ByRelationTypeKey(CancellationToken.None, Guid.NewGuid(), 0, 100);

    protected override UserGroupAssertionModel AdminUserGroupAssertionModel => new()
    {
        ExpectedStatusCode = HttpStatusCode.BadRequest
    };

    protected override UserGroupAssertionModel EditorUserGroupAssertionModel => new()
    {
        ExpectedStatusCode = HttpStatusCode.BadRequest
    };

    protected override UserGroupAssertionModel SensitiveDataUserGroupAssertionModel => new()
    {
        ExpectedStatusCode = HttpStatusCode.Forbidden
    };

    protected override UserGroupAssertionModel TranslatorUserGroupAssertionModel => new()
    {
        ExpectedStatusCode = HttpStatusCode.Forbidden
    };

    protected override UserGroupAssertionModel WriterUserGroupAssertionModel => new()
    {
        ExpectedStatusCode = HttpStatusCode.BadRequest
    };

    protected override UserGroupAssertionModel UnauthorizedUserGroupAssertionModel => new()
    {
        ExpectedStatusCode = HttpStatusCode.Unauthorized
    };
}
