Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for SftpFileStream.Seek(...) #9

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Add tests for SftpFileStream.Seek(...) #9

merged 2 commits into from
Nov 29, 2022

Conversation

drieseng
Copy link
Member

Add tests for SftpFileStream.Seek(...) to cover sshnet/SSH.NET#910.

@drieseng drieseng requested a review from daviburg November 28, 2022 18:37
@drieseng
Copy link
Member Author

@daviburg, some of the tests will fail because the integration tests project consumes version 2020.0.1 of SSH.NET. See sshnet/SSH.NET#1048 for a discussion (monologue rather ☹️) on this.

src/SshNetTests/SftpTests.cs Outdated Show resolved Hide resolved
src/SshNetTests/SftpTests.cs Show resolved Hide resolved
src/SshNetTests/SftpTests.cs Show resolved Hide resolved
src/SshNetTests/SftpTests.cs Outdated Show resolved Hide resolved
src/SshNetTests/SftpTests.cs Outdated Show resolved Hide resolved
src/SshNetTests/SftpTests.cs Outdated Show resolved Hide resolved
fs.Write(writeBuffer, 0, writeBuffer.Length);
}

using (var fs = client.OpenRead(remoteFile))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation code is repeated several times. Should it be moved to a parametized helper method?

Copy link
Member Author

@drieseng drieseng Nov 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep this as is to avoid having to navigate too much between methods in order to find out what is actually being tested.
OK?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too fond of how verbose and repetitive the current approach is, but it is not a showstopper.

src/SshNetTests/SftpTests.cs Outdated Show resolved Hide resolved
@drieseng
Copy link
Member Author

drieseng commented Nov 29, 2022

@daviburg, thanks for taking the time to review these changes. Let me know if your approval still stands after my latest commit.

@daviburg
Copy link
Collaborator

@daviburg, thanks for taking the time to review these changes. Let me know if your approval still stands after my latest commit.

Yes, I review the second commit and it looks good.

@drieseng drieseng merged commit 3f5a7d7 into main Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants