Beispiel #1
0
 public ActionResult TrackData(TrackViewModel Track)
 {
     using (var context = new Uow(this.context))
     {
         var repos = new RepositoryTrack(context);
         repos.UpdateTrackInfo(Track);
     }
     Success("Product", "Save successful.");
     return(Json(new { success = true }));
 }
        public void ShouldUpdateTrackDetails()
        {
            TrackViewModel _Track = new TrackViewModel
            {
                TrackId   = 1,
                TrackName = "1",
                AlbumId   = 1,
                ArtistId  = 1,
                TrackURL  = "C:\\Media\\Music\\Track1.mp3",
            };

            repos.UpdateTrackInfo(_Track);
            Assert.IsTrue(context.Object.Tracks.Count(i => i.TrackName == "1") == 1);
        }