Files
nexus/backend-tests/ChatControllerTests.cs
T
AzuTear f5552218bc
CI - Build & Test / Backend (.NET) (push) Successful in 42s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m46s
CI - Build & Test / Security Check (push) Successful in 3s
CI - Build & Test / Deploy Nexus (push) Successful in 56s
feat: ship agent-first mission control v0.2.57
2026-07-31 22:39:47 +02:00

32 lines
868 B
C#

using System.Reflection;
using Microsoft.AspNetCore.Authorization;
using Nexus.Api.Controllers;
using Xunit;
namespace Nexus.Api.Tests;
public sealed class ChatControllerTests
{
[Fact]
public void ChatController_RequiresOwnerAuthorization()
{
var attribute = typeof(ChatController).GetCustomAttribute<AuthorizeAttribute>();
Assert.NotNull(attribute);
Assert.Equal("owner", attribute.Roles);
}
[Fact]
public void Legacy_dashboard_chat_adapter_is_owner_only_and_deprecated()
{
var method = typeof(DashboardController).GetMethod(
nameof(DashboardController.SendChat));
Assert.NotNull(method);
Assert.Equal(
"owner",
method!.GetCustomAttribute<AuthorizeAttribute>()?.Roles);
Assert.NotNull(method.GetCustomAttribute<ObsoleteAttribute>());
}
}