Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
try tweaking test init
  • Loading branch information
sdt-ndelarosa committed Apr 24, 2025
commit ad049c54c6d5e7697ba23945ce2c8cf960ff8ca8
22 changes: 14 additions & 8 deletions test/Renci.SshNet.IntegrationTests/SftpClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@ namespace Renci.SshNet.IntegrationTests
/// The SFTP client integration tests
/// </summary>
[TestClass]
public class SftpClientTests : IntegrationTestBase, IDisposable
public class SftpClientTests : IntegrationTestBase
{
private readonly SftpClient _sftpClient;

public SftpClientTests()
{
_sftpClient = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password);
_sftpClient.Connect();
}

[TestInitialize]
public async Task InitializeAsync()
{
await _sftpClient.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
}

[TestCleanup]
public void Cleanup()
{
_sftpClient.Disconnect();
_sftpClient.Dispose();
}

[TestMethod]
Expand Down Expand Up @@ -165,11 +177,5 @@ public async Task Create_file_and_delete_using_DeleteAsync()

Assert.IsFalse(await _sftpClient.ExistsAsync(testFileName).ConfigureAwait(false));
}

public void Dispose()
{
_sftpClient.Disconnect();
_sftpClient.Dispose();
}
}
}