Created
October 18, 2011 02:37
-
-
Save bernardobrezende/1294485 to your computer and use it in GitHub Desktop.
Comparações entre teste com e sem membro estático
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
[TestMethod] | |
public void Se_Eu_Criar_Uma_Pessoa_Com_Endereco_Nos_EUA_TemResidenciaNoExterior_Deve_Ser_Verdadeiro() | |
{ | |
Endereco[] enderecos = new [] { new Endereco("Porto Alegre", "BR"), new Endereco("Raccoon City", "US") }; | |
Pessoa johnDoe = new Pessoa("John Doe", enderecos); | |
// | |
Assert.IsTrue(johnDoe.TemResidenciaNoExterior()); | |
} | |
////////// | |
public class Pessoa | |
{ | |
public Pessoa(string nome, Endereco[] enderecos) | |
{ | |
// Atribui campos | |
} | |
public bool TemResidenciaNoExterior() | |
{ | |
// Vamos fingir que não existe o IEnumerable.Any | |
return enderecos.ProcurarPor(x => !x.Pais.Equals("BR")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment