public async Task TestPeek() { var reader = new NetworkReader(baseStream); Assert.AreEqual <char?>('\u2661', await reader.PeekCharAsync().ConfigureAwait(false)); Assert.AreEqual <char?>('\u2661', await reader.PeekCharAsync().ConfigureAwait(false)); Assert.AreEqual <char?>('\u2661', await reader.ReadCharAsync().ConfigureAwait(false)); }
public async Task TestPeekAndReadBytes() { var reader = new NetworkReader(baseStream); Assert.AreEqual <char?>('\u2661', await reader.PeekCharAsync().ConfigureAwait(false)); Assert.AreEqual( BitConverter.ToString(new byte[] { 0xe2, 0x99, 0xa1, 0x0d, 0x0a }), BitConverter.ToString(await reader.ReadBytesAsync(5)) ); }