public ActionResult <CreateBookService> Post(CreateBookRequest request) { CreateBookService _service = new CreateBookService(_unitOfWork); CreateBookResponse response = _service.CreateBook(request); return(Ok(response)); }
public void EnviarSolicitudLibro() { CreateBookService _bookService = new CreateBookService(new UnitOfWork(_context)); var bookRequest = new CreateBookRequest { DocumentTeacher = "1035", Title = "DDD", NumberOfAuthors = 2, Credit = true, BookType = "Libro de ensayo", Editorial = "Norma", Isbn = "asaa", Languaje = "Español", PublicationDate = DateTime.Now }; _bookService.CreateBook(bookRequest); Book book = _bookService.Consult(bookRequest.Title); SendRequestService _sendRequestService = new SendRequestService(new UnitOfWork(_context)); var propertiesRequest = new SendRequestProperties { TitleProductivity = "DDD" }; var responseRequest = _sendRequestService.SendProductivity(propertiesRequest); Assert.AreEqual("La solicitud de la productividad Realidad Aumentada fue enviada con exito, su puntaje estimado es 15.", responseRequest.Menssage); }