Skip to content

SftpClient.OpenAsync should return Stream for ease of mocking #1691

@doxxx

Description

@doxxx

SftpClient.OpenAsync currently returns an SftpFileStream which cannot be mocked by NSubstitute or even faked because it has private/internal constructors.

It would be nice if OpenAsync was instead defined as returning Stream, even though it actually returns a SftpFileStream. The only non-Stream public member that I can see is the Timeout property. If it's absolutely vital that this property is exposed, maybe define an ISftpFileStream interface instead? Or the timeout could be passed to OpenAsync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions