System.IO.Tests.WriteTests.WriteChars C# (CSharp) Method

WriteChars() private method

private WriteChars ( ) : void
return void
        public void WriteChars()
        {
            char[] chArr = setupArray();

            // [] Write a wide variety of characters and read them back

            Stream ms = CreateStream();
            StreamWriter sw = new StreamWriter(ms);
            StreamReader sr;

            for (int i = 0; i < chArr.Length; i++)
                sw.Write(chArr[i]);
            sw.Flush();
            ms.Position = 0;
            sr = new StreamReader(ms);

            for (int i = 0; i < chArr.Length; i++)
            {
                Assert.Equal((int)chArr[i], sr.Read());
            }
        }