MoveToNextKey() public method

public MoveToNextKey ( ) : bool
return bool
Example #1
0
        public void MoveToNextKey()
        {
            StringWriter writer = new StringWriter();

            writer.WriteLine("; Test");
            writer.WriteLine("; Test 1");
            writer.WriteLine("[Nini Thing]");
            writer.WriteLine("; Test");
            writer.WriteLine(" my key = new key");
            IniReader reader = new IniReader(new StringReader(writer.ToString()));

            Assert.IsFalse(reader.MoveToNextKey());
            Assert.AreEqual(4, reader.LineNumber);
            Assert.IsTrue(reader.MoveToNextKey());
            Assert.AreEqual(6, reader.LineNumber);
            Assert.AreEqual(IniType.Key, reader.Type);
            Assert.AreEqual("my key", reader.Name);
        }
Example #2
0
        public void MoveToNextKey() {
            StringWriter writer = new StringWriter();
            writer.WriteLine("; Test");
            writer.WriteLine("; Test 1");
            writer.WriteLine("[Nini Thing]");
            writer.WriteLine("; Test");
            writer.WriteLine(" my key = new key");
            IniReader reader = new IniReader(new StringReader(writer.ToString()));

            Assert.IsFalse(reader.MoveToNextKey());
            Assert.AreEqual(4, reader.LineNumber);
            Assert.IsTrue(reader.MoveToNextKey());
            Assert.AreEqual(6, reader.LineNumber);
            Assert.AreEqual(IniType.Key, reader.Type);
            Assert.AreEqual("my key", reader.Name);
        }