예제 #1
0
        public void Character()
        {
            string result = null;

            using (var writer = TextIndenter.Open((char r) => result += r))
                writer.Write("1337").Wait();
            Assert.Equal("1337", result);
        }
예제 #2
0
        public void String(string expect, string[] append)
        {
            string result = null;

            using (var indenter = TextIndenter.Open(r => result = r))
                foreach (var a in append)
                {
                    indenter.Write(a.GetEnumerator());
                }
            Assert.Equal(expect, result);
        }
예제 #3
0
        public void Task(string expect, string[] append)
        {
            var result = TextIndenter.Open();

            foreach (var a in append)
            {
                result.Item1.Write(a.GetEnumerator());
            }
            result.Item1.Close();
            Assert.Equal(expect, result.Item2.WaitFor());
        }