public void NetworkStream_OnSetLength_ExceptionThrown() { byte[] bytes = System.Text.Encoding.Unicode.GetBytes(TEST_STRING); NoSeekMemoryStream stream = new NoSeekMemoryStream(bytes, 10, 5); stream.SetLength(2000); }
public void TestMethod6() { try { byte[] buf1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; NoSeekMemoryStream nsms = new NoSeekMemoryStream(buf1); nsms.SetLength(8); Assert.Fail("An exception should have been thrown"); } catch (Exception e) { Assert.AreEqual(e.GetType(), typeof(NotSupportedException)); } }