public void InvestirMenorQueMinimoInicial() { InvestimentoService investimento = new InvestimentoService(Investidor, 500.00M, CopacabanaTrial); Exception ex = Assert.Throws <DomainServiceException>(delegate { investimento.isValid(); }); Assert.AreEqual(ex.Message, Resources.Dicionario.VALOR_INVESTIDO_SERA_MAIOR_MINIMO_EXIGIDO); }
public void Investir(Fundo fundo, decimal valorInvestido) { InvestimentoService investimento = new InvestimentoService(this, valorInvestido, fundo); if (investimento.isValid()) { Movimentacoes.Add(investimento.Movimentacao); } }
public void ValidaServicoSimuladorPoupanca() { string dados = "{\"id\":1,\"meses\":[\"112\",\"124\",\"136\",\"148\"],\"valor\":[\"2.802\",\"3.174\",\"3.564\",\"3.971\"]}"; var service = new InvestimentoService(); var result = service.GetService().Content; Assert.AreEqual(result, dados, "O resultado difere do valor esperado."); }
public void Aplicar(Movimentacao movimentacao) { var pessoa = PessoaRepository.FindByCpf(movimentacao.Pessoa.Cpf); var fundo = FundoRepository.FindById(movimentacao.Fundo.Id); InvestimentoService investimento = new InvestimentoService(pessoa, movimentacao.ValorInvestido, fundo); if (investimento.isValid()) { MovimentoRepository.Insert(investimento.Movimentacao); } }
public void InvestirIgualAMinimoInicial() { InvestimentoService investimento = new InvestimentoService(Investidor, 1000.00M, CopacabanaTrial); Assert.IsTrue(investimento.isValid()); }
static void Main(string[] args) { Console.WriteLine("Digite seu nome"); var nome = Console.ReadLine(); Console.WriteLine("Por favor informe o tipo da sua conta:\n Digite o numeral 1 para Conta Corrente (Pessoa Física) \n Digite o numeral 2 para Conta Investimento (Pessoa Jurídica)"); var tipoConta = Convert.ToInt32(Console.ReadLine()); if (tipoConta == 1) { Console.WriteLine("\n" + nome + ", agora você pode realizar algumas operações:\n Digite o numeral 1 para Saque \n Digite o numeral 2 para Depósito \n Digite o numeral 3 para Transferência"); try { int operacao = Convert.ToInt32(Console.ReadLine()); ContaCorrenteService contaCorrenteService = new ContaCorrenteService(); switch (operacao) { case 1: contaCorrenteService.OperacaoSaque(); break; case 2: contaCorrenteService.OperacaoDeposito(); break; case 3: contaCorrenteService.OperacaoTransferencia(); break; } } catch (Exception) { Console.WriteLine("Operação falhou, " + nome + " por favor verifique se você digitou um número!"); throw; } } else if (tipoConta == 2) { Console.WriteLine("\n" + nome + ", agora você pode realizar algumas operações:\n Digite o numeral 1 para Saque \n Digite o numeral 2 para Depósito \n Digite o numeral 3 para Transferência"); try { int operacao = Convert.ToInt32(Console.ReadLine()); InvestimentoService InvestimentoService = new InvestimentoService(); switch (operacao) { case 1: InvestimentoService.OperacaoSaque(); break; case 2: InvestimentoService.OperacaoDeposito(); break; case 3: InvestimentoService.OperacaoTransferencia(); break; } } catch (Exception) { Console.WriteLine("Operação falhou, " + nome + " por favor verifique se você digitou um número!"); throw; } } else { Console.WriteLine("Por favor digite um tipo de conta válida!"); throw new Exception(); } }
public InvestimentoService_TesteShould() { _service = new InvestimentoService(); }