Esempio n. 1
0
        public void TestPathingString6()
        {
            string        pathingString  = @"[There can be only one.]";
            List <string> pathingOptions = new List <string>()
            {
                "There can be only one."
            };

            HashSet <string> pathingResults = new HashSet <string>();

            for (int i = 0; i < 1000; i++)
            {
                string pathedString = VoiceAttackPlugin.SpeechFromScript(pathingString);
                pathingResults.Add(pathedString);
            }

            Assert.IsTrue(pathingResults.SetEquals(new HashSet <string>(pathingOptions)));
        }
Esempio n. 2
0
        public void TestPathingString5()
        {
            string        pathingString  = @"You leave me [no choice].";
            List <string> pathingOptions = new List <string>()
            {
                "You leave me no choice."
            };

            HashSet <string> pathingResults = new HashSet <string>();

            for (int i = 0; i < 1000; i++)
            {
                string pathedString = VoiceAttackPlugin.SpeechFromScript(pathingString);
                pathingResults.Add(pathedString);
            }

            Assert.IsTrue(pathingResults.SetEquals(new HashSet <string>(pathingOptions)));
        }
Esempio n. 3
0
        public void TestPathingString1()
        {
            string        pathingString  = @"There are [4;5] lights";
            List <string> pathingOptions = new List <string>()
            {
                "There are 4 lights"
                , "There are 5 lights"
            };

            HashSet <string> pathingResults = new HashSet <string>();

            for (int i = 0; i < 1000; i++)
            {
                string pathedString = VoiceAttackPlugin.SpeechFromScript(pathingString);
                pathingResults.Add(pathedString);
            }

            Assert.IsTrue(pathingResults.SetEquals(new HashSet <string>(pathingOptions)));
        }
Esempio n. 4
0
        public void TestPathingString2()
        {
            string        pathingString  = @"There are [4;5;] lights";
            List <string> pathingOptions = new List <string>()
            {
                "There are 4 lights"
                , "There are 5 lights"
                , "There are  lights"
            };

            HashSet <string> pathingResults = new HashSet <string>();

            for (int i = 0; i < 1000; i++)
            {
                string pathedString = VoiceAttackPlugin.SpeechFromScript(pathingString);
                pathingResults.Add(pathedString);
            }

            HashSet <string> expectedHashSet = new HashSet <string>(pathingOptions.Select(CondenseSpaces));

            Assert.IsTrue(pathingResults.SetEquals(expectedHashSet));
        }
Esempio n. 5
0
        public void TestPathingString4()
        {
            string        pathingString  = @";;;;;;Seven;;;";
            List <string> pathingOptions = new List <string>()
            {
                ""
                , "Seven"
            };

            int sevenCount = 0;

            for (int i = 0; i < 10000; i++)
            {
                string pathedString = VoiceAttackPlugin.SpeechFromScript(pathingString);
                if (pathedString == "Seven")
                {
                    sevenCount++;
                }
            }

            Assert.IsTrue(sevenCount > 750);
            Assert.IsTrue(sevenCount < 1500);
        }