public void Render(Playlist playlist, PlaylistFileType playlistFileType, PlaylistOutput playlistOutput)
        {
            var playlistFormatter = _playlistFormatRetriever.GetPlaylistFormatter(playlistFileType);

            playlistOutput(playlistFormatter.GetHeader(playlist));

            for (var playlistIndex = 0; playlistIndex < playlist.Videos.Count; playlistIndex++)
            {
                var location = playlist.Videos[playlistIndex].Location;
                playlistOutput(playlistFormatter.GetPlaylistVideo(location, playlistIndex));
            }

            playlistOutput(playlistFormatter.GetFooter(playlist));
        }
        public void Setup()
        {
            _playlistFormatRetriever = MockRepository.GenerateStub<IPlaylistFormatRetriever>();
            _playlistFormatter = MockRepository.GenerateStub<IPlaylistFormatter>();
            _playlistFormatRetriever.Stub(x => x.GetPlaylistFormatter(_playlistFileType)).Return(_playlistFormatter);

            _playlistFormatter.Stub(x => x.GetHeader(Arg<Playlist>.Is.Anything)).Return("Header");
            _playlistFormatter.Stub(x => x.GetFooter(Arg<Playlist>.Is.Anything)).Return("Footer");
            _playlistFormatter.Stub(x => x.GetPlaylistVideo(Arg<string>.Is.Anything, Arg<int>.Is.Anything)).Return("Video");

            _playlistFileType = PlaylistFileType.None;

            GivenPlaylist = new PlaylistBuilder();

            _allVideos = new List<Video>
            {
                new Video("Test Location"),
                new Video("Test Location 2")
            };
        }
 private string GetXmlEnumValueForFileType(PlaylistFileType playlistFileType)
 {
     var memInfo = typeof(PlaylistFileType).GetMember(playlistFileType.ToString());
     var attributes = memInfo[0].GetCustomAttributes(typeof(XmlEnumAttribute), false);
     return ((XmlEnumAttribute) attributes[0]).Name;
 }
 public void ShouldGetCorrectFileTypeWithParameter(string givenFileType, PlaylistFileType expectedFileType)
 {
     Assert.AreEqual(expectedFileType, new PlaylistFileTypeParser().Parse(givenFileType.ToLower()));
     Assert.AreEqual(expectedFileType, new PlaylistFileTypeParser().Parse(givenFileType.ToUpper()));
 }