Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1878

Make GridFSDownloadStream and GridFSUploadStream mockable

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.3
    • Component/s: GridFS
    • Labels:

      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 ...

            Assignee:
            Unassigned Unassigned
            Reporter:
            pgordon@truckdown.com Peter Gordon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: