public void Given_RepartitionRepo_When_GenerateRepartitionIsCalled_Then_ResultIsTrue() { RunOnDatabase(async context => { //Arrange var candidateRepo = new CandidateRepository(context, _loggerFactory); var repartitionRepo = new RepartitionRepository(context, _loggerFactory, candidateRepo); var config = GenerateConfiguration(); //Act await PopulateCandidateRepo(candidateRepo); var res = await repartitionRepo.GenerateRepartition(config); //Assert res.Should().Be(true); }); }
public void Given_RepartitionRepo_When_GetCandidatesPageAsyncIsCalled_Then_ValidRepartitionsAreReturned() { RunOnDatabase(async context => { //Arrange var candidateRepo = new CandidateRepository(context, _loggerFactory); var repartitionRepo = new RepartitionRepository(context, _loggerFactory, candidateRepo); var config = GenerateConfiguration(); //Act await PopulateCandidateRepo(candidateRepo); await repartitionRepo.GenerateRepartition(config); var res = await repartitionRepo.GetCandidatesPageAsync("C1"); //Assert res.TotalRecords.Should().Be(10); }); }
public void Given_RepartitionRepo_When_GetCandidateRepartitionIsCalled_Then_ValidRepartitionIsReturned() { RunOnDatabase(async context => { //Arrange var candidateRepo = new CandidateRepository(context, _loggerFactory); var repartitionRepo = new RepartitionRepository(context, _loggerFactory, candidateRepo); var config = GenerateConfiguration(); //Act await PopulateCandidateRepo(candidateRepo); await repartitionRepo.GenerateRepartition(config); var res = await repartitionRepo.GetCandidateRepartition("*****@*****.**"); //Assert res.ApprovedCandidateEmail.Should().Be("*****@*****.**"); }); }