public void SetPartMarker()
        {
            Tokenizer testSubject = new Tokenizer("set part marker");

            testSubject.SetPartMarker();
            testSubject.GetNextAsString();
            testSubject.GetNextAsString();

            Assert.AreEqual("set part", testSubject.GetPart(testSubject.PartMarker, testSubject.Position));

            testSubject.SetPartMarker();
            testSubject.GetNextAsString();

            Assert.AreEqual(" marker", testSubject.GetPart(testSubject.PartMarker, testSubject.Position));
        }
        public void PartMarker()
        {
            Tokenizer testSubject = new Tokenizer("part of this");

            testSubject.SetPartMarker();
            int origin = testSubject.PartMarker;
            testSubject.GetNextAsString();
            testSubject.GetNextAsString();
            Assert.AreEqual("part of", testSubject.GetPart(origin, testSubject.Position));
        }
        public void Reset()
        {
            Tokenizer testSubject = new Tokenizer("Foo Bar BAz");

            string source1 = testSubject.GetPart(0, "Foo Bar BAz".Length);

            testSubject.Reset("baZ BAR foo");

            string source2 = testSubject.GetPart(0, "baZ BAR foo".Length);

            Assert.AreNotEqual(source1, source2);

            Assert.AreEqual("Foo Bar BAz", source1);
            Assert.AreEqual("baZ BAR foo", source2);
        }
        public void GetPart()
        {
            Tokenizer testSubject = new Tokenizer("FOO.BAR AS BAR.FOO");

            string actual = testSubject.GetPart(0, "FOO.BAR AS BAR.FOO".Length);

            Assert.AreEqual("FOO.BAR AS BAR.FOO", actual);

            testSubject.SetPartMarker();

            Assert.AreEqual(0, testSubject.PartMarker);
            Assert.AreEqual(0, testSubject.Position);

            actual = testSubject.GetNextAsString();

            Assert.AreEqual("BAR", actual);
            Assert.AreEqual(SqlTokenType.IdentifierChain, testSubject.TokenType);
            Assert.That(!testSubject.WasIdentifierChainPredecessorDelimited);
            Assert.AreEqual("FOO", testSubject.IdentifierChainPredecessor);

            Assert.AreEqual("FOO.BAR ".IndexOf(' '), testSubject.Position);

            actual = testSubject.GetPart(testSubject.PartMarker, testSubject.Position);

            Assert.AreEqual("FOO.BAR", actual);

            testSubject.SetPartMarker();

            actual = testSubject.GetNextAsString();

            Assert.AreEqual(Token.ValueFor.AS, actual);
            Assert.AreEqual("FOO.BAR_AS ".IndexOf(' '), testSubject.Position);

            actual = testSubject.GetPart(testSubject.PartMarker, testSubject.Position);

            Assert.AreEqual(" AS", actual);
        }