[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: |
|
||||||||
| 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 |