コード例 #1
0
        public void AddTrackOk()
        {
            Track trackToAdd = new Track()
            {
                Id            = 1,
                Name          = "Fiel",
                Author        = "Wisin",
                Sound         = "www.youtube.com/fiel.mp3",
                Hour          = 0,
                MinSeconds    = 2.60,
                CategoryTrack = new List <CategoryTrack>(),
                PlaylistTrack = new List <PlaylistTrack>()
            };

            CategoryTrack categoryTrack = new CategoryTrack
            {
                Category = new Category
                {
                    Id               = 1,
                    Name             = "Dormir",
                    CategoryTrack    = new List <CategoryTrack>(),
                    PlaylistCategory = new List <PlaylistCategory>()
                },
                IdCategory = 1,
                IdTrack    = 1,
                Track      = trackToAdd
            };

            trackToAdd.CategoryTrack.Add(categoryTrack);
            trackLogic.Add(trackToAdd);
        }
コード例 #2
0
        public void Initialize()
        {
            Category category = new Category
            {
                Name = "Musica",
                Id   = 2
            };
            Track track = new Track()
            {
                Id            = 1,
                Name          = "Despacito",
                Author        = "Luis Fonsi",
                Sound         = "despacito-fonsi.mp3",
                Hour          = 0,
                MinSeconds    = 3.2,
                CategoryTrack = new List <CategoryTrack>(),
                PlaylistTrack = new List <PlaylistTrack>()
            };
            CategoryTrack categoryTrack = new CategoryTrack
            {
                IdCategory = category.Id
            };

            track.CategoryTrack.Add(categoryTrack);
            trackList = new List <Track>();
            trackList.Add(track);
        }
コード例 #3
0
        public void UpdateTrack()
        {
            Track trackToAdd = new Track()
            {
                Id            = 1,
                Name          = "Joseee",
                Author        = "Wisin",
                Sound         = "www.youtube.com/fiel.mp3",
                Hour          = 0,
                MinSeconds    = 2.60,
                CategoryTrack = new List <CategoryTrack>(),
                PlaylistTrack = new List <PlaylistTrack>()
            };

            CategoryTrack categoryTrack = new CategoryTrack
            {
                Category = new Category
                {
                    Id               = 1,
                    Name             = "Dormir",
                    CategoryTrack    = new List <CategoryTrack>(),
                    PlaylistCategory = new List <PlaylistCategory>()
                },
                IdCategory = 1,
                IdTrack    = 1,
                Track      = trackToAdd
            };

            trackToAdd.CategoryTrack.Add(categoryTrack);
            trackLogic.Update(trackToAdd, track.Id);
            Assert.AreEqual("Joseee", trackLogic.Get(0).Name);
        }
コード例 #4
0
        public void AddTrackSoundEmpty()
        {
            Track trackToAdd = new Track()
            {
                Id            = 2,
                Name          = "Noite",
                Author        = "Daddy",
                Sound         = "",
                Hour          = 0,
                MinSeconds    = 2.80,
                CategoryTrack = new List <CategoryTrack>(),
                PlaylistTrack = new List <PlaylistTrack>()
            };

            CategoryTrack categoryTrack = new CategoryTrack
            {
                Category = new Category
                {
                    Id               = 1,
                    Name             = "Dormir",
                    CategoryTrack    = new List <CategoryTrack>(),
                    PlaylistCategory = new List <PlaylistCategory>()
                },
                IdCategory = 1,
                IdTrack    = 2,
                Track      = trackToAdd
            };

            trackToAdd.CategoryTrack.Add(categoryTrack);
            Assert.ThrowsException <FieldEnteredNotCorrect>(() => trackLogic.Add(trackToAdd));
        }
コード例 #5
0
        public void Initialize()
        {
            playlist = new Playlist
            {
                Id               = 1,
                Name             = "Musica para Mauro",
                Description      = "De todo",
                PlaylistCategory = new List <PlaylistCategory>()
            };

            category = new Category
            {
                Name             = "Dormir",
                Id               = 1,
                CategoryTrack    = new List <CategoryTrack>(),
                CategoryVideo    = new List <CategoryVideo>(),
                PlaylistCategory = new List <PlaylistCategory>()
            };
            track = new Track
            {
                Id     = 1,
                Image  = "",
                Author = "",
                Name   = "Mauro baila cumbia"
            };

            video = new Video
            {
                Id        = 1,
                Author    = "Rodrigo",
                LinkVideo = "www.youtube.com/baile",
                Name      = "Baile",
                Hour      = 1
            };
            categoryTrack = new CategoryTrack
            {
                IdCategory = category.Id,
                Category   = category,
                IdTrack    = track.Id,
                Track      = track,
            };
            categoryVideo = new CategoryVideo
            {
                IdCategory = category.Id,
                Category   = category,
                IdVideo    = video.Id,
                Video      = video,
            };
            playlistCategory = new PlaylistCategory
            {
                IdCategory = category.Id,
                Category   = category,
                IdPlaylist = playlist.Id,
                Playlist   = playlist
            };
            category.CategoryVideo.Add(categoryVideo);
            category.CategoryTrack.Add(categoryTrack);
            category.PlaylistCategory.Add(playlistCategory);
        }
コード例 #6
0
 public void Initialize()
 {
     categoryTrack = new CategoryTrack();
     category      = new Category
     {
         Name = "Dormir",
         Id   = 0
     };
     track = new Track
     {
         Name   = "Llegamos",
         Id     = 1,
         Author = "Los pibes chorros"
     };
 }
コード例 #7
0
        public void Initialize()
        {
            track = new Track
            {
                Id            = 1,
                Image         = "",
                Author        = "",
                Sound         = "",
                Name          = "Mauro baila cumbia",
                Hour          = 1,
                MinSeconds    = 2.10,
                CategoryTrack = new List <CategoryTrack>(),
                PlaylistTrack = new List <PlaylistTrack>()
            };

            category = new Category {
                Id            = 1,
                Name          = "Musica",
                CategoryTrack = new List <CategoryTrack>(),
            };
            categoryTrack = new CategoryTrack
            {
                IdCategory = category.Id,
                Category   = category,
                IdTrack    = track.Id,
                Track      = track,
            };
            track.CategoryTrack.Add(categoryTrack);

            playlist = new Playlist {
                Id            = 1,
                Name          = "Musica para Mauro",
                Description   = "Variado pop, rock, etc",
                Image         = "",
                PlaylistTrack = new List <PlaylistTrack>()
            };

            playlistTrack = new PlaylistTrack
            {
                IdPlaylist = playlist.Id,
                Playlist   = playlist,
                IdTrack    = track.Id,
                Track      = track
            };
            track.PlaylistTrack.Add(playlistTrack);
        }
コード例 #8
0
        public void Initialize()
        {
            category = new Category()
            {
                Id   = 1,
                Name = "Dormir"
            };
            secondCategory = new Category()
            {
                Id   = 2,
                Name = "Musica"
            };
            categoryList = new List <Category>();
            categoryList.Add(category);
            categoryList.Add(secondCategory);
            track = new Track()
            {
                Id            = 0,
                Name          = "Gasolina",
                Author        = "Daddy yankee",
                Sound         = "www.youtube.com/daddyyanke/gasolina.mp3",
                Hour          = 0,
                MinSeconds    = 2.50,
                CategoryTrack = new List <CategoryTrack>(),
                PlaylistTrack = new List <PlaylistTrack>()
            };
            CategoryTrack categoryTrack = new CategoryTrack
            {
                IdCategory = 1
            };

            track.CategoryTrack.Add(categoryTrack);
            trackList.Add(track);
            repositoryTrack    = new Mock <IData <Track> >();
            repositoryCategory = new Mock <IData <Category> >();
            repositoryPlaylist = new Mock <IData <Playlist> >();

            repositoryTrack.Setup(r => r.GetAll()).Returns(trackList);
            repositoryCategory.Setup(r => r.GetAll()).Returns(categoryList);
            repositoryPlaylist.Setup(r => r.GetAll()).Returns(playlistList);

            repositoryTrack.Setup(play => play.Get(0)).Returns(track);
            trackLogic = new TrackLogic(repositoryTrack.Object, repositoryCategory.Object, repositoryPlaylist.Object);
        }