public void IsValidVoicePackLoadedTest() { //IsValidVoicepackLoaded() is partially implicitly tested by LoadFromFileReturnValueTest var a = new VoicepackExtended(); Assert.IsFalse(a.IsValidVoicepackLoaded()); }
private void btnPrintGlobalVoicepack_Click(object sender, EventArgs e) { var globalCopyToPrint = new VoicepackExtended(); globalCopyToPrint.GetFromGlobal(); this.txtBoxDebugInfo.AppendText(globalCopyToPrint.ToString()); }
public void MergeTest() { var testPack1 = new VoicepackExtended(); var testPack2 = new VoicepackExtended(); //Load default soundsqw (this code uses global data that doesn't exist while running tests) //testPack1.InitializeToDefault(); //testPack2.InitializeToDefault(); //testPack1.Merge(testPack2); //Assert.IsTrue(testPack1.EqualSoundFilenames(testPack2), "Merging default packs should not change anything"); testPack1.LoadFromFile(TestData.Pack1); testPack2.LoadFromFile(TestData.Pack2); //var testPack2Ex = new VoicepackExtended(); //testPack2Ex.LoadFromFile(TestData.Pack2andExtraSound); testPack1.Merge(testPack2); var combinedPack = new VoicepackExtended(); combinedPack.LoadFromFile(TestData.Pack1and2); //doesnt work anymore, as my testdata is not 100% valid //Assert.IsTrue(testPack1.EqualSoundFilenames(combinedPack)); }
public void FindPAKReferenceInVoicepackAndChangeIntegrationTest() { VoicepackExtended pack = new VoicepackExtended(); pack.LoadFromFile(TestData.VoicepackTheOffice); //Just find Assert.IsTrue(VoicepackCleaner.FindPAKreferenceInVoicepackAndReplace(pack, "HesDead.ogg_System.Byte", null)); //Find and replace Assert.IsTrue(VoicepackCleaner.FindPAKreferenceInVoicepackAndReplace(pack, "HesDead.ogg_System.Byte", "newstring")); //Find replaced string, should not be found Assert.IsFalse(VoicepackCleaner.FindPAKreferenceInVoicepackAndReplace(pack, "HesDead.ogg_System.Byte", null)); //Find new string, should be found Assert.IsTrue(VoicepackCleaner.FindPAKreferenceInVoicepackAndReplace(pack, "newstring", null)); //manually check the right place of the string //should be in HEADSHOT achievement, which is in place 0 //var test = pack.Voicepack.groupManager.achievementList["HEAD_SHOT"].dynamicSounds.sounds[1].pakSoundFile; //Console.WriteLine(test); // pakSoundFile "HesDead.ogg_System.Byte" string HEADSHOT ix 0 // pakSoundPath "RanOver.ogg_System.Byte" string ROAD_KILL ix 3 }
public void InitializeToDefaultTest() { var testPack = new VoicepackExtended(); Assert.IsFalse(testPack.IsValidVoicepackLoaded()); testPack.InitializeToDefault(); Assert.IsTrue(testPack.IsValidVoicepackLoaded()); }
public VoicepackCombiner(bool loadFromSettingFile = true) { InitializeCombinedVoicepack(); GlobalVoicepackBackup = new VoicepackExtended(); if (loadFromSettingFile) { LoadFromUserSettings(); } }
public void LoadFromFileReturnValueTest() { var a = new VoicepackExtended(); Assert.IsFalse(a.LoadFromFile("not a file")); //Cant run this as it generates an exception that is caught before my code can catch it //And it shows a popup //Assert.IsFalse(a.LoadFromFile(RealFileButNoValidVoicePackFile)); Assert.IsTrue(a.LoadFromFile(TestData.VoicepackXMLBased)); Assert.IsTrue(a.LoadFromFile(TestData.VoicepackPAKBased)); }
public void TestsWithVoicepackFiles() { var testPack1 = new VoicepackExtended(); var testPack2 = new VoicepackExtended(); testPack1.LoadFromFile(TestData.Pack1); testPack2.LoadFromFile(TestData.Pack1); Assert.IsTrue(testPack2.EqualComponentInfo(testPack1), "Voicepacks loaded from same file should have same info"); testPack2.LoadFromFile(TestData.VoicepackPAKBased); Assert.IsFalse(testPack2.EqualComponentInfo(testPack1), "Voicepacks loaded from different file should not have same info"); testPack2.LoadFromFile(TestData.Pack1Republished); Assert.IsTrue(testPack2.EqualComponentInfo(testPack1), "Voicepacks loaded from republished file should have same info"); }
public void ChangeComponentDataKeysTest() { List <string> oldKeys = new List <string>(); oldKeys.Add("oldKey"); VoicepackExtended pack = new VoicepackExtended(); pack.InitializeToDefault(); pack.Voicepack.componentData.Add("oldKey", new ComponentData()); VoicepackCleaner.ChangeComponentDataKeys(pack, oldKeys, "prefix"); Assert.IsTrue(pack.Voicepack.componentData.ContainsKey("prefix:oldKey")); Assert.IsFalse(pack.Voicepack.componentData.ContainsKey("oldKey")); }
public void TestsWithVoicepacksfromFile() { var k = new VoicepackExtended(); var l = new VoicepackExtended(); k.LoadFromFile(TestData.Pack1); l.LoadFromFile(TestData.Pack1); Assert.IsTrue(k.EqualSoundFilenames(l), "Voicepack objects loaded from the same file should be equal"); Assert.IsTrue(l.EqualSoundFilenames(k), "Voicepack objects loaded from the same file should be equal and commutative"); l.LoadFromFile(TestData.Pack2); Assert.IsFalse(l.EqualSoundFilenames(k), "Voicepacks loaded from different files with different content should not be equal"); Assert.IsFalse(k.EqualSoundFilenames(l), "Voicepacks loaded from different files with different content should not be equal"); l.LoadFromFile(TestData.Pack1Republished); Assert.IsFalse(k.EqualSoundFilenames(l), "This particular republished voicepack differs in one place, because republishing discards the old one sound when there are dynamic sounds (contrived example, tho not intended)"); }
public static VoicepackExtended Create() { var sample = new VoicepackExtended(); sample.InitializeToDefault(); //One achievement with 1 'old style' sound var achievementList = sample.Voicepack.groupManager.achievementList; achievementList[SampleAchievements[0]].fileSoundPath = "filepath1"; achievementList[SampleAchievements[0]].pakSoundPath = "pakpath1"; //One achievement with 2 dynamic sounds achievementList[SampleAchievements[1]].dynamicSounds = new BasicDynamicSoundManager(); var sounds = achievementList[SampleAchievements[1]].dynamicSounds.sounds = new BasicAchievementSound[2]; sounds[0] = new BasicAchievementSound { pakSoundFile = SampleAchievements[1] + "_pakSoundFile1", soundFile = SampleAchievements[1] + "_soundFile1" }; sounds[1] = new BasicAchievementSound { pakSoundFile = SampleAchievements[2] + "_pakSoundFile1", soundFile = SampleAchievements[2] + "_soundFile1" }; //sounds[0].pakSoundFile = SampleAchievements[1] + "_pakSoundFile1"; //sounds[0].soundFile = SampleAchievements[1] + "_soundFile1"; //sounds[1].pakSoundFile = SampleAchievements[2] + "_pakSoundFile2"; //sounds[1].soundFile = SampleAchievements[2] + "_soundFile2"; //sounds[1] = CreateBasicAchievementSound(SampleAchievements[2] + "_pakSoundFile2", SampleAchievements[2] + "_soundFile2"); return(sample); }
private void InitializeCombinedVoicepack() { CombinedVoicepack = new VoicepackExtended(); CombinedVoicepack.InitializeToDefault(); InitializeCombinedComponentInformation(CombinedVoicepack); }
private void InitializeCombinedComponentInformation(VoicepackExtended voicepack) { voicepack.Voicepack.componentInformation.name = "Combined Voicepack"; voicepack.Voicepack.componentInformation.author = ""; voicepack.Voicepack.componentInformation.description = ""; }