public void JeanBangouraWillBeChosenToInterviewRobin() { var candidatPersonne = new Personne("Robin", "Soldé"); string[] candidatCompetence = { "Android", "Ruby" }; var candidatProfil = new Profil(new List <string>(candidatCompetence), 1); var candidat = new Candidat(candidatPersonne, candidatProfil); var dateTime = new DateTime(2019, 4, 21, 10, 30, 0); const int duree = 10; var planifierEntretien = new PlanifierEntretien(this._salleRepository, this._recruteurRepository, candidat, new Creneau(dateTime, duree)); Assert.AreEqual("BANGOURA", planifierEntretien.Recruteur.Personne.Nom); Assert.AreEqual("jean", planifierEntretien.Recruteur.Personne.Prenom); }
public void JeanBangouraIsSuitedButNotAvailableToInterviewRobin() { var candidatPersonne = new Personne("Robin", "Soldé"); string[] candidatCompetence = { "Android", "Ruby" }; var candidatProfil = new Profil(new List <string>(candidatCompetence), 1); var candidat = new Candidat(candidatPersonne, candidatProfil); var dateTime = new DateTime(2019, 4, 21, 10, 30, 0); const int duree = 10; var indispoRecrut = new DateTime(2019, 4, 21, 10, 15, 0); var crenindispo = new Creneau(indispoRecrut, 60); var jeanBangoura = this._recruteurRepository.Collection.First(x => x.Personne.Prenom == "jean" && x.Personne.Nom == "BANGOURA"); jeanBangoura.AjouterIndisponibilite(crenindispo); Assert.Throws <Recrutement.Infrastructure.RecruteurNotFoundException>(() => { var planifierEntretien = new PlanifierEntretien(this._salleRepository, this._recruteurRepository, candidat, new Creneau(dateTime, duree)); }); }
public void ShouldGiveMeAllAvailableConsultantRecruteurForDate() { var now = DateTimeOffset.UtcNow; //ARRANGE var consultantRecruteurRepository = new Mock <IConsultantRecruteurRepository>(); var salleRepository = new Mock <ISalleRepository>(); var consultantRecruteurs = new [] { new ConsultantRecruteurDto { Name = "Alain", Profile = new ProfileDto { Experience = 2 }, }, new ConsultantRecruteurDto { Name = "Remi", Profile = new ProfileDto { Experience = 7 }, } }; consultantRecruteurRepository.Setup(x => x.GetAvailableConsultantRecruteurForDate(It.IsAny <DateTimeOffset>())) .Returns(consultantRecruteurs); var salles = new [] { new SalleDto { Name = "salle", }, }; salleRepository.Setup(r => r.Get(It.IsAny <DateTimeOffset>())) .Returns(salles); var candidat = new CandidatDto { Name = "Max", Profile = new ProfileDto { Experience = 2 }, }; var creneau = new CreneauDto { StartDate = now, EndDate = now.AddHours(1), }; //ACT var planifierEntretien = new PlanifierEntretien(consultantRecruteurRepository.Object, salleRepository.Object); var result = planifierEntretien.PlanifierUnEntretien(creneau, candidat); var expected = new RendezVousDto { Salle = salles[0], Entretien = new EntretienDto { Creneau = creneau, Candidat = candidat, ConsultantRecruteur = consultantRecruteurs[1], Status = EntretienStatusDto.Scheduled, }, }; //ASSERT result.Should().BeEquivalentTo(expected); }