Esempio n. 1
0
        public InLogicalConsole(int width, int height, int left, int top, ConsoleColor initalBackground = ConsoleColor.Black, ConsoleColor initalForeground = ConsoleColor.Gray)
            : base(width, height, left, top, initalBackground, initalForeground)
        {
            _inputLine = new StringBuilder();

            MaxInputLength = int.MaxValue;

            _inputCursor = 0;
            _inputHistory = new RollingCollection<string>(100);
        }
Esempio n. 2
0
        public void RollingCollection_Add()
        {
            var c = new RollingCollection <string>(10);

            Assert.AreEqual(0, c.Count);
            c.Add("a");
            Assert.AreEqual(1, c.Count);

            var cc = c.ToList();

            Assert.AreEqual(1, cc.Count);
            Assert.AreEqual("a", cc[0]);
        }
Esempio n. 3
0
        public void RollingCollection_With_Overflow()
        {
            var c = new RollingCollection <string>(3);

            Assert.AreEqual(0, c.Count);
            c.Add("a");
            Assert.AreEqual(1, c.Count);
            c.Add("b");
            Assert.AreEqual(2, c.Count);
            c.Add("c");
            Assert.AreEqual(3, c.Count);

            c.Add("d");
            Assert.AreEqual(3, c.Count);

            Assert.AreEqual("d", c[2]);
        }