Permalink
Browse files

Merge git://github.com/rashadh/mongodb-csharp into pool

Conflicts:
	MongoDB.GridFS/GridFileStream.cs
  • Loading branch information...
2 parents 3f7be99 + a24fe05 commit 68134320e87ea7b5c05eba20c5cd88bfbe52edb8 @samus committed Mar 18, 2010
Showing with 413 additions and 387 deletions.
  1. +24 −0 MongoDB.GridFS.Tests/GridFileStreamTest.cs
  2. +389 −387 MongoDB.GridFS/GridFileStream.cs
@@ -236,6 +236,30 @@ public class GridFileStreamTest : GridTestBase
expected++;
}
}
+
+ [Test]
+ public void TestReadFrom3Chunks(){
+ string filename = "read3chunks.txt";
+ int chunks = 3;
+ int chunkSize = 256 * 1024;
+ int size = (256 * 1024 * chunks) - 5000;
+
+
+ Object id = CreateDummyFile(filename,size,chunkSize,0);
+
+
+ using(GridFileStream gfs = fs.OpenRead(filename)){
+ int buffsize = 10240;
+ Byte[] buff = new Byte[buffsize];
+ int read = 0;
+ int totalRead = 0;
+ while((read = gfs.Read(buff,0,buffsize)) != 0){
+ totalRead += read;
+ }
+ Assert.AreEqual(size,totalRead,"Not all bytes read back");
+ }
+
+ }
[Test]
public void TestSetLengthBigger(){
Oops, something went wrong.

0 comments on commit 6813432

Please sign in to comment.