Last active
November 16, 2019 16:07
-
-
Save diedona/83e11b92c00ca3c34dfa1d94a8c02327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PersonService | |
{ | |
private IComunicacao _comunicacao; | |
private IList<Pessoa> _dados; | |
public PersonService(IComunicacao comunicacao) | |
{ | |
_comunicacao = comunicacao; | |
_dados = GerarDados(); | |
} | |
public void DefinirEstrategia(IComunicacao comunicacao) | |
{ | |
_comunicacao = comunicacao; | |
} | |
public IList<Pessoa> CarregarPessoas() | |
{ | |
return _dados; | |
} | |
public bool EnviarComunicacao(Pessoa pessoa, Mensagem mensagem) | |
{ | |
return _comunicacao.EnviarComunicacao(pessoa, mensagem); | |
} | |
#region [ DADOS PARA DEMO ] | |
private IList<Pessoa> GerarDados() | |
{ | |
return new List<Pessoa>() | |
{ | |
new Pessoa("Diego Doná", new DateTime(1989,6,19), "diego.dona@mundo.com.br", "+55897775654", "East Ride", Comunicacao.EMAIL), | |
new Pessoa("Luis Inácio", new DateTime(1967,2,21), "teste@mundo.com.br", "+92984984", "West Ride", Comunicacao.SMS), | |
new Pessoa("Aécio Neves", new DateTime(1983,1,15), "vixi.po@mundo.com.br", "+65465456", "East Ride", Comunicacao.EMAIL), | |
new Pessoa("Alberta Vidima", new DateTime(1977,8,5), "arberta@mundo.com.br", "+874456363", "West Ride", Comunicacao.EMAIL), | |
new Pessoa("Luiza Albertina", new DateTime(1991,10,30), "canada@mundo.com.br", "+2316586", "KimmingKnow", Comunicacao.EMAIL), | |
new Pessoa("Lucas Colombini", new DateTime(1984,11,28), "lucao.cols@mundo.com.br", "+357565432", "ZigZigZow", Comunicacao.SinalDeFumaca), | |
new Pessoa("Danilo Rupert", new DateTime(1998,10,14), "dandan22@mundo.com.br", "+15387485", "ZigZigZow", Comunicacao.SinalDeFumaca), | |
}; | |
} | |
#endregion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment