Inheritance: IMKVMergeOutputService
 public void mkvmergeoutputservice_can_getmkvmergepathPart_Tests()
 {
     //given
     EAC3ToConfiguration config = new EAC3ToConfiguration() {  MKVMergePath = "c:\\exe\\mkvmerge.exe" };
     BluRaySummaryInfo bluRaySummaryInfo = new BluRaySummaryInfo() { Eac3ToId = "1)", BluRayTitleInfo = new BluRayTitleInfo() { EpisodeNumber = "1" } };
     IAudioService audioService = new AudioService();
     AbstractEAC3ToOutputNamingService eac3ToOutputNamingService = new RemuxTemplate1EAC3ToOutputNamingService(audioService);
     //when
     IMKVMergeOutputService mkvMergeOutputService = new MKVMergeOutputService(config, eac3ToOutputNamingService, @"c:\temp", bluRaySummaryInfo);
     var mkvmergepath = mkvMergeOutputService.GetMKVMergePathPart();
     //then
     mkvmergepath.Should().Be("\"c:\\exe\\mkvmerge.exe\"");
 }
        public ErrorCollection Write()
        {
            if (this.IsValid())
            {
                try
                {
                    this.Delete();

                    foreach (BluRayDiscInfo disc in _bluRayDiscInfoList.Where(d => d.IsSelected))
                    {
                        foreach (BluRaySummaryInfo summary in disc.BluRaySummaryInfoList.Where(s => s.IsSelected).OrderBy(s => s.EpisodeNumber))
                        {
                            _eac3ToOutputNamingService.SetCurrentBluRaySummaryInfo(summary);
                            IMKVMergeOutputService mkvMergeOutputService = new MKVMergeOutputService(_eac3toConfiguration, _eac3ToOutputNamingService, disc.BluRayPath, summary);
                            string mkvMergePathPart       = mkvMergeOutputService.GetMKVMergePathPart();
                            string mkvMergeOutputPart     = mkvMergeOutputService.GetOutputPart();
                            string mkvMergeVideoPart      = mkvMergeOutputService.GetVideoPart();
                            string mkvMergeAudioPart      = mkvMergeOutputService.GetAudioPart();
                            string mkvMergeSubtitlePart   = mkvMergeOutputService.GetSubtitlePart();
                            string mkvMergeChaptersPart   = mkvMergeOutputService.GetChaptersPart();
                            string mkvMergeTrackOrderPart = mkvMergeOutputService.GetTrackOrderPart();

                            using (StreamWriter sw = new StreamWriter(_eac3toConfiguration.MKVMergeBatchFilePath, true))
                            {
                                sw.WriteLine(string.Format("{0} {1} {2} {3} {4} {5} {6}", mkvMergePathPart, mkvMergeOutputPart, mkvMergeVideoPart, mkvMergeAudioPart, mkvMergeSubtitlePart,
                                                           mkvMergeChaptersPart, mkvMergeTrackOrderPart));
                                sw.WriteLine();
                                sw.WriteLine();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name);
                    _errors.Add(new Error()
                    {
                        Description = "There was an error while creating the mkvmerge batch file."
                    });
                }
            }
            return(_errors);
        }
        public ErrorCollection Write()
        {
            if (this.IsValid())
            {
                try
                {
                    this.Delete();

                    foreach (BluRayDiscInfo disc in _bluRayDiscInfoList.Where(d => d.IsSelected))
                    {
                        foreach (BluRaySummaryInfo summary in disc.BluRaySummaryInfoList.Where(s => s.IsSelected).OrderBy(s => s.EpisodeNumber))
                        {
                            IMKVMergeOutputService mkvMergeOutputService = new MKVMergeOutputService(_eac3toConfiguration, _eac3ToOutputNamingService, disc.BluRayPath, summary);
                            string mkvMergePathPart = mkvMergeOutputService.GetMKVMergePathPart();
                            string mkvMergeOutputPart = mkvMergeOutputService.GetOutputPart();
                            string mkvMergeVideoPart = mkvMergeOutputService.GetVideoPart();
                            string mkvMergeAudioPart = mkvMergeOutputService.GetAudioPart();
                            string mkvMergeSubtitlePart = mkvMergeOutputService.GetSubtitlePart();
                            string mkvMergeChaptersPart = mkvMergeOutputService.GetChaptersPart();
                            string mkvMergeTrackOrderPart = mkvMergeOutputService.GetTrackOrderPart();

                            using (StreamWriter sw = new StreamWriter(_eac3toConfiguration.MKVMergeBatchFilePath, true))
                            {
                                sw.WriteLine(string.Format("{0} {1} {2} {3} {4} {5} {6}", mkvMergePathPart, mkvMergeOutputPart, mkvMergeVideoPart, mkvMergeAudioPart, mkvMergeSubtitlePart,
                                    mkvMergeChaptersPart, mkvMergeTrackOrderPart));
                                sw.WriteLine();
                                sw.WriteLine();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name);
                    _errors.Add(new Error() { Description = "There was an error while creating the mkvmerge batch file." });
                }
            }
            return _errors;
        }