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