private void CreateConfiguracoes()
        {
            _configuracao1 = new ConfiguracaoSmtp {
                Servidor           = "smtp.gmail.com",
                Porta              = 587,
                Usuario            = "*****@*****.**",
                Senha              = "teste",
                UseSsl             = false,
                RequerAutenticacao = false,
                Encoding           = string.Empty
            };

            _configuracao2 = new ConfiguracaoSmtp {
                Servidor           = "smtp.gmail.com",
                Porta              = 587,
                Usuario            = "*****@*****.**",
                Senha              = "teste",
                UseSsl             = false,
                RequerAutenticacao = false,
                Encoding           = string.Empty
            };

            _configuracao3 = new ConfiguracaoSmtp {
                Servidor           = "smtp.gmail.com",
                Porta              = 588,
                Usuario            = "*****@*****.**",
                Senha              = "teste",
                UseSsl             = false,
                RequerAutenticacao = false,
                Encoding           = string.Empty
            };
        }
 private static int GetHashCode(ConfiguracaoSmtp configuracaoSmtp)
 {
     unchecked {
         var hashCode = configuracaoSmtp.Servidor?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ configuracaoSmtp.Porta.GetHashCode();
         hashCode = (hashCode * 397) ^ configuracaoSmtp.Usuario?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ configuracaoSmtp.Senha?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ configuracaoSmtp.UseSsl.GetHashCode();
         hashCode = (hashCode * 397) ^ configuracaoSmtp.RequerAutenticacao.GetHashCode();
         hashCode = (hashCode * 397) ^ configuracaoSmtp.Encoding?.GetHashCode() ?? 0;
         return(hashCode);
     }
 }
        private IConfiguracaoSmtp GetConfiguracaoSmtp()
        {
            var configuracaoSmtp = new ConfiguracaoSmtp {
                Servidor           = "smtp.gmail.com",
                Porta              = 587,
                Usuario            = "*****@*****.**",
                Senha              = "teste",
                UseSsl             = false,
                RequerAutenticacao = false,
                Encoding           = string.Empty
            };

            return(configuracaoSmtp);
        }
        public void O_Enviador_De_Email_Deve_Possuir_Configuracao_Smtp()
        {
            var bllFabrica = obterBllFabrica();
            IConfiguracaoEmail configuracao = new ConfiguracaoSmtp("smtp.gmail.com", "*****@*****.**", "12345", 21);

            var envioDeEmail = bllFabrica.EnvioDeEmailServico(configuracao);

            Assert.AreEqual("smtp.gmail.com", envioDeEmail.Configuracao.ServidorSmtp);

            Assert.AreEqual("*****@*****.**", envioDeEmail.Configuracao.Email);

            Assert.AreEqual("12345", envioDeEmail.Configuracao.Senha);

            Assert.AreEqual(21, envioDeEmail.Configuracao.PortaSmtp);
        }
        private void CrieConfiguracoesBasicasParaOsTestes()
        {
            var configuracaoSmtp = new ConfiguracaoSmtp();

            _optionsMock = new Mock <IOptions <ConfiguracaoSmtp> >(MockBehavior.Strict);
            _servicoDeEnvioDeEmailMock             = new Mock <IServicoDeEnvioDeEmail>(MockBehavior.Strict);
            _smtpClientMock                        = new Mock <ISmtpClient>(MockBehavior.Strict);
            _servicoDeQualificacaoDeCandidatosMock = new Mock <IServicoDeQualificacaoDeCandidatos>(MockBehavior.Strict);
            var configuracoes = new Dictionary <string, string> {
                { "EmailOrigem", "*****@*****.**" }
            };
            var builder = new ConfigurationBuilder();

            builder.AddInMemoryCollection(configuracoes);
            _configuration = builder.Build();
            _optionsMock.Setup(o => o.Value).Returns(configuracaoSmtp);
        }
示例#6
0
 public ServicoEmailSmtp(ConfiguracaoSmtp configuracaoSmtp)
 {
     _configuracaoSmtp = configuracaoSmtp;
 }
        public void O_Email_Deve_Ser_Valido()
        {
            var bllFabrica = obterBllFabrica();

            IConfiguracaoEmail configuracao = new ConfiguracaoSmtp("smtp.gmail.com", "tiagoemail.com", "12345", 21);
        }
        public void O_Servidor_De_Smtp_Deve_Conter_A_Palavra_Smtp()
        {
            var bllFabrica = obterBllFabrica();

            IConfiguracaoEmail configuracao = new ConfiguracaoSmtp("gmail.com", "*****@*****.**", "12345", 21);
        }