public async void CreateLibro() { // Configure EF to be used in memory for testing purposes var options = new DbContextOptionsBuilder <LibreriaContext>() .UseInMemoryDatabase("LibrosDB") .Options; var context = new LibreriaContext(options); var rabbitEventBus = new Mock <IRabbitEventBus>(); rabbitEventBus.Setup(x => x.Publish(new EmailEventQueue("*****@*****.**", "test title", "test content"))); var request = new NewLibroCommand { Titulo = "Libro titulo", AutorLibro = Guid.Empty, FechaPublicacion = DateTime.Now }; var handler = new NewLibroCommandHandler(context, rabbitEventBus.Object); var result = await handler.Handle(request, new System.Threading.CancellationToken()); Assert.True(result != null); }
public GenerosController() { context = new LibreriaContext(); }
public GetLibroQueryHandler(LibreriaContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public LibroController(LibreriaContext context) { _context = context; }
public LibriService(LibreriaContext libreriaContext) { _libreriaContext = libreriaContext; }
public InicioController() { libreriaContext = new LibreriaContext(); }
public GeneroController() { this.context = new LibreriaContext(); }
public NewLibroCommandHandler(LibreriaContext context, IRabbitEventBus rabbitEventBus) { _context = context; _rabbitEventBus = rabbitEventBus; }
public HomeController(ILogger <HomeController> logger) { _logger = logger; context = new LibreriaContext(); }
public AutoresController(LibreriaContext context) { _context = context; }