public void TestDefaultCombiIgnoreNameCsv() { // Create. _generator = new ListGeneratorDifferencesList(450, false) { PcgMemory = _pcgMemory, IgnoreInitCombis = true, SelectedProgramBanks = new ObservableBankCollection <IProgramBank>(), SelectedCombiBanks = new ObservableBankCollection <ICombiBank>(), SetListsEnabled = false, ListOutputFormat = ListGenerator.OutputFormat.Csv, OutputFileName = $"{Path.GetFileNameWithoutExtension(_pcgMemory.FileName)}_output.csv" }; _generator.SelectedCombiBanks.Add((CombiBank)_pcgMemory.CombiBanks[0]); // [0] = I-A _generator.SelectedCombiBanks.Add((CombiBank)_pcgMemory.CombiBanks[2]); // [2] = I-C //foreach (var item in _pcgMemory.CombiBanks) // { // _generator.SelectedCombiBanks.Add(item); //} // Run. Run(); // All programs (at least one I-A). AssertExists("Combi, I-A010, Phantasies, 446, I-C126, Moving Synth-Bells"); Assert.AreEqual(2, _lines.Length); }
/// <summary> /// /// </summary> private void SetDefaultsListGeneratorDifferencesList() { ListGeneratorDifferencesList diffListGenerator = ListGenerator as ListGeneratorDifferencesList; Debug.Assert(diffListGenerator != null); if (!_options.Keys.Contains("-dlmnod")) { diffListGenerator.MaxDiffs = 10; } if (!_options.Keys.Contains("-dlipn")) { diffListGenerator.IgnorePatchNames = true; } if (!_options.Keys.Contains("-dlislsd")) { diffListGenerator.IgnoreSetListSlotDescriptions = true; } if (!_options.Keys.Contains("-dlsbd")) { diffListGenerator.SearchBothDirections = false; } }
/// <summary> /// /// </summary> /// <param name="optionPair"></param> private void ParseOptionDlsbd(KeyValuePair <string, string> optionPair) { { ListGeneratorDifferencesList diffListGenerator = ListGenerator as ListGeneratorDifferencesList; if (diffListGenerator == null) { throw new CommandLineArgumentException( string.Format(Strings.OnlyDifferencesError, optionPair.Key)); } diffListGenerator.SearchBothDirections = GetBooleanOptionValue(optionPair); } }
/// <summary> /// /// </summary> /// <param name="optionPair"></param> private void ParseOptionDlislsd(KeyValuePair <string, string> optionPair) { { ListGeneratorDifferencesList diffListGenerator = ListGenerator as ListGeneratorDifferencesList; if (diffListGenerator == null) { throw new CommandLineArgumentException( string.Format(Strings.OnlyDifferencesError, optionPair.Key)); } diffListGenerator.IgnoreSetListSlotDescriptions = GetBooleanOptionValue(optionPair); } }
/// <summary> /// /// </summary> /// <param name="optionPair"></param> private void ParseOptionDlmnod(KeyValuePair <string, string> optionPair) { { ListGeneratorDifferencesList diffListGenerator = ListGenerator as ListGeneratorDifferencesList; if (diffListGenerator == null) { throw new CommandLineArgumentException( string.Format(Strings.OnlyDifferencesError, optionPair.Key)); } diffListGenerator.MaxDiffs = GetIntOptionValue(optionPair, 0, 1000); } }
public void TestDefaultSetListOutputAsciiTable() { // Create. _generator = new ListGeneratorDifferencesList(5) { PcgMemory = _pcgMemory, SelectedProgramBanks = new ObservableBankCollection <IProgramBank>(), SelectedCombiBanks = new ObservableBankCollection <ICombiBank>(), SetListsEnabled = true, IgnoreInitSetListSlots = true, SetListsRangeFrom = 0, SetListsRangeTo = 1, DrumKitsEnabled = true, IgnoreInitDrumKits = true, DrumPatternsEnabled = true, IgnoreInitDrumPatterns = true, WaveSequencesEnabled = true, IgnoreInitWaveSequences = true, ListOutputFormat = ListGenerator.OutputFormat.AsciiTable, OutputFileName = $"{Path.GetFileNameWithoutExtension(_pcgMemory.FileName)}_output.txt" }; // Only 1 program bank and 2 combi banks to improve speed. foreach (var bank in _pcgMemory.ProgramBanks.BankCollection) { if (bank.Id == "U-A") { _generator.SelectedProgramBanks.Add((IProgramBank)bank); } } for (var index = 0; index < 2; index++) { _generator.SelectedCombiBanks.Add((ICombiBank)_pcgMemory.CombiBanks[index]); } // Run. Run(); Assert.AreEqual(66, _lines.Length); }
public void TestDefaultSetListOutputAsciiTableCombis() { // Create. _generator = new ListGeneratorDifferencesList(500) // Not low #diffs in combis, so 500 { PcgMemory = _pcgMemory, SelectedProgramBanks = new ObservableBankCollection <IProgramBank>(), SelectedCombiBanks = new ObservableBankCollection <ICombiBank>(), SetListsEnabled = false, ListOutputFormat = ListGenerator.OutputFormat.AsciiTable, OutputFileName = $"{Path.GetFileNameWithoutExtension(_pcgMemory.FileName)}_output.txt" }; for (var index = 0; index < 3; index++) // Only 3 bank to improve performance. { _generator.SelectedCombiBanks.Add((CombiBank)_pcgMemory.CombiBanks[index]); } // Run. Run(); Assert.AreEqual(44, _lines.Length); }
public void TestDefault() { // Create. _generator = new ListGeneratorDifferencesList { PcgMemory = _pcgMemory, IgnoreInitCombis = true, SelectedProgramBanks = new ObservableBankCollection <IProgramBank>(), SelectedCombiBanks = new ObservableBankCollection <ICombiBank>(), SetListsEnabled = false, DrumKitsEnabled = false, DrumPatternsEnabled = false, WaveSequencesEnabled = false, ListOutputFormat = ListGenerator.OutputFormat.Text, OutputFileName = $"{Path.GetFileNameWithoutExtension(_pcgMemory.FileName)}_output.txt" }; _generator.SelectedProgramBanks.Add((IProgramBank)_pcgMemory.ProgramBanks[0]); _generator.SelectedProgramBanks.Add((IProgramBank)_pcgMemory.ProgramBanks[6]); _generator.SelectedProgramBanks.Add((IProgramBank)_pcgMemory.ProgramBanks[7]); foreach (var item in _pcgMemory.CombiBanks.BankCollection) { _generator.SelectedCombiBanks.Add((ICombiBank)item); } // Run. Run(); // All programs (at least one I-A and U-A existing). AssertExists(" 6 Diffs: U-A001"); // All combi banks (all contain U-A) AssertExists("U-A"); Assert.AreEqual(27, _lines.Length); }
/// <summary> /// /// </summary> private void ParseParameters() { // Check there are exactly 4 parameters. if (_parameters.Count != 4) { throw new CommandLineArgumentException(Strings.FourParametersNeededError); } PcgFileName = _parameters[0]; // Create generator. switch (GetMatch(new List <string> { "PATCH_LIST", "PROGRAM_USAGE_LIST", "COMBI_CONTENT_LIST", "DIFFERENCES_LIST", "FILE_CONTENT_LIST" }, _parameters[1])) { case "PATCH_LIST": ListGenerator = new ListGeneratorPatchList(); break; case "PROGRAM_USAGE_LIST": ListGenerator = new ListGeneratorProgramUsageList(); break; case "COMBI_CONTENT_LIST": ListGenerator = new ListGeneratorCombiContentList(); break; case "DIFFERENCES_LIST": ListGenerator = new ListGeneratorDifferencesList(); break; case "FILE_CONTENT_LIST": ListGenerator = new ListGeneratorFileContentList(); break; default: throw new CommandLineArgumentException(string.Format(Strings.IllegalListType, _parameters[1])); } // Default not needed (exception thrown) switch (GetMatch(new List <string> { "COMPACT", "SHORT", "DEFAULT" }, _parameters[2])) { case "COMPACT": ListGenerator.ListSubType = PcgTools.ListGenerator.ListGenerator.SubType.Compact; break; case "SHORT": ListGenerator.ListSubType = PcgTools.ListGenerator.ListGenerator.SubType.Short; break; case "DEFAULT": // Do nothing break; default: throw new CommandLineArgumentException(string.Format(Strings.IllegalSubType, _parameters[2])); } ListGenerator.OutputFileName = _parameters[3]; }