public ArtistaQuery(ArtistaService _service) { Field <ListGraphType <ArtistaType> >(name: "artistas", resolve: context => _service.ListarArtistas()); Field <ListGraphType <AlbumType> >(name: "albums", resolve: context => _service.ListartAlbums()); Field <ArtistaType>(name: "artista", arguments: new QueryArguments(new QueryArgument <GuidGraphType> { Name = "id" }), resolve: context => _service.ArtistaPorId(context.GetArgument <System.Guid>("id"))); Field <ListGraphType <AlbumType> >(name: "por_artista", arguments: new QueryArguments(new QueryArgument <GuidGraphType> { Name = "id" }), resolve: context => _service.AlbumPorArtista(context.GetArgument <System.Guid>("id"))); }
public async Task Test1Async() { int artistaId = 69; var MoqlibraryRespository = new Mock <IWindAppRepository>(); var artistaEntity = new ArtistaEntity() { Id = 1, edad = 22, nombre = "S-kap", biografia = "mas progresivos que la palabra", imgPath = "http" }; MoqlibraryRespository.Setup(m => m.GetArtistasAsync(artistaId, false)).Returns(Task.FromResult(artistaEntity)); var myProfile = new WindAppProfile(); var configuration = new MapperConfiguration(cfg => cfg.AddProfile(myProfile)); var mapper = new Mapper(configuration); var artistaService = new ArtistaService(MoqlibraryRespository.Object, mapper); //act await Assert.ThrowsAsync <NotFoundException>(() => artistaService.ObtenerArtistaAsync(1, false)); }
public ArtistaController() { ArtistaService = new ArtistaService(); }
public ArtistasController(ArtistaService artistaService) { _artistaService = artistaService; }