コード例 #1
0
 public PagamentoController(IPagamentoService pagamentoService,
                            IAluguelService aluguelService, IMapper mapper)
 {
     _pagamentoService = pagamentoService;
     _aluguelService   = aluguelService;
     _mapper           = mapper;
 }
コード例 #2
0
        public void Initialize()
        {
            //Arrange
            var builder = new DbContextOptionsBuilder <alugaiContext>();

            builder.UseInMemoryDatabase("alugai");
            var options = builder.Options;

            _context = new alugaiContext(options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
            var alugueis = new List <Aluguel>
            {
                new Aluguel {
                    CodigoAluguel = 1, Descricao = "Aluguel da Maria", CodigoStatusPagamento = 1
                },
                new Aluguel {
                    CodigoAluguel = 2, Descricao = "Aluguel do João", CodigoStatusPagamento = 2
                },
                new Aluguel {
                    CodigoAluguel = 3, Descricao = "Aluguel do josé", CodigoStatusPagamento = 3
                },
            };

            _context.AddRange(alugueis);
            _context.SaveChanges();

            _aluguelService = new AluguelService(_context);
        }
コード例 #3
0
 public AluguelController(IAluguelService aluguelService,
                          IStatuspagamentoService statuspagamentoService, IMapper mapper)
 {
     _aluguelService         = aluguelService;
     _statusPagamentoService = statuspagamentoService;
     _mapper = mapper;
 }
コード例 #4
0
 public AluguelController(IAluguelService service)
 {
     this.service = service;
 }
コード例 #5
0
 public AluguelController(IAluguelService service)
 {
     this.service = service;
 }
コード例 #6
0
 public void Initialize()
 {
     service = new AluguelService(aluguelRepository, veiculoRepository);
 }