public void ZeroLengthInputStream() { var lis = new LzwInputStream(new MemoryStream()); bool exception = false; try { lis.ReadByte(); } catch { exception = true; } Assert.IsTrue(exception, "reading from an empty stream should cause an exception"); }