public static void TestAlbumList()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.6.0",
         AlbumList = new List<Album> {
             new Album {
                 Id = "11",
                 Parent = "1",
                 Title = "Arrival",
                 Artist = "ABBA",
                 IsDir = true,
                 CoverArt = "22",
                 UserRating = 4,
                 AverageRating = 4.5,
             },
             new Album {
                 Id = "12",
                 Parent = "1",
                 Title = "Super Trouper",
                 Artist = "ABBA",
                 IsDir = true,
                 CoverArt = "23",
                 AverageRating = 4.4,
             },
         },
     };
     TestHelper.TestFileToRest("albumList.xml", expectedResponse);
 }
 public static void TestMusicFolders()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.1.1",
         MusicFolders = new List<MusicFolder> {
             new MusicFolder { Id = "1", Name = "Music"},
             new MusicFolder { Id = "2", Name = "Movies"},
             new MusicFolder { Id = "3", Name = "Incoming"},
         },
     };
     TestHelper.TestFileToRest("musicFolders.xml", expectedResponse);
 }
 public static void TestJukeboxStatus()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.7.0",
         JukeboxStatus = new JukeboxStatus {
             CurrentIndex = 7,
             Playing = true,
             Gain = 0.9,
             Position = 67,
         }
     };
     TestHelper.TestFileToRest("jukeboxStatus.xml", expectedResponse);
 }
 public static void TestRandomSongs()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.4.0",
         RandomSongs = new List<Song> {
                 new Song {
                     Id = "111",
                     Parent = "11",
                     Title = "Dancing Queen",
                     IsDir = false,
                     Album = "Arrival",
                     Artist = "ABBA",
                     Track = "7",
                     Year = 1978,
                     Genre = "Pop",
                     CoverArt = "24",
                     Size = 8421341,
                     ContentType = "audio/mpeg",
                     Suffix = "mp3",
                     Duration = 146,
                     BitRate = 128,
                     Path = "ABBA/Arrival/Dancing Queen.mp3",
                 },
                 new Song {
                     Id = "112",
                     Parent = "11",
                     Title = "Money, Money, Money",
                     IsDir = false,
                     Album = "Arrival",
                     Artist = "ABBA",
                     Track = "7",
                     Year = 1978,
                     Genre = "Pop",
                     CoverArt = "25",
                     Size = 4910028,
                     ContentType = "audio/flac",
                     Suffix = "flac",
                     TranscodedContentType = "audio/mpeg",
                     TranscodedSuffix = "mp3",
                     Duration = 208,
                     BitRate = 128,
                     Path = "ABBA/Arrival/Money, Money, Money.mp3",
                 },
         },
     };
     TestHelper.TestFileToRest("randomSongs.xml", expectedResponse);
 }
 public static void TestChatMessages()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.2.0",
         ChatMessages = new List<ChatMessage> {
             new ChatMessage {
                 UserName = "******",
                 Time = "1269771845310",
                 Message = "Sindre was here",
             },
             new ChatMessage {
                 UserName = "******",
                 Time = "1269771842504",
                 Message = "Ben too",
             },
         },
     };
     TestHelper.TestFileToRest("chatMessages.xml", expectedResponse);
 }
Exemplo n.º 6
0
 public static void TestIndexes()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.1.1",
         Indexes = new IndexList {
             LastModified = "237462836472342",
             Shortcuts = new List<Shortcut> {
                 new Shortcut { Id = "11", Name = "Audio books" },
                 new Shortcut { Id = "10", Name = "Podcasts" },
             },
             Indexes = new List<Index> {
                 new Index {
                     Name = "A",
                     Artists = new List<Artist> {
                         new Artist { Id = "1", Name = "ABBA" },
                         new Artist { Id = "2", Name = "Alanis Morisette" },
                         new Artist { Id = "3", Name = "Alphaville" },
                     }
                 },
                 new Index {
                     Name = "B",
                     Artists = new List<Artist> {
                         new Artist { Id = "4", Name = "Bob Dylan" },
                     }
                 },
             },
             Children = new List<Child> {
                 new Child {
                     Id = "111",
                     Parent = "11",
                     Title = "Dancing Queen",
                     IsDir = false,
                     Album = "Arrival",
                     Artist = "ABBA",
                     Track = "7",
                     Year = 1978,
                     Genre = "Pop",
                     CoverArt = "24",
                     Size = 8421341,
                     ContentType = "audio/mpeg",
                     Suffix = "mp3",
                     Duration = 146,
                     BitRate = 128,
                     Path = "ABBA/Arrival/Dancing Queen.mp3",
                 },
                 new Child {
                     Id = "112",
                     Parent = "11",
                     Title = "Money, Money, Money",
                     IsDir = false,
                     Album = "Arrival",
                     Artist = "ABBA",
                     Track = "7",
                     Year = 1978,
                     Genre = "Pop",
                     CoverArt = "25",
                     Size = 4910028,
                     ContentType = "audio/flac",
                     Suffix = "flac",
                     TranscodedContentType = "audio/mpeg",
                     TranscodedSuffix = "mp3",
                     Duration = 208,
                     BitRate = 128,
                     Path = "ABBA/Arrival/Money, Money, Money.mp3",
                 },
             },
         },
     };
     TestHelper.TestFileToRest("indexes.xml", expectedResponse);
 }
 public static void TestPodcasts()
 {
     var expectedResponse = new SubsonicResponse {
         Status = "ok",
         Version = "1.6.0",
         Podcasts = new List<Channel> {
             new Channel {
                 Id = "1",
                 Url = new Uri("http://downloads.bbc.co.uk/podcasts/fivelive/drkarl/rss.xml"),
                 Title = "Dr Karl and the Naked Scientist",
                 Description = "Dr Chris Smith aka The Naked Scientist with the latest news from the world of science and Dr Karl answers listeners' science questions.",
                 Status = "completed",
                 Episodes = new List<Episode> {
                     new Episode {
                         Id = "34",
                         StreamId = "523",
                         Title = "Scorpions have re-evolved eyes",
                         Description = "This week Dr Chris fills us in on the UK's largest free science festival, plus all this week's big scientific discoveries.",
                         PublishDate = new DateTime(2011, 2, 3, 14, 46, 43),
                         Status = "completed",
                         Parent = "11",
                         IsDir = false,
                         Year = 2011,
                         Genre = "Podcast",
                         CoverArt = "24",
                         Size = 78421341,
                         ContentType = "audio/mpeg",
                         Suffix = "mp3",
                         Duration = 3146,
                         BitRate = 128,
                         Path = "Podcast/drkarl/20110203.mp3",
                     },
                     new Episode {
                         Id = "35",
                         StreamId = "524",
                         Title = "Scar tissue and snake venom treatment",
                         Description = "This week Dr Karl tells the gruesome tale of a surgeon who operated on himself.",
                         PublishDate = new DateTime(2011, 9, 3, 16, 47, 52),
                         Status = "completed",
                         Parent = "11",
                         IsDir = false,
                         Year = 2011,
                         Genre = "Podcast",
                         CoverArt = "27",
                         Size = 45624671,
                         ContentType = "audio/mpeg",
                         Suffix = "mp3",
                         Duration = 3099,
                         BitRate = 128,
                         Path = "Podcast/drkarl/20110903.mp3"
                     },
                 },
             },
             new Channel {
                 Id = "2",
                 Url = new Uri("http://podkast.nrk.no/program/herreavdelingen.rss"),
                 Title = "NRK P1 - Herreavdelingen",
                 Description = "Et program der herrene Yan Friis og Finn Bjelke møtes og musikk nytes.",
                 Status = "completed",
             },
             new Channel {
                 Id = "3",
                 Url = new Uri("http://foo.bar.com/xyz.rss"),
                 Status = "error",
                 ErrorMessage = "Not found.",
             },
         },
     };
     TestHelper.TestFileToRest("podcasts.xml", expectedResponse);
 }