81 lines
2.7 KiB
C#
81 lines
2.7 KiB
C#
using LCU.API.Collections.RepoApi.Controllers;
|
|
using LCU.API.Collections.RepoApi.Models.Requests;
|
|
using LCU.API.Collections.RepoApi.Services.Reporting;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Moq;
|
|
using Xunit;
|
|
|
|
namespace LCU.API.Collections.RepoApiTests.Controllers
|
|
{
|
|
public class ReportingControllerTest
|
|
{
|
|
private readonly ReportingController controller;
|
|
private readonly Mock<ILandmarkReportingService> mockLandmarkReportingService;
|
|
private readonly Mock<IAuctionReportingService> mockAuctionReportingService;
|
|
private readonly Mock<IRepoCompanyReportingService> mockRepoCompanyReportingService;
|
|
private readonly Mock<IHttpContextAccessor> mockHttpContextAccessor;
|
|
|
|
public ReportingControllerTest()
|
|
{
|
|
mockLandmarkReportingService = new Mock<ILandmarkReportingService>();
|
|
mockAuctionReportingService = new Mock<IAuctionReportingService>();
|
|
mockRepoCompanyReportingService = new Mock<IRepoCompanyReportingService>();
|
|
mockHttpContextAccessor = new Mock<IHttpContextAccessor>();
|
|
controller = new ReportingController(
|
|
mockHttpContextAccessor.Object,
|
|
mockLandmarkReportingService.Object,
|
|
mockAuctionReportingService.Object,
|
|
mockRepoCompanyReportingService.Object);
|
|
}
|
|
|
|
[Fact]
|
|
public async void Get_Gross_Amount_OK()
|
|
{
|
|
// arrange
|
|
var request = new ReportingRequest();
|
|
|
|
// act
|
|
var result = await controller.GetAuctionAssignedBalance(request);
|
|
Assert.NotNull(result);
|
|
var okResult = result as OkObjectResult;
|
|
|
|
// assert
|
|
Assert.NotNull(okResult);
|
|
Assert.Equal(200, okResult.StatusCode);
|
|
}
|
|
|
|
[Fact]
|
|
public async void Get_Active_Account_OK()
|
|
{
|
|
// arrange
|
|
var request = new ReportingRequest();
|
|
|
|
// act
|
|
var result = await controller.GetIsActiveAccount(request);
|
|
Assert.NotNull(result);
|
|
var okResult = result as OkObjectResult;
|
|
|
|
// assert
|
|
Assert.NotNull(okResult);
|
|
Assert.Equal(200, okResult.StatusCode);
|
|
}
|
|
|
|
[Fact]
|
|
public async void Get_Closed_Account_OK()
|
|
{
|
|
// arrange
|
|
var request = new ReportingRequest();
|
|
|
|
// act
|
|
var result = await controller.GetIsClosedAccount(request);
|
|
Assert.NotNull(result);
|
|
var okResult = result as OkObjectResult;
|
|
|
|
// assert
|
|
Assert.NotNull(okResult);
|
|
Assert.Equal(200, okResult.StatusCode);
|
|
}
|
|
|
|
}
|
|
} |