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

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

                Assert.Equal("a" + tw.NewLine, tw.Text);
            }
        }
Esempio n. 3
0
        public async void WriteLineAsyncTest()
        {
            using (CharArrayTextWriter tw = NewTextWriter)
            {
                await tw.WriteLineAsync();

                Assert.Equal(tw.NewLine, tw.Text);
            }
        }
Esempio n. 4
0
        public async Task WriteLineAsyncStringTest()
        {
            using (CharArrayTextWriter tw = NewTextWriter)
            {
                var toWrite = new string(TestDataProvider.CharData);
                await tw.WriteLineAsync(toWrite);

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

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