Adding admin controller and service
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user