public TransacaoService(ITransacaoRepository transacaoRepository, IContaService contaService, INotificador notificador) : base(transacaoRepository, notificador) { _transacaoRepository = transacaoRepository; _contaService = contaService; _notificador = notificador; }
public FuncionarioService(IFuncionarioRepository repository, IFuncionarioEnderecoRepository funcionarioEnderecoRepository , IContaService iContaService) { base._repository = repository; _funcionarioEnderecoRepository = funcionarioEnderecoRepository; _iContaService = iContaService; }
public CorrenteController(IContaCorrenteRepository contaCorrenteRepository, IMapper mapper, IContaService contaCorrenteService, INotificador notificador) { _contaCorrenteRepository = contaCorrenteRepository; _mapper = mapper; _contaCorrenteService = contaCorrenteService; _notificador = notificador; }
public PoupancaController(IContaPoupancaRepository contaPoupancaRepository, IMapper mapper, IContaService contaService, INotificador notificador) { _contaPoupancaRepository = contaPoupancaRepository; _mapper = mapper; _contaService = contaService; _notificador = notificador; }
public ContaTest() { _contaRepository = Substitute.For <IContaRepository>(); _contaService = new ContaService(_contaRepository); _contaApp = new ContaAppService(_contaService); _cancellationToken = new CancellationToken(); SetupRepository(); }
public ContaController(BaseControllerInjector injector, IContaService contaService, UserService userService) : base(injector) { _contaService = contaService; _userService = userService; }
public ClienteAppService(IClienteRepository ClienteRepository, IClienteService ClienteService, IContaService contaService, IUnitOfWork uow) : base(uow) { _ClienteRepository = ClienteRepository; _ClienteService = ClienteService; _contaService = contaService; }
public LancamentoTest() { _lancamentoRepository = Substitute.For <ILancamentoRepository>(); _contaRepository = Substitute.For <IContaRepository>(); _contaService = new ContaService(_contaRepository); _lancamentoService = new LancamentoService(_lancamentoRepository, _contaService); _lancamentoApp = new LancamentoAppService(_lancamentoService); _cancellationToken = new CancellationToken(); SetupRepository(); }
public ContasController( IContaService contaService, IMapper mapper, INotifier notifier, ILogger <ContasController> logger) : base(notifier) { _contaService = contaService; _mapper = mapper; _logger = logger; }
public LancamentoService( IContaService contaService, IContaRepository contaRepository, ILancamentoRepository lancamentoRepository, INotifier notifier) : base(notifier) { _contaService = contaService; _contaRepository = contaRepository; _lancamentoRepository = lancamentoRepository; }
public ContaController ( IContaService contaService, IMapper mapper, INotificacaoEvent notificacaoEvent ) : base(notificacaoEvent) { _contaService = contaService; _mapper = mapper; }
public ContaAppService(IContaRepository contaRepository, IContaService contaService, ITransacoesRepository transacoesRepository, ITransacaoService transacaoService, IUnitOfWork uow) : base(uow) { _contaRepository = contaRepository; _contaService = contaService; _transacoesRepository = transacoesRepository; _transacaoService = transacaoService; }
private static void ConfigurarServicos(string[] args) { IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices((_, services) => services.AddDbContext <BankDbContext>(options => options.UseSqlite("Data Source=Bank.db")).AddScoped <IContaService, ContaService>() .AddScoped <IContaRepository, ContaRepository>()).Build(); IServiceScope scope = host.Services.CreateScope(); var provider = scope.ServiceProvider; contaService = provider.GetRequiredService <IContaService>(); }
public ContaController ( INotificador notificador, IUsuarioService usuarioService, IContaService contaService, AuthService authService ) : base(notificador) { _usuarioService = usuarioService; _contaService = contaService; _authService = authService; }
public async Task QuandoExecutarGetPost() { _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.Post(contaDtoCreate)).ReturnsAsync(contaDtoCreateResult); _service = _serviceMock.Object; var result = await _service.Post(contaDtoCreate); Assert.NotNull(result); Assert.Equal(Name, result.Name); Assert.Equal(Description, result.Description); }
public BancoDigitalQuery(IContaService contaService) { Name = "Query"; Field <DecimalGraphType>("saldo", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "conta" }), resolve: context => { var resultado = contaService.Saldo(context.GetArgument <int>("conta")); return(resultado.Resultado == ResultadoOperacao.enResultado.Sucesso ? resultado.Conta.Saldo : throw new ExecutionError(resultado.Mensagem)); }); }
public ClienteController ( INotificador notificador, IClienteService clienteService, IClienteRepository clienteRepository, IUsuarioService usuarioService, IContaService contaService ) : base(notificador) { _clienteService = clienteService; _clienteRepository = clienteRepository; _usuarioService = usuarioService; _contaService = contaService; }
public void TestInitialize() { var options = new DbContextOptionsBuilder <AccountDbContext>().Options; dbctx = new AccountDbContext(options); _contaService = new ContaService(new ContaRepository(dbctx), new Notifier()); _lancamentoService = new LancamentoService( _contaService, new ContaRepository(dbctx), new LancamentoRepository(dbctx), new Notifier()); }
public CadastrosConfiguracoesController(IPessoaService pessoaService, IEmpresaService empresaService, IUsuarioService usuarioService, ICentroCustoService centroCustoService, IPlanoContaService planoContaService, IContaService contaService) { _pessoaService = pessoaService; _empresaService = empresaService; _usuarioService = usuarioService; _centroCustoService = centroCustoService; _planoContaService = planoContaService; _contaService = contaService; }
public OperacaoService(IContaService contaService, ILancamentoService lancamentoService) { _contaService = contaService; _lancamentoService = lancamentoService; try { Mapper.Initialize(cfg => { cfg.CreateMap <Conta, ContaArgument>(); cfg.CreateMap <Operacao, OperacaoArgument>(); }); } catch (System.Exception) { } }
public OperacaoController(BaseControllerInjector injector, UserService userService, IContaService contaService, Lazy <ISaqueService> saqueService, Lazy <IDepositoService> depositoService, Lazy <ITransferenciaService> transferenciaService, Lazy <IMovimentacaoService> movimentacaoService ) : base(injector) { _userService = userService; _contaService = contaService; _saqueService = saqueService; _depositoService = depositoService; _transferenciaService = transferenciaService; _movimentacaoService = movimentacaoService; }
public OperacaoService(IContaService contaService, ILancamentoService lancamentoService) { _contaService = contaService; _lancamentoService = lancamentoService; try { Mapper.Initialize(cfg => { cfg.CreateMap <ContaCorrente, Params.ContaCorrente>(); cfg.CreateMap <Operacao, Params.Operacao>(); }); } catch (System.Exception) { } }
public MovimentacoesController(IPagarService pagarService, IReceberService receberService, IEmpresaService empresaService, IContaService contaService, IPessoaService pessoaService, IPlanoContaService planoContaService, ICentroCustoService centroCustoService, ITransferenciaService transferenciaService) { _pagarService = pagarService; _receberService = receberService; _empresaService = empresaService; _contaService = contaService; _pessoaService = pessoaService; _planoContaService = planoContaService; _centroCustoService = centroCustoService; _transferenciaService = transferenciaService; }
public MainTest() { try { Mapper.Initialize(cfg => { cfg.CreateMap <ContaCorrente, Params.ContaCorrente>(); cfg.CreateMap <Operacao, Params.Operacao>(); }); } catch (InvalidOperationException) { //Mapper está criado. ok. } _lancamentoRepository = new LancamentoRepository(); _contaService = new ContaService(); _lancamentoService = new LancamentoService(_contaService, _lancamentoRepository); }
public async Task QuandoExecutarDelete() { _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.Delete(Id)) .ReturnsAsync(true); _service = _serviceMock.Object; var deletado = await _service.Delete(Id); Assert.True(deletado); _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.Delete(It.IsAny <Guid>())) .ReturnsAsync(false); _service = _serviceMock.Object; deletado = await _service.Delete(Guid.NewGuid()); Assert.False(deletado); }
public RelatoriosController(IPessoaService pessoaService, IEmpresaService empresaService, IUsuarioService usuarioService, ICentroCustoService centroCustoService, IPlanoContaService PlanoContaService, IContaService contaService, ICaixaRepository caixaRepository, IReceberRepository receberRepository, IPagarRepository pagarRepository ) { _pessoaService = pessoaService; _empresaService = empresaService; _usuarioService = usuarioService; _centroCustoService = centroCustoService; _PlanoContaService = PlanoContaService; _contaService = contaService; _caixaRepository = caixaRepository; _receberRepository = receberRepository; _pagarRepository = pagarRepository; }
public async Task QuandoExecutarGet() { _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.Get(Id)).ReturnsAsync(contaDto); _service = _serviceMock.Object; var result = await _service.Get(Id); Assert.NotNull(result); Assert.True(result.Id == Id); Assert.Equal(Name, result.Name); Assert.Equal(Description, result.Description); _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.Get(It.IsAny <Guid>())).Returns(Task.FromResult((ContaDto)null)); _service = _serviceMock.Object; var _record = await _service.Get(Id); Assert.Null(_record); }
public async Task QuandoExecutarGetAll() { _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.GetAll()).ReturnsAsync(listaContaDto); _service = _serviceMock.Object; var result = await _service.GetAll(); Assert.NotNull(result); Assert.True(result.Count() == 10); var _listResult = new List <ContaDto>(); _serviceMock = new Mock <IContaService>(); _serviceMock.Setup(m => m.GetAll()).ReturnsAsync(_listResult.AsEnumerable); _service = _serviceMock.Object; var _resultEmpty = await _service.GetAll(); Assert.Empty(_resultEmpty); Assert.True(_resultEmpty.Count() == 0); }
public BancoDigitalMutation(IContaService contaService) { Name = "Mutation"; Field <ContaType>("depositar", arguments: new QueryArguments( new QueryArgument <IntGraphType> { Name = "conta" }, new QueryArgument <DecimalGraphType> { Name = "valor" } ), resolve: context => { var numeroConta = context.GetArgument <int>("conta"); var valor = context.GetArgument <decimal>("valor"); var resultado = contaService.Depositar(numeroConta, double.Parse(valor.ToString())); return(resultado.Resultado == ResultadoOperacao.enResultado.Sucesso ? resultado.Conta : throw new ExecutionError(resultado.Mensagem)); }); Field <ContaType>("sacar", arguments: new QueryArguments( new QueryArgument <IntGraphType> { Name = "conta" }, new QueryArgument <DecimalGraphType> { Name = "valor" } ), resolve: context => { var numeroConta = context.GetArgument <int>("conta"); var valor = context.GetArgument <decimal>("valor"); var resultado = contaService.Sacar(numeroConta, double.Parse(valor.ToString())); return(resultado.Resultado == ResultadoOperacao.enResultado.Sucesso ? resultado.Conta : throw new ExecutionError(resultado.Mensagem)); }); }
public MainTest() { try { Mapper.Initialize(cfg => { cfg.CreateMap <Conta, ContaArgument>(); cfg.CreateMap <Operacao, OperacaoArgument>(); }); } catch (InvalidOperationException) { //Mapper já inicializado!!! Segue a vida! } _lancamentoRepository = new LancamentoRepository(); _contaService = new ContaService(); _lancamentoService = new LancamentoService(_contaService, _lancamentoRepository); //CRIA AS CONTAS E GERA UM SALDO INICIAL PARA TESTE _dadosContaOrigem = CriaConta("Santander", 2300, 10000001, 1, TipoConta.Corrente, 1000); _dadosContaDestino = CriaConta("Santander", 2300, 20000002, 3, TipoConta.Corrente, 1500); }