Ejemplo n.º 1
0
        public void Console()
        {
            var             maxLine = 5;
            IConsoleBuilder builder = new ConsoleBuilder()
            {
                MaxLine = maxLine,
            };

            Enumerable.Range(0, 10).ToList().ForEach(x => builder.AppendLine(x.ToString() + "_" + Random2.GenerateRandomString(Random2.Next(1, x + 2))));
            var str   = builder.ToString();
            var array = str.Split(Environment.NewLine);

            TestContext.Write(str);
            Assert.IsTrue(maxLine == array.Length);
        }
Ejemplo n.º 2
0
        public void ConsoleException()
        {
            var             maxLine = 7;
            IConsoleBuilder builder = new ConsoleBuilder()
            {
                MaxLine = maxLine,
            };

            builder.AppendLine(new Exception("aaaaa").ToStringThrow());
            builder.AppendLine(new AccessViolationException("bbbb").ToStringThrow());
            builder.AppendLine(new AggregateException("ddd").ToStringThrow());
            builder.AppendLine(new IndexOutOfRangeException("ffff").ToStringThrow());
            builder.AppendLine(new ArgumentOutOfRangeException("ggg").ToStringThrow());
            builder.AppendLine(new BadImageFormatException("zzzz").ToStringThrow());
            builder.AppendLine(new DllNotFoundException("qqqqqqq").ToStringThrow());
            var str   = builder.ToString();
            var array = str.Split(Environment.NewLine);

            TestContext.Write(str);
            Assert.IsTrue(maxLine == array.Length);
        }