AddEoFOp() public method

public AddEoFOp ( ) : void
return void
Beispiel #1
0
        public void Eof_Op_Bwd() {
            Dev2TokenizerBuilder dtb = new Dev2TokenizerBuilder
                                       {
                                           ToTokenize = Search,
                                           ReverseOrder = true
                                       };


            dtb.AddEoFOp();

            IDev2Tokenizer dt = dtb.Generate();

            string result = string.Empty;

            int cnt = 0;
            while (dt.HasMoreOps()) {
                result += dt.NextToken();
                cnt++;
            }

            Assert.AreEqual("AB-CD-DE-FG-HI", result);
            Assert.IsTrue(cnt == 1);
        }
Beispiel #2
0
        public void Empty_String_Error() {
            Dev2TokenizerBuilder dtb = new Dev2TokenizerBuilder { ToTokenize = string.Empty };


            dtb.AddEoFOp();

            try
            {
                dtb.Generate();

                Assert.Fail();
            }
            catch (Exception) {
                Assert.IsTrue(true);
            }
        }
Beispiel #3
0
        public void More_Then_One_Op_Fwd()
        {
            Dev2TokenizerBuilder dtb = new Dev2TokenizerBuilder { ToTokenize = Search };


            dtb.AddIndexOp(2);
            dtb.AddEoFOp();

            IDev2Tokenizer dt = dtb.Generate();

            string result = string.Empty;

            int cnt = 0;
            while (dt.HasMoreOps())
            {
                result += dt.NextToken();
                cnt++;
            }

            Assert.AreEqual("AB-CD-DE-FG-HI", result);
            Assert.IsTrue(cnt == 2);
        }