public void GetEnumerator()
        {
            var text = new SimpleText("", 0, 0);
            var characters = text.ToArray();
            Assert.IsTrue(characters.Length == 0);

            text = new SimpleText("abc", 0, 3);
            characters = text.ToArray();
            Assert.IsTrue(characters.Length == 3);
            Assert.IsTrue(characters[0] == 'a');
            Assert.IsTrue(characters[1] == 'b');
            Assert.IsTrue(characters[2] == 'c');

            text = new SimpleText("__abc__", 2, 3);
            characters = text.ToArray();
            Assert.IsTrue(characters.Length == 3);
            Assert.IsTrue(characters[0] == 'a');
            Assert.IsTrue(characters[1] == 'b');
            Assert.IsTrue(characters[2] == 'c');
        }
Esempio n. 2
0
        public void GetEnumerator()
        {
            var text       = new SimpleText("", 0, 0);
            var characters = text.ToArray();

            Assert.IsTrue(characters.Length == 0);

            text       = new SimpleText("abc", 0, 3);
            characters = text.ToArray();
            Assert.IsTrue(characters.Length == 3);
            Assert.IsTrue(characters[0] == 'a');
            Assert.IsTrue(characters[1] == 'b');
            Assert.IsTrue(characters[2] == 'c');

            text       = new SimpleText("__abc__", 2, 3);
            characters = text.ToArray();
            Assert.IsTrue(characters.Length == 3);
            Assert.IsTrue(characters[0] == 'a');
            Assert.IsTrue(characters[1] == 'b');
            Assert.IsTrue(characters[2] == 'c');
        }