public static CandidatoParaEmprego PreenchimentoBasicoNaoValido() { CandidatoParaEmprego candidato = new CandidatoParaEmprego() { Nome = "Eric", Sobrenome = "Milaneze", DataDeNascimento = new DateTime(1986, 2, 26) }; return candidato; }
public void Insert(CandidatoParaEmprego candidatoParaEmprego) { if (_connection.State != ConnectionState.Open) _connection.Open(); using (IDbCommand command = _connection.CreateCommand()) { command.CommandType = CommandType.Text; command.CommandText = @"INSERT INTO [dbo].[CANDIDATO_PARA_EMPREGO] ( [IdDomainEntity] ,[Nome] ,[Sobrenome] ,[DataDeNascimento] ,[ResumoCurriculo] ,[NivelDeIngles] ,[Sexo] ) VALUES ( @IdDomainEntity ,@Nome ,@Sobrenome ,@DataDeNascimento ,@ResumoCurriculo ,@NivelDeIngles ,@Sexo )"; command.Parameters.Add(CreateParameter(command, "@IdDomainEntity", candidatoParaEmprego.Id, DbType.Guid)); command.Parameters.Add(CreateParameter(command, "@Nome", candidatoParaEmprego.Nome, DbType.String)); command.Parameters.Add(CreateParameter(command, "@Sobrenome", candidatoParaEmprego.Sobrenome, DbType.String)); command.Parameters.Add(CreateParameter(command, "@DataDeNascimento", candidatoParaEmprego.DataDeNascimento, DbType.DateTime)); command.Parameters.Add(CreateParameter(command, "@ResumoCurriculo", candidatoParaEmprego.CurriculoResumido.Resumo, DbType.String)); command.Parameters.Add(CreateParameter(command, "@NivelDeIngles", candidatoParaEmprego.CurriculoResumido.NivelDeIngles, DbType.Int32)); command.Parameters.Add(CreateParameter(command, "@Sexo", candidatoParaEmprego.Sexo, DbType.Int32)); command.ExecuteNonQuery(); if (_connection.State != ConnectionState.Closed) _connection.Close(); } }
private CandidatoParaEmprego getCandidatoParaEmprego(string curriculoResumido) { CandidatoParaEmprego candidato = new CandidatoParaEmprego() { Nome = "Eric", Sobrenome = "Milaneze", DataDeNascimento = new DateTime(1986, 2, 26), Sexo = Sexo.Masculino }; var mockCurriculoResumidoPreenchimentoMinimoSpecification = new Mock<ICurriculoResumidoPreenchimentoMinimoSpecification>(); mockCurriculoResumidoPreenchimentoMinimoSpecification .Setup(m => m.IsSatisfiedBy(It.IsAny<CandidatoParaEmprego>())) .Returns(true); candidato.CriarCurriculoResumido(mockCurriculoResumidoPreenchimentoMinimoSpecification.Object, curriculoResumido, NivelDeIngles.Avancado); return candidato; }