Пример #1
0
 public SongsController(SongGetAllService songGetAllService, SongGetByIdService songGetByIdService, SongAddService songAddService, SongDeleteService songDeleteService, SongUpdateService songUpdateService)
 {
     _songGetAllService  = songGetAllService;
     _songGetByIdService = songGetByIdService;
     _songAddService     = songAddService;
     _songDeleteService  = songDeleteService;
     _songUpdateService  = songUpdateService;
 }
Пример #2
0
        public void UpdateItemTest()
        {
            Song _song = new Song();

            _song.SongId    = 0;
            _song.AlbumId   = 0;
            _song.SongTitle = "In The End";
            var sRepo = new Mock <ISRepo>();

            sRepo.Setup(x => x.Update(0, _song)).Returns(_song);
            var songUpdateService = new SongUpdateService(sRepo.Object);

            Assert.AreEqual(songUpdateService.UpdateItem(0, _song), _song);
        }