public void should_copy_to_localstream() { string id = Guid.NewGuid().ToString(); var repository = new MongoPolicy(); repository.Add(file, id); byte[] bytes = repository.GetBytes(id); repository.Delete(id); using (var fs = new FileStream(localfile, FileMode.Create)) { fs.Read(bytes, 0, bytes.Count()); } Assert.IsTrue(File.Exists(localfile)); File.Delete(localfile); }