public void Setup()
 {
     _candidate = ObjectMother.GetCandidate();
     _mockRepository = new MockRepository(MockBehavior.Default);
     _candidateRepoMock = _mockRepository.Create<ICandidateRepository>();
     _service = new CandidateService(_candidateRepoMock.Object);
 }
        public Candidate Update(Candidate candidate)
        {
            Validator.Validate(candidate);

            var updateCandidate = _candidateRepository.Update(candidate);
            return updateCandidate;
        }
 public Candidate Update(Candidate candidate)
 {
     DbEntityEntry entry = _context.Entry(candidate);
     entry.State = EntityState.Modified;
     _context.SaveChanges();
     return candidate;
 }
        public Candidate Create(Candidate candidate)
        {
            Validator.Validate(candidate);

            var saveCandidate = _candidateRepository.Save(candidate);
            return saveCandidate;
        }
        public void CreateAValidCandidatePhoneTest()
        {
            Candidate candidate = new Candidate();
            candidate.Name = "Aprigio";
            candidate.Cpf = "033.155.867-87";

            Validator.Validate(candidate);
        }
 public void CreateAValidCandidateInterviewsNullTest()
 {
     Candidate candidate = new Candidate();
     candidate.Name = "Aprigio";
     candidate.Cpf = "033.155.867-87";
     candidate.Phone = "88336569";
     Validator.Validate(candidate);
 }
        public void Setup()
        {
            Database.SetInitializer(new DropCreateDatabaseAlways<ContextDb>());
            _repository = new CandidateRepository();
            _candidate = ObjectMother.GetCandidate();

            using (var context = new ContextDb())
            {
                context.Candidates.Add(_candidate);
                context.SaveChanges();
            }
        }
 public static Candidate GetCandidate()
 {
     Candidate candidate = new Candidate();
     candidate.Name = "Aprigio";
     candidate.Cpf = "033.155.867-87";
     candidate.Phone = "88336569";
     candidate.Interviews = new List<Interview>()
     {
         new Interview()
         {
             Comment = "Qualquer coisa",
             DataInterview = DateTime.Now,
             Local = "Ndd"
         }
     };
     return candidate;
 }
 public Candidate Save(Candidate candidate)
 {
     var newCandidate = _context.Candidates.Add(candidate);
     _context.SaveChanges();
     return newCandidate;
 }
 public void Setup()
 {
     _candidate = ObjectMother.GetCandidate();
 }
 public void CreateAValidCandidateNameTest()
 {
     Candidate candidate = new Candidate();
     Validator.Validate(candidate);
 }
 public void CreateAValidCandidateCpfTest()
 {
     Candidate candidate = new Candidate();
     candidate.Name = "Aprigio";
     Validator.Validate(candidate);
 }