Created
October 18, 2011 02:42
-
-
Save bernardobrezende/1294490 to your computer and use it in GitHub Desktop.
Comparações entre teste com e sem membro estático - Dependência estática
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() | |
{ | |
Pessoa johnDoe = new Pessoa("John Doe"); | |
// Como injetar os endereços para testar Pessoa isoladamente? | |
Assert.IsTrue(johnDoe.TemResidenciaNoExterior()); | |
} | |
////////// | |
public class Pessoa | |
{ | |
private int Id; | |
public Pessoa(string nome) | |
public bool TemResidenciaNoExterior() | |
{ | |
return AddressDAO.EncontrarEnderecosEstrangeirosDe(Id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment