public void Initialize()
        {
            //Arrange
            var builder = new DbContextOptionsBuilder <GestaoAnimalContext>();

            builder.UseInMemoryDatabase("Gestao Animal");
            var options = builder.Options;

            _context = new GestaoAnimalContext(options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
            var tipoexames = new List <Tipoexame>
            {
                new Tipoexame {
                    IdTipoExame = 1, Tipo = "Glicemia"
                },
                new Tipoexame {
                    IdTipoExame = 2, Tipo = "Colesterol"
                },
                new Tipoexame {
                    IdTipoExame = 3, Tipo = "Raio-X"
                }
            };

            _context.AddRange(tipoexames);
            _context.SaveChanges();

            _tipoexameService = new TipoexameService(_context);
        }
示例#2
0
 public ExameController(IExameService exameService, IConsultaService consultaService, IAnimalService animalService, ITipoexameService tipoexameService, IMapper mapper)
 {
     _exameService     = exameService;
     _consultaService  = consultaService;
     _animalService    = animalService;
     _tipoexameService = tipoexameService;
     _mapper           = mapper;
 }
 public TipoexameController(ITipoexameService tipoexameService, IMapper mapper)
 {
     _tipoexameService = tipoexameService;
     _mapper           = mapper;
 }