Exemple #1
0
        public void Base_FindArrayWithinArrayBadPosition()
        {
            char[]           arrayToFind = { 'M', 'A', 'C', 'D' };
            GeneralPhonetics gp          = new GeneralPhonetics("Macdonald Smack");

            Assert.AreEqual(0, gp.ArrayMatchFromPosition(-1, arrayToFind));
            gp.Dispose();
        }
Exemple #2
0
        public void Base_SpaceWordFindWordEnd()
        {
            GeneralPhonetics gp = new GeneralPhonetics("Macdonald Smack");

            gp.GetWordEnd(9);
            Assert.AreEqual(8, gp.WordEndPosition);
            gp.Dispose();
        }
Exemple #3
0
        public void Base_NoWordFindWordEnd()
        {
            GeneralPhonetics gp = new GeneralPhonetics("----");

            gp.GetWordEnd(2);
            Assert.AreEqual(0, gp.WordEndPosition);
            gp.Dispose();
        }
Exemple #4
0
        public void Base_BeyondLastWordFindWordEnd()
        {
            GeneralPhonetics gp = new GeneralPhonetics("Macdonald Smack 1234567890");

            gp.GetWordEnd(20);
            Assert.AreEqual(14, gp.WordEndPosition);
            gp.Dispose();
        }
Exemple #5
0
        public void TestDoubleReplacements()
        {
            char[]           a  = new char[] { 'C', 'J', 'X' };
            GeneralPhonetics bp = new GeneralPhonetics("Jedox");

            bp.TwoCharacterReplacements = a;
            bp.Iterate();
            Assert.AreEqual(7, bp.GetOutputLength());
            bp.Dispose();
        }
Exemple #6
0
        public void Base_InvalidInputFindWordEnd()
        {
            GeneralPhonetics gp = new GeneralPhonetics("Macdonald Smack");

            gp.GetWordEnd(-1);
            Assert.AreEqual(8, gp.WordEndPosition);
            gp.Dispose();


            gp = new GeneralPhonetics("Macdonald Smack");
            gp.GetWordEnd(int.MaxValue);
            Assert.AreEqual(14, gp.WordEndPosition);
            gp.Dispose();
        }