public CambioBusinessUnitTest() { mock = Substitute.For <ICambioBusiness>(); mock.GetTaxasDeCambio(null) .Returns(s => { throw new Exception("A moeda precisa ser preenchida."); }); mock.GetTaxasDeCambio(MOEDA_EMPTY) .Returns(s => { throw new Exception("A moeda precisa ser preenchida."); }); mock.GetTaxasDeCambio(MOEDA_INVALIDA) .Returns(s => { throw new ArgumentException("A moeda informada é inválida."); }); mock.GetTaxasDeCambio(MOEDA_VALIDA) .Returns(s => new CambioBuilder(MOEDA_VALIDA).TaxasDeCambio); }
public HomeController(ICambioBusiness cambioBusiness) { this.cambioBusiness = cambioBusiness; }