mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-11 01:36:39 +00:00
03ae6bfa0f
* Bump the dependencies group with 4 updates Bumps BouncyCastle.Cryptography from 2.6.1 to 2.6.2 Bumps Meziantou.Analyzer from 2.0.205 to 2.0.210 Bumps MSTest from 3.9.3 to 3.10.0 Bumps SonarAnalyzer.CSharp from 10.13.0.120203 to 10.15.0.120848 Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Hague <rob.hague00@gmail.com>
33 lines
1018 B
C#
33 lines
1018 B
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
using Renci.SshNet.Common;
|
|
using Renci.SshNet.Tests.Properties;
|
|
|
|
namespace Renci.SshNet.Tests.Classes
|
|
{
|
|
public partial class SftpClientTest
|
|
{
|
|
[TestMethod]
|
|
public async Task GetAttributesAsync_Throws_WhenNotConnected()
|
|
{
|
|
using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
|
|
{
|
|
await Assert.ThrowsExactlyAsync<SshConnectionException>(() => sftp.GetAttributesAsync(".", CancellationToken.None));
|
|
}
|
|
}
|
|
|
|
[TestMethod]
|
|
public async Task GetAttributesAsync_Throws_WhenDisposed()
|
|
{
|
|
var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD);
|
|
sftp.Dispose();
|
|
|
|
await Assert.ThrowsExactlyAsync<ObjectDisposedException>(() => sftp.GetAttributesAsync(".", CancellationToken.None));
|
|
}
|
|
}
|
|
}
|