using Diligent.WebAPI.Contracts.DTOs.Applicant; using Microsoft.AspNetCore.Http; namespace Diligent.WebAPI.Tests.Controllers { public class ImportControllerTests { private readonly IFormFile file = Substitute.For(); private readonly IImportService _service = Substitute.For(); private readonly IApplicantService _applicantService = Substitute.For(); private readonly List _applicants; public ImportControllerTests() { _applicants = new List { new ApplicantImportDto{Email = "dzenis@dilig.net"} }; } [Fact] public async Task Import_ShoudReutnr_200OK() { _service.Import(Arg.Any()).Returns(_applicants); ImportController controller = new ImportController(_service, _applicantService); var result = await controller.Import(file); (result as OkResult).StatusCode.Should().Be(200); } } }