public void Initialize()
        {
            var builder = new DbContextOptionsBuilder <alugaiContext>();

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

            _context = new alugaiContext(options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
            var statuspagamentos = new List <Statuspagamento>
            {
                new Statuspagamento {
                    CodigoStatusPagamento = 1, Descricao = "Pago"
                },

                new Statuspagamento {
                    CodigoStatusPagamento = 2, Descricao = "Atrazado"
                },
            };

            _context.AddRange(statuspagamentos);
            _context.SaveChanges();

            _statuspagamentoService = new StatuspagamentoService(_context);
        }
        public void Initialize()
        {
            var builder = new DbContextOptionsBuilder <alugaiContext>();

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

            _context = new alugaiContext(options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
            var despesas = new List <Despesas>
            {
                new Despesas {
                    CodigoDespesas = 1, TipoDeDespesa = "TESTE", Valor = 45, DescricaoDespesa = "Conserto de torneira", CodigoImovel = 1
                },
                new Despesas {
                    CodigoDespesas = 2, TipoDeDespesa = "TESTE 2", Valor = 150, DescricaoDespesa = "Troca de chuveiro", CodigoImovel = 1
                },
            };

            _context.AddRange(despesas);
            _context.SaveChanges();

            _despesasService = new ManterDespesasService(_context);
        }
예제 #3
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);
        }
예제 #4
0
        public void Initialize()
        {
            var builder = new DbContextOptionsBuilder <alugaiContext>();

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

            _context = new alugaiContext(options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
            var Pessoas = new List <Pessoa>
            {
                new Pessoa {
                    CodigoPessoa     = 1,
                    Nome             = "Maycon",
                    Email            = "*****@*****.**",
                    Senha            = "123456778",
                    Telefone         = "99999999999",
                    Cpf              = "123443566",
                    Sexo             = "masculino",
                    DataNascimento   = DateTime.Parse("1997-03-01"),
                    Rg               = "7758573635",
                    Rua              = "rua A",
                    Bairro           = "centro",
                    Cidade           = "aracaju",
                    Cep              = "48777999",
                    EstadoUf         = "SE",
                    NumeroDoEndereco = 17,
                    TipoPessoa       = 1
                },

                new Pessoa {
                    CodigoPessoa     = 2,
                    Nome             = "Gilton",
                    Email            = "*****@*****.**",
                    Senha            = "9877767665",
                    Telefone         = "988888888",
                    Cpf              = "876656556",
                    Sexo             = "masculino",
                    DataNascimento   = DateTime.Parse("1996-10-12"),
                    Rg               = "776766767",
                    Rua              = "rua b",
                    Bairro           = "centro",
                    Cidade           = "Itabaiana",
                    Cep              = "487799888",
                    EstadoUf         = "SE",
                    NumeroDoEndereco = 20,
                    TipoPessoa       = 2
                },
            };

            _context.AddRange(Pessoas);
            _context.SaveChanges();

            _pessoaService = new PessoaService(_context);
        }
 public DeclaracaoAluguelService(alugaiContext context)
 {
     _context = context;
 }
예제 #6
0
 public ImovelService(alugaiContext context)
 {
     _context = context;
 }
예제 #7
0
 public PessoaService(alugaiContext context)
 {
     _context = context;
 }
예제 #8
0
 public SolicitacaoManutencaoService(alugaiContext context)
 {
     _context = context;
 }
예제 #9
0
 public PagamentoService(alugaiContext context)
 {
     _context = context;
 }
예제 #10
0
 public ManterDespesasService(alugaiContext context)
 {
     _context = context;
 }
예제 #11
0
 public AluguelService(alugaiContext context)
 {
     _context = context;
 }
예제 #12
0
 public StatuspagamentoService(alugaiContext context)
 {
     _context = context;
 }
예제 #13
0
 public AnuncioService(alugaiContext context)
 {
     _context = context;
 }