Esempio n. 1
0
        public async Task WriteAsyncCharArrayIndexCountTest()
        {
            using (CharArrayTextWriter tw = NewTextWriter)
            {
                await tw.WriteAsync(TestDataProvider.CharData, 3, 5);

                Assert.Equal(new string(TestDataProvider.CharData, 3, 5), tw.Text);
            }
        }
Esempio n. 2
0
        public async Task WriteAsyncCharTest()
        {
            using (CharArrayTextWriter tw = NewTextWriter)
            {
                await tw.WriteAsync('a');

                Assert.Equal("a", tw.Text);
            }
        }
Esempio n. 3
0
        public async Task WriteAsyncStringTest()
        {
            using (CharArrayTextWriter tw = NewTextWriter)
            {
                var toWrite = new string(TestDataProvider.CharData);
                await tw.WriteAsync(toWrite);

                Assert.Equal(toWrite, tw.Text);
            }
        }
Esempio n. 4
0
        public async Task WriteCharMemoryTest()
        {
            using (CharArrayTextWriter tw = NewTextWriter)
            {
                var rs = new Memory <char>(TestDataProvider.CharData, 4, 6);
                await tw.WriteAsync(rs);

                Assert.Equal(new string(rs.Span), tw.Text);
            }
        }