Example #1
0
 public void sortservice_will_update_sort_configuration_lastsortbycolumn_test()
 {
     //given a list
     List<BluRaySummaryInfo> unsortedList = new List<BluRaySummaryInfo>() { new BluRaySummaryInfo() { Eac3ToId = "8)", BluRayTitleInfo = new BluRayTitleInfo() { EpisodeNumber = "8"} }, new BluRaySummaryInfo() { Eac3ToId = "1)",  BluRayTitleInfo = new BluRayTitleInfo() { EpisodeNumber = "1"} },
         new BluRaySummaryInfo() { Eac3ToId = "4)", BluRayTitleInfo = new BluRayTitleInfo() { EpisodeNumber = "4"} } };
     //when i attempt to sort by a column in desc order
     SortConfiguration config = new SortConfiguration() { LastSortByColumnName = string.Empty, SortByColumnName = "EpisodeNumber", SortDirection = EnumSortDirection.Asc };
     ISortService<BluRaySummaryInfo> service = new SortService<BluRaySummaryInfo>(config, unsortedList);
     //list should be ordered by column in desc order
     List<BluRaySummaryInfo> sortedList = service.Sort();
     config.LastSortByColumnName.Should().Be("EpisodeNumber");
 }
 private void ReloadEac3ToSettingsAndBluRayDiscs(BatchGuyEAC3ToSettings batchGuyEAC3ToSettings)
 {
     _bindingListBluRayDiscInfo = new BindingList<BluRayDiscInfo>();
     _bindingListBluRaySummaryInfo = new BindingList<BluRaySummaryInfo>();
     _bluRaySummaryGridSortConfiguration = new SortConfiguration();
     _bluRayDiscGridSortConfiguration = new SortConfiguration();
     _currentBluRayDiscGridRowIndex = 0;
     _eac3toConfiguration = batchGuyEAC3ToSettings.EAC3ToSettings;
     txtBatFilePath.Text = _eac3toConfiguration.BatchFilePath;
     txtMKVMergeBatFilePath.Text = _eac3toConfiguration.MKVMergeBatchFilePath;
     txtMKVMergeOutputPath.Text = _eac3toConfiguration.MKVMergeOutputPath;
     _eac3toConfiguration.IsVideoNameForEncodeMkvMerge = false;
     txtEac3toOutputDirectory.Text = _eac3toConfiguration.EAC3ToOutputPath;
     foreach (BluRayDiscInfo disc in batchGuyEAC3ToSettings.BluRayDiscs)
     {
         _bindingListBluRayDiscInfo.Add(disc);
     }
     _currentBluRayDiscInfo = _bindingListBluRayDiscInfo[0];
     foreach (BluRaySummaryInfo summary in _currentBluRayDiscInfo.BluRaySummaryInfoList)
     {
         _bindingListBluRaySummaryInfo.Add(summary);
     }
     this.SetcbEac3ToOutputDirectoryType();
     this.BindDgvBluRayDiscInfoGrid();
     this.BindDgvBluRaySummaryGrid();
 }