[Test]
[ExpectedException (typeof (NotSupportedException))]
public void GetLength ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Read);
long x = cs.Length;
}
[Test]
[ExpectedException (typeof (NotSupportedException))]
public void GetPosition ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Read);
long x = cs.Position;
}
- [Test]\r
- [ExpectedException (typeof (NotSupportedException))]\r
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
public void SetPosition ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Read);
cs.Position = 1;
}
- [Test]\r
- [ExpectedException (typeof (NotSupportedException))]\r
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
public void Seek ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Read);
cs.Seek (0, SeekOrigin.Begin);
}
- [Test]\r
- [ExpectedException (typeof (NotSupportedException))]\r
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
public void SetLength ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Read);
cs.SetLength (0);
}
[ExpectedException (typeof (NotSupportedException))]
public void FlushFinalBlock_Dual ()
{
- // do no corrupt writeStream in further tests\r
- using (Stream s = new MemoryStream ()) {\r
+ // do no corrupt writeStream in further tests
+ using (Stream s = new MemoryStream ()) {
byte[] data = {0, 1, 2, 3, 4, 5, 6, 7};
cs = new CryptoStream (s, encryptor, CryptoStreamMode.Write);
cs.Write (data, 0, data.Length);
}
}
- [Test]\r
+ [Test]
// LAMESPEC or MS BUG [ExpectedException (typeof (ObjectDisposedException))]
[ExpectedException (typeof (ArgumentNullException))]
public void FlushFinalBlock_Disposed ()
- {\r
- // do no corrupt writeStream in further tests\r
- using (Stream s = new MemoryStream ()) {\r
+ {
+ // do no corrupt writeStream in further tests
+ using (Stream s = new MemoryStream ()) {
cs = new CryptoStream (s, encryptor, CryptoStreamMode.Write);
cs.Clear ();
cs.FlushFinalBlock ();
// LAMESPEC or MS BUG [ExpectedException (typeof (ObjectDisposedException))]
[ExpectedException (typeof (ArgumentNullException))]
public void Read_Disposed ()
- {\r
- // do no corrupt readStream in further tests\r
- using (Stream s = new MemoryStream ()) {\r
+ {
+ // do no corrupt readStream in further tests
+ using (Stream s = new MemoryStream ()) {
byte[] buffer = new byte [8];
cs = new CryptoStream (s, encryptor, CryptoStreamMode.Read);
cs.Clear ();
[ExpectedException (typeof (ArgumentNullException))] // should fail like previous test case
#endif
public void Read_Disposed_Break ()
- {\r
- // do no corrupt readStream in further tests\r
- using (Stream s = new MemoryStream ()) {\r
+ {
+ // do no corrupt readStream in further tests
+ using (Stream s = new MemoryStream ()) {
byte[] buffer = new byte [8];
cs = new CryptoStream (s, encryptor, CryptoStreamMode.Read);
int len = cs.Read (buffer, 0, 4);
}
}
- [Test]\r
- [ExpectedException (typeof (NotSupportedException))]\r
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
public void Read_WriteStream ()
{
cs = new CryptoStream (writeStream, encryptor, CryptoStreamMode.Write);
cs.Read (buffer, 0, 8);
}
- [Test]\r
+ [Test]
[ExpectedException (typeof (NullReferenceException))]
public void Read_NullBuffer ()
{
cs.Read (null, 0, 8);
}
- [Test]\r
+ [Test]
public void Read_EmptyBuffer_ZeroCount ()
{
byte[] buffer = new byte [0];
cs.Read (buffer, -1, 8);
}
- [Test]\r
+ [Test]
public void Read_ZeroCount ()
{
byte[] buffer = new byte [8];
[ExpectedException (typeof (ArgumentNullException))] // to match exception throw by Read in a similar case
#endif
public void Write_Disposed ()
- {\r
- // do no corrupt writeStream in further tests\r
- using (Stream s = new MemoryStream ()) {\r
+ {
+ // do no corrupt writeStream in further tests
+ using (Stream s = new MemoryStream ()) {
byte[] buffer = new byte [8];
cs = new CryptoStream (s, encryptor, CryptoStreamMode.Write);
cs.Clear ();
}
}
- [Test]\r
- [ExpectedException (typeof (NotSupportedException))]\r
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
public void Write_ReadStream ()
{
cs = new CryptoStream (readStream, encryptor, CryptoStreamMode.Read);
cs.Write (null, 0, 8);
}
- [Test]\r
+ [Test]
public void Write_EmptyBuffer_ZeroCount ()
{
byte[] buffer = new byte [0];
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Write_InvalidOffset ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
byte[] buffer = new byte [8];
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Write);
cs.Write (buffer, 5, 4);
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Write_OverflowCount ()
- {\r
- DebugStream debug = new DebugStream ();\r
+ {
+ DebugStream debug = new DebugStream ();
byte[] buffer = new byte [8];
cs = new CryptoStream (debug, encryptor, CryptoStreamMode.Write);
cs.Write (buffer, 0, Int32.MaxValue);