Adding
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using LCU.Library.Internal.StatusModels.Models;
|
||||
using LCU.API.Internal.LoanRate.Controllers;
|
||||
using LCU.API.Internal.LoanRate.Services;
|
||||
namespace LCU.API.Internal.LoanRateTests.ControllerTests;
|
||||
|
||||
public class StatusControllerTest
|
||||
{
|
||||
private readonly StatusController controller;
|
||||
private readonly Mock<IStatusService> _mockStatusService;
|
||||
|
||||
public StatusControllerTest()
|
||||
{
|
||||
_mockStatusService = new Mock<IStatusService>();
|
||||
controller = new StatusController(_mockStatusService.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateStatus_Ok()
|
||||
{
|
||||
// Arrange
|
||||
var status = new EnvironmentView()
|
||||
{
|
||||
Application = "Test.Application.Name",
|
||||
CurrentDate = DateTime.Now,
|
||||
BuildVersion = "1.1.1",
|
||||
BuildDate = DateTime.Now.AddDays(-1),
|
||||
Environment = "TestEnvironment"
|
||||
};
|
||||
|
||||
_mockStatusService.Setup(service => service.GetEnviromentView()).Returns(status);
|
||||
|
||||
// Act
|
||||
var result = controller.Get();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(result);
|
||||
var okResult = result as OkObjectResult;
|
||||
Assert.NotNull(okResult);
|
||||
Assert.Equal(200, okResult.StatusCode);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user