Inheritance: IEAC3ToBatchFileWriteWarningService
 public void eac3tobatchfilewritewarningwervice_has_warning_when_disc_selected_but_no_summaries_selected_test()
 {
     //given a list of discs where a disc is selected but no summaries selected
     List<BluRayDiscInfo> discs = new List<BluRayDiscInfo>() { new BluRayDiscInfo() { IsSelected = true, BluRayPath = "c:\\temp\\disc1" }, new BluRayDiscInfo() { IsSelected = true, BluRayPath = "c:\\temp\\disc2" } };
     discs[0].BluRaySummaryInfoList = new List<BluRaySummaryInfo>() { new BluRaySummaryInfo() { IsSelected = true }, new BluRaySummaryInfo() { IsSelected = true, Eac3ToId = "1)" } };
     //when i get warnings
     IEAC3ToBatchFileWriteWarningService service = new EAC3ToBatchFileWriteWarningService(discs);
     WarningCollection warnings = service.GetWarnings();
     //then warnings should tell me i have selected discs found with no summary selected
     warnings.Where(w => w.Description.Contains("disc2 selected but no summary selected")).Count().Should().Be(1);
 }
        public void eac3tobatchfilewritewarningwervice_has_no_warnings_when_no_data_anomalies_test()
        {
            //given a list of discs where there is no data anomalis
            List<BluRayDiscInfo> discs = new List<BluRayDiscInfo>() { new BluRayDiscInfo() { IsSelected = true, BluRayPath = "c:\\temp\\disc1" }, new BluRayDiscInfo() { IsSelected = true, BluRayPath = "c:\\temp\\disc2" } };
            discs[0].BluRaySummaryInfoList = new List<BluRaySummaryInfo>() { new BluRaySummaryInfo() { IsSelected = true }, new BluRaySummaryInfo() { IsSelected = true, Eac3ToId = "1)" } };

            discs[1].BluRaySummaryInfoList = new List<BluRaySummaryInfo>() { new BluRaySummaryInfo() { IsSelected = true }, new BluRaySummaryInfo() { IsSelected = true, Eac3ToId = "2)" } };
            //when i get warnings
            IEAC3ToBatchFileWriteWarningService service = new EAC3ToBatchFileWriteWarningService(discs);
            WarningCollection warnings = service.GetWarnings();
            //then there should be no warnings
            warnings.Count().Should().Be(0);
        }
        public void eac3tobatchfilewritewarningwervice_has_warning_when_title_selected_and_no_summary_and_disc_selected_test()
        {
            //given a list of discs where title selected and summary and disc not selected
            List<BluRayDiscInfo> discs = new List<BluRayDiscInfo>() { new BluRayDiscInfo() { IsSelected = false, BluRayPath = "c:\\temp\\disc1" }, new BluRayDiscInfo() { IsSelected = false, BluRayPath = "c:\\temp\\disc2" } };
            discs[0].BluRaySummaryInfoList = new List<BluRaySummaryInfo>() { new BluRaySummaryInfo() { IsSelected = true, Eac3ToId = "1)" }, new BluRaySummaryInfo() { IsSelected = true, Eac3ToId = "2)" } };

            discs[1].BluRaySummaryInfoList = new List<BluRaySummaryInfo>() { new BluRaySummaryInfo() { IsSelected = false, Eac3ToId = "1)", BluRayTitleInfo = new BluRayTitleInfo() {Video = new BluRayTitleVideo() {IsSelected = true}} },
                new BluRaySummaryInfo() { IsSelected = true, Eac3ToId = "2)", BluRayTitleInfo = new BluRayTitleInfo() { AudioList = new List<BluRayTitleAudio>() {new BluRayTitleAudio() { IsSelected = true} } } } };
            //when i get warnings
            IEAC3ToBatchFileWriteWarningService service = new EAC3ToBatchFileWriteWarningService(discs);
            WarningCollection warnings = service.GetWarnings();
            //then warnings should tell me i have selected titles found with no disc or summary selected
            warnings.Where(w => w.Description.Contains("Disc disc2 summary 1) is not selected but has selected video")).Count().Should().Be(1);
        }
Exemplo n.º 4
0
        private void HandlesMenuItemWriteToMKVMergeBatFileClick()
        {
            DialogResult startProcessResult = MessageBox.Show("Create mkvmerge batch file?", "Start Process?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            _batchGuyEAC3ToSettings.X264Files = this.GetX264Files();
            _batchGuyEAC3ToSettings.X264FileSettings = this.GetX264FileSettings();
            this.SetEpisodeNames();

            if (startProcessResult == System.Windows.Forms.DialogResult.Yes)
            {
                if (this.IsScreenValidForWriteX264BatchFile() && this.IsScreenValidForMkvMerge())
                {
                    WarningCollection warnings = new EAC3ToBatchFileWriteWarningService(_batchGuyEAC3ToSettings.BluRayDiscs).GetWarnings();
                    this.MKVMergeWarnings(warnings);
                    if (warnings.Count() > 0)
                    {
                        string warning = string.Format("{0}{1}{2}Would you still like to continue?", warnings.GetWarningMessage(), Environment.NewLine, Environment.NewLine);
                        DialogResult warningResult = MessageBox.Show(warning, "Warnings Found", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                        if (warningResult == System.Windows.Forms.DialogResult.Yes)
                        {
                            this.WriteToMkvMergeBatchFile();
                        }
                    }
                    else
                    {
                        this.WriteToMkvMergeBatchFile();
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void createMkvmergeBatchFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult startProcessResult = MessageBox.Show("Create mkvmerge batch file?", "Start Process?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

                if (startProcessResult == System.Windows.Forms.DialogResult.Yes)
                {
                    dgvBluRayDiscInfo.CurrentCell = null; //force the cell change so cell changed event fires
                    dgvBluRaySummary.CurrentCell = null; //force the cell change so cell changed event fires
                    this.SetEac3ToConfiguration();
                    this.SetEAC3ToRemuxFileNameTemplate();
                    if (this.IsScreenValidForRemux() && this.IsAtLeastOneDiscLoaded() && this.IsScreenValid())
                    {
                        List<BluRayDiscInfo> discs = this.GetBluRayDiscInfoList();
                        WarningCollection warnings = new EAC3ToBatchFileWriteWarningService(discs).GetWarnings();
                        this.MKVMergeWarnings(warnings);
                        if (warnings.Count() > 0)
                        {
                            string warning = string.Format("{0}{1}{2}Would you still like to continue?", warnings.GetWarningMessage(), Environment.NewLine, Environment.NewLine);
                            DialogResult warningResult = MessageBox.Show(warning, "Warnings Found", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                            if (warningResult == System.Windows.Forms.DialogResult.Yes)
                            {
                                this.WriteToMkvMergeBatchFile();
                            }
                        }
                        else
                        {
                            this.WriteToMkvMergeBatchFile();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _displayErrorMessageService.DisplayError(new ErrorMessage() { DisplayMessage = "There was a problem creating the mkvmerge batch file!", DisplayTitle = "Error.", Exception = ex, MethodNameWhereExceptionOccurred = MethodBase.GetCurrentMethod().Name });
            }
        }