[CSHARP-1878] Make GridFSDownloadStream and GridFSUploadStream mockable Created: 01/Jan/17  Updated: 03/Dec/20  Resolved: 03/Dec/20

Status: Closed
Project: C# Driver
Component/s: GridFS
Affects Version/s: 2.3
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Peter Gordon Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CSHARP-1809 Consider allowing to implement the Gr... Closed

 Description   

Would it be possible to mark the constructors on GridFSDownloadStream<TFileId> and GridFSUploadStream<TFileId> internal protected as opposed to just internal so that a mock can be created for these concrete classes? I am trying to build a mock of IGridFSBucket<TField> but cannot mock the OpenUploadStream or OpenDownloadStream methods because of the inaccessibility of the constructors on the return types.

Not sure of the impacts of this change or if there is a better way of mocking the IGridFSBucket for unit tests ...



 Comments   
Comment by Jeffrey Yemin [ 03/Dec/20 ]

This looks like a duplicate of CSHARP-1809.

Generated at Wed Feb 07 21:40:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.