Exemplo n.º 1
0
 public void TestingMusicFileProperties()
 {
     MusicFile myFile = new MusicFile("f", "a", "b", Genre.Dance);
     Assert.AreEqual(myFile.Track, "a");
     Assert.AreEqual(myFile.FileName, "f");
     Assert.AreEqual(myFile.Artist, "b");
     Assert.AreEqual(myFile.Genre, Genre.Dance);
 }
Exemplo n.º 2
0
 public void TestToString()
 {
     Playlist plist =new Playlist("beatles");
     for (int i = 0; i < 5; i++)
     {
         MusicFile file = new MusicFile("File", String.Empty, String.Empty);
         plist.MyPlayList.Add(file);
         StringAssert.StartsWith(file.ToString(), "File");
     }
 }
Exemplo n.º 3
0
 public void TestEnumeratorPlaylist()
 {
     Playlist plist = new Playlist("beatles");
     for (int i = 0; i < 5; i++)
     {
         MusicFile file = new MusicFile("File", String.Empty, String.Empty);
         plist.MyPlayList.Add(file);
     }
     foreach (var track in plist)
         StringAssert.StartsWith(track.ToString(), "File");
 }
Exemplo n.º 4
0
        public void TestCreateAndIteratePlaylist()
        {
            Playlist myTicketToRidePlaylist = new Playlist("Ticket To Ride");
            for (int i = 0; i < 10; i++)
            {
                MusicFile myFile = new MusicFile("myfile.mp4", "Ticket To Ride", "The Beatles", Genre.Other);
                myTicketToRidePlaylist.MyPlayList.Add(myFile);
            }

            foreach (var file in myTicketToRidePlaylist)
            {
                Assert.AreEqual("Ticket To Ride", file.Track);
            }
        }
Exemplo n.º 5
0
 public void TestValidationOnMusicFiles()
 {
     MusicFile myFile = new MusicFile(null,null,null);
     Assert.AreEqual(myFile.Track, "No Title Provided");
 }
Exemplo n.º 6
0
 public void TestCreateMusicFile()
 {
     MusicFile myFile = new MusicFile("myfile.mp4", "Ticket To Ride", "The Beatles", Genre.Other);
     Assert.AreEqual("Ticket To Ride", myFile.Track);
 }
Exemplo n.º 7
0
 public void TestCreateMediaFile()
 {
     MediaFile myFile = new MusicFile("File1", String.Empty, String.Empty, Genre.Other);
     Assert.AreEqual("File1", myFile.FileName);
 }