Adding admin controller and service

This commit is contained in:
hz
2025-08-20 16:32:30 -05:00
parent 34742c0759
commit 1e4b8463ee
5 changed files with 71 additions and 10 deletions
+23
View File
@@ -0,0 +1,23 @@
using GameAuthApi.Controllers;
using GameAuthApi.Services;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
public class AdminControllerTests
{
[Fact]
public async Task GetStatus_ReturnsOk()
{
var expected = new Dictionary<string, string> { { "status", "ok" } };
var mockService = new Mock<AdminService>();
mockService.Setup(s => s.GetStatusAsync()).ReturnsAsync(expected);
var controller = new AdminController(mockService.Object);
var result = await controller.GetStatus();
var ok = Assert.IsType<OkObjectResult>(result);
Assert.Equal(expected, ok.Value);
}
}