public async void GetLibroById() { var mockContexto = CrearContexto(); var mapper = CrearMapper(); var request = new ConsultaFiltro.LibroUnico(); request.LibroId = Guid.Empty; var manejador = new ConsultaFiltro.Manejador(mockContexto.Object, mapper); var libro = await manejador.Handle(request, new System.Threading.CancellationToken()); Assert.NotNull(libro); Assert.True(libro.LibreriaMaterialId == request.LibroId); }
public async void GetLibroPorId() { var mockContexto = CrearContexto(); var mapConfig = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingTest()); }); var mapper = mapConfig.CreateMapper(); var request = new ConsultaFiltro.LibroUnico(); request.LibroId = Guid.Empty; var manejador = new ConsultaFiltro.Manejador(mockContexto.Object, mapper); var libro = await manejador.Handle(request, new System.Threading.CancellationToken()); Assert.NotNull(libro); Assert.True(libro.LibreriaMaterialId == Guid.Empty); }
public async void GetLibroById() { Mock <ContextoLibreria> mockContexto = CrearContext(); MapperConfiguration mapConfig = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingTest()); }); IMapper mapper = mapConfig.CreateMapper(); ConsultaFiltro.Manejador manejador = new ConsultaFiltro.Manejador(mockContexto.Object, mapper); ConsultaFiltro.LibroUnico request = new ConsultaFiltro.LibroUnico() { LibroGuid = Guid.Empty }; LibroMaterialDto result = await manejador.Handle(request, new System.Threading.CancellationToken()); Assert.NotNull(result); Assert.True(result.LibreriaMaterialId == Guid.Empty); }
public async void GetPersonaPorId() { System.Diagnostics.Debugger.Launch(); var mockContexto = CrearContexto(); var mapConfig = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingTest()); }); var mapper = mapConfig.CreateMapper(); var request = new ConsultaFiltro.PersonaUnico(); request.PersonaId = int.MinValue; var manejador = new ConsultaFiltro.Manejador(mockContexto.Object, mapper); var Persona = await manejador.Handle(request, new System.Threading.CancellationToken()); Assert.NotNull(Persona); Assert.True(Persona.PersonaId == int.MinValue); Assert.True(Persona.PersonaDetalleDtoLista.FirstOrDefault().PersonaId == int.MinValue); }