public void ReadInvalidData()
{
MemoryStream stream = new MemoryStream();
BinaryWriter writer = new BinaryWriter(stream);
writer.Write((byte)255);
stream.Seek(0, SeekOrigin.Begin);
InputChannel channel = new InputChannel(new BinaryReader(stream));
try
{
channel.Read();
Assert.Fail();
}
catch (Exception ex)
{
Assert.IsInstanceOfType(ex, typeof(InvalidDataException));
}
}