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 mockLandmarkReportingService; private readonly Mock mockAuctionReportingService; private readonly Mock mockRepoCompanyReportingService; private readonly Mock mockHttpContextAccessor; public ReportingControllerTest() { mockLandmarkReportingService = new Mock(); mockAuctionReportingService = new Mock(); mockRepoCompanyReportingService = new Mock(); mockHttpContextAccessor = new Mock(); 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); } } }