public async Task <ResponseLivroGet> Get(int isbn) { ResponseLivroGet result = new ResponseLivroGet(); var retorno = await LivroService.Obter(isbn); if (retorno != null) { Livro livro = new Livro { Isbn = retorno.Isbn, Titulo = retorno.Titulo, AnoLancamento = retorno.AnoLancamento, Valor = retorno.Valor }; // Obter a editora do livro atraves do EditoraService foreach (int editoraId in retorno.Editoras) { livro.Editoras.Add(await EditoraService.Obter(editoraId)); } foreach (int autorId in retorno.Autores) { livro.Autores.Add(await AutorService.Obter(autorId)); } result.Livros.Add(livro); } return(result); }
private void ZapiszZmianyBTN_Click(object sender, RoutedEventArgs e) { var authorsService = new AutorService(); _dto.Nazwisko = AutorNazwiskoTxtBox.Text; authorsService.UpdateAutor(_dto); this.Close(); }
private void Zapisz_Click(object sender, RoutedEventArgs e) { string nazwisko = NazwiskoAutoraTxtBox.Text; var service = new AutorService(); service.AddAutor(nazwisko); this.Close(); }
public ReporteLibrosParametrizado() { InitializeComponent(); oSoporteForm = new SoporteForm(); oAutorService = new AutorService(); oGeneroService = new GeneroService(); oEditorialService = new EditorialService(); }
public EjemplarController() { eS = new EjemplarServiceImp(); lS = new LibroServiceImp(); aS = new AutorServiceImp(); edS = new EditorialServiceImp(); pS = new PrestamoServiceImp(); uS = new UsuarioServiceImp(); }
public async Task <ResponseAutorGet> Get() { ResponseAutorGet result = new ResponseAutorGet(); var retorno = await AutorService.Obter(); result.Autores = retorno.ToList(); return(result); }
public async Task <ResponseAutorGet> Get(int id) { ResponseAutorGet result = new ResponseAutorGet(); var retorno = await AutorService.Obter(id); result.Autores.Add(retorno); return(result); }
public void Autor_FormatarNomeComSobrenome_ReTornaNomeFormatado() { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.FormatarNomeComSobrenome(new string[] { "joice", "lopes", "da", "silva" }); //Assert Assert.Equal(expected: "SILVA, Joice Lopes da", actual: resultado); }
public void Autor_FormatarNomeSemSobrenome_ReTornaNomeFormatadoCorreto(string nome, string resultadoEsperado) { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.FormatarNomeSemSobrenome(nome); //Assert Assert.Equal(expected: resultadoEsperado, actual: resultado); }
public void Autor_FormatarNomeSemSobrenome_ReTornaNomeFormatado() { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.FormatarNomeSemSobrenome("silva"); //Assert Assert.Equal(expected: "SILVA", actual: resultado); }
public void ValidarNomeComAgnome_NomeContemAgnome_ReTornaFalse() { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.validarNomeComAgnome(new string[] { "antonio", "carlos", "silva" }); //Assert Assert.False(resultado); }
public void ValidarNomeComAgnome_NomeContemAgnome_ReTornaTrue() { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.validarNomeComAgnome(new string[] { "FILHO", "filha", "NETO", "neta", "SOBRINHO", "SOBRINHA", "JUNIOR" }); //Assert Assert.True(resultado); }
public void ValidarNomeComPreposicao_NomeContemAgnome_ReTornaFalse() { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.validarNomeComPreposicao("na"); //Assert Assert.False(resultado); }
public void ValidarNomeComPreposicao_NomeContemAgnome_True(string nome) { //Arrange var autorService = new AutorService(); //Act var resultado = autorService.validarNomeComPreposicao(nome); //Assert Assert.True(resultado); }
public async Task <bool> Put(int id, [FromBody] RequestAutorPost request) { if (id == request.Autor.Id) { return(await AutorService.Editar(request.Autor)); } else { return(false); } }
public void Autor_Adicionar_ReTornaErroNomeVazio() { //Arrange & Act & Assert var autorService = new AutorService(); var model = new List <AutorViewModel>(); var obj = new AutorViewModel() { Nome = null }; model.Add(obj); var exception = Assert.Throws <Exception>(testCode: () => { autorService.Adicionar(model); }); Assert.Equal(expected: "Nome não pode ser vazio!", actual: exception.Message); }
public AutoresController() { aS = new AutorServiceImp(); }
public AutorController(AutorService servicio) { _servicio = servicio; }
public async Task Post([FromBody] RequestAutorPost request) { await AutorService.Incluir(request.Autor); }
public LibroController() { ls = new LibroServiceImp(); As = new AutorServiceImp(); }
public AutoresController(AutorService service) { _Service = service; }
public void TestMethod1() { var Autor = new Autor(); var servicio = new AutorService(context); var controller = new AutorController(servicio); }
public NoticiasController(NoticiaService noticiaService, AutorService autorService) { _noticiaService = noticiaService; _autorService = autorService; }
public AutorsController(AutorService autorService) { _autorService = autorService; }
public async Task Delete(int id) { await AutorService.Remover(id); }
public AutorEditView(AutorDto dto) { _dto = dto ?? throw new ArgumentNullException(nameof(dto)); InitializeComponent(); authorsService = new AutorService(); }
public AutorController() { aS = new AutorServiceImp(); lS = new LibroServiceImp(); eS = new EjemplarServiceImp(); }
public AutorController() { service = new AutorService(); repository = new AutorRepository(); }
public AutorController(AutorService autorService) { this.autorService = autorService; }
public AutorController() { autorService = new AutorServiceImp(); }