Exemple #1
0
        public void UpdateArtistaAsync(ArtistaEntity artista)
        {
            //windDBContext.Artistas.Update(artista);
            var artistaPut = windDBContext.Artistas.Single(c => c.Id == artista.Id);

            artistaPut.nombre    = artista.nombre;
            artistaPut.edad      = artista.edad;
            artistaPut.biografia = artista.biografia;
            artistaPut.imgPath   = artista.imgPath;
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 public void AddArtistaAsync(ArtistaEntity artista)
 {
     var saveArtista = windDBContext.Artistas.Add(artista);
 }