| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using Renci.SshNet.Sftp;
- using Renci.SshNet.Tests.Common;
- using Renci.SshNet.Tests.Properties;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Security.Cryptography;
- using System.Text;
- namespace Renci.SshNet.Tests.Classes
- {
- /// <summary>
- /// Implementation of the SSH File Transfer Protocol (SFTP) over SSH.
- /// </summary>
- [TestClass]
- public partial class SftpClientTest : TestBase
- {
- private Random _random;
- [TestInitialize]
- public void SetUp()
- {
- _random = new Random();
- }
- [TestMethod]
- public void OperationTimeout_Default()
- {
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo);
- var actual = target.OperationTimeout;
- Assert.AreEqual(TimeSpan.FromMilliseconds(-1), actual);
- }
- [TestMethod]
- public void OperationTimeout_InsideLimits()
- {
- var operationTimeout = TimeSpan.FromMilliseconds(_random.Next(0, int.MaxValue - 1));
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo)
- {
- OperationTimeout = operationTimeout
- };
- var actual = target.OperationTimeout;
- Assert.AreEqual(operationTimeout, actual);
- }
- [TestMethod]
- public void OperationTimeout_LowerLimit()
- {
- var operationTimeout = TimeSpan.FromMilliseconds(-1);
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo)
- {
- OperationTimeout = operationTimeout
- };
- var actual = target.OperationTimeout;
- Assert.AreEqual(operationTimeout, actual);
- }
- [TestMethod]
- public void OperationTimeout_UpperLimit()
- {
- var operationTimeout = TimeSpan.FromMilliseconds(int.MaxValue);
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo)
- {
- OperationTimeout = operationTimeout
- };
- var actual = target.OperationTimeout;
- Assert.AreEqual(operationTimeout, actual);
- }
- [TestMethod]
- public void OperationTimeout_LessThanLowerLimit()
- {
- var operationTimeout = TimeSpan.FromMilliseconds(-2);
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo);
- try
- {
- target.OperationTimeout = operationTimeout;
- }
- catch (ArgumentOutOfRangeException ex)
- {
- Assert.IsNull(ex.InnerException);
- #if NETFRAMEWORK
- Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive." + Environment.NewLine + "Parameter name: " + ex.ParamName, ex.Message);
- #else
- Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive. (Parameter '" + ex.ParamName + "')", ex.Message);
- #endif
- Assert.AreEqual("value", ex.ParamName);
- }
- }
- [TestMethod]
- public void OperationTimeout_GreaterThanLowerLimit()
- {
- var operationTimeout = TimeSpan.FromMilliseconds(int.MaxValue).Add(TimeSpan.FromMilliseconds(1));
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo);
- try
- {
- target.OperationTimeout = operationTimeout;
- }
- catch (ArgumentOutOfRangeException ex)
- {
- Assert.IsNull(ex.InnerException);
- #if NETFRAMEWORK
- Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive." + Environment.NewLine + "Parameter name: " + ex.ParamName, ex.Message);
- #else
- Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive. (Parameter '" + ex.ParamName + "')", ex.Message);
- #endif
- Assert.AreEqual("value", ex.ParamName);
- }
- }
- [TestMethod]
- public void OperationTimeout_Disposed()
- {
- var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
- var target = new SftpClient(connectionInfo);
- target.Dispose();
- // getter
- try
- {
- var actual = target.OperationTimeout;
- Assert.Fail("Should have failed, but returned: " + actual);
- }
- catch (ObjectDisposedException ex)
- {
- Assert.IsNull(ex.InnerException);
- Assert.AreEqual(typeof(SftpClient).FullName, ex.ObjectName);
- }
- // setter
- try
- {
- target.OperationTimeout = TimeSpan.FromMilliseconds(5);
- Assert.Fail();
- }
- catch (ObjectDisposedException ex)
- {
- Assert.IsNull(ex.InnerException);
- Assert.AreEqual(typeof(SftpClient).FullName, ex.ObjectName);
- }
- }
- /// <summary>
- ///A test for SftpClient Constructor
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SftpClientConstructorTest()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- PrivateKeyFile[] keyFiles = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(host, username, keyFiles);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for SftpClient Constructor
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SftpClientConstructorTest1()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- int port = 0; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- PrivateKeyFile[] keyFiles = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(host, port, username, keyFiles);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for SftpClient Constructor
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SftpClientConstructorTest2()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- string password = string.Empty; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(host, username, password);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for SftpClient Constructor
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SftpClientConstructorTest3()
- {
- string host = string.Empty; // TODO: Initialize to an appropriate value
- int port = 0; // TODO: Initialize to an appropriate value
- string username = string.Empty; // TODO: Initialize to an appropriate value
- string password = string.Empty; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(host, port, username, password);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for SftpClient Constructor
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SftpClientConstructorTest4()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo);
- Assert.Inconclusive("TODO: Implement code to verify target");
- }
- /// <summary>
- ///A test for ChangePermissions
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ChangePermissionsTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- short mode = 0; // TODO: Initialize to an appropriate value
- target.ChangePermissions(path, mode);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for ChangeDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ChangeDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- target.ChangeDirectory(path);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for BeginUploadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void BeginUploadFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- Stream input = null; // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
- object state = null; // TODO: Initialize to an appropriate value
- Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
- IAsyncResult expected = null; // TODO: Initialize to an appropriate value
- IAsyncResult actual;
- actual = target.BeginUploadFile(input, path, asyncCallback, state, uploadCallback);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for BeginUploadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void BeginUploadFileTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- Stream input = null; // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- bool canOverride = false; // TODO: Initialize to an appropriate value
- AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
- object state = null; // TODO: Initialize to an appropriate value
- Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
- IAsyncResult expected = null; // TODO: Initialize to an appropriate value
- IAsyncResult actual;
- actual = target.BeginUploadFile(input, path, canOverride, asyncCallback, state, uploadCallback);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for BeginSynchronizeDirectories
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void BeginSynchronizeDirectoriesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string sourcePath = string.Empty; // TODO: Initialize to an appropriate value
- string destinationPath = string.Empty; // TODO: Initialize to an appropriate value
- string searchPattern = string.Empty; // TODO: Initialize to an appropriate value
- AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
- object state = null; // TODO: Initialize to an appropriate value
- IAsyncResult expected = null; // TODO: Initialize to an appropriate value
- IAsyncResult actual;
- actual = target.BeginSynchronizeDirectories(sourcePath, destinationPath, searchPattern, asyncCallback, state);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for BeginListDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void BeginListDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
- object state = null; // TODO: Initialize to an appropriate value
- Action<int> listCallback = null; // TODO: Initialize to an appropriate value
- IAsyncResult expected = null; // TODO: Initialize to an appropriate value
- IAsyncResult actual;
- actual = target.BeginListDirectory(path, asyncCallback, state, listCallback);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for BeginDownloadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void BeginDownloadFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Stream output = null; // TODO: Initialize to an appropriate value
- AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
- object state = null; // TODO: Initialize to an appropriate value
- Action<ulong> downloadCallback = null; // TODO: Initialize to an appropriate value
- IAsyncResult expected = null; // TODO: Initialize to an appropriate value
- IAsyncResult actual;
- actual = target.BeginDownloadFile(path, output, asyncCallback, state, downloadCallback);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for AppendText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void AppendTextTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- StreamWriter expected = null; // TODO: Initialize to an appropriate value
- StreamWriter actual;
- actual = target.AppendText(path, encoding);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for AppendText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void AppendTextTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- StreamWriter expected = null; // TODO: Initialize to an appropriate value
- StreamWriter actual;
- actual = target.AppendText(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for AppendAllText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void AppendAllTextTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string contents = string.Empty; // TODO: Initialize to an appropriate value
- target.AppendAllText(path, contents);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for AppendAllText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void AppendAllTextTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string contents = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- target.AppendAllText(path, contents, encoding);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for AppendAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void AppendAllLinesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
- target.AppendAllLines(path, contents);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for AppendAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void AppendAllLinesTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- target.AppendAllLines(path, contents, encoding);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for CreateText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void CreateTextTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- StreamWriter expected = null; // TODO: Initialize to an appropriate value
- StreamWriter actual;
- actual = target.CreateText(path, encoding);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for CreateText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void CreateTextTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- StreamWriter expected = null; // TODO: Initialize to an appropriate value
- StreamWriter actual;
- actual = target.CreateText(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for CreateDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void CreateDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- target.CreateDirectory(path);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for Create
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void CreateTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- int bufferSize = 0; // TODO: Initialize to an appropriate value
- SftpFileStream expected = null; // TODO: Initialize to an appropriate value
- SftpFileStream actual;
- actual = target.Create(path, bufferSize);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for Create
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void CreateTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- SftpFileStream expected = null; // TODO: Initialize to an appropriate value
- SftpFileStream actual;
- actual = target.Create(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for EndSynchronizeDirectories
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void EndSynchronizeDirectoriesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
- IEnumerable<FileInfo> expected = null; // TODO: Initialize to an appropriate value
- IEnumerable<FileInfo> actual;
- actual = target.EndSynchronizeDirectories(asyncResult);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for EndListDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void EndListDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
- IEnumerable<ISftpFile> expected = null; // TODO: Initialize to an appropriate value
- IEnumerable<ISftpFile> actual;
- actual = target.EndListDirectory(asyncResult);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for EndDownloadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void EndDownloadFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
- target.EndDownloadFile(asyncResult);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for DownloadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void DownloadFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Stream output = null; // TODO: Initialize to an appropriate value
- Action<ulong> downloadCallback = null; // TODO: Initialize to an appropriate value
- target.DownloadFile(path, output, downloadCallback);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for DeleteFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void DeleteFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- target.DeleteFile(path);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for DeleteDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void DeleteDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- target.DeleteDirectory(path);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for Delete
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void DeleteTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- target.Delete(path);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for GetLastAccessTimeUtc
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetLastAccessTimeUtcTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
- DateTime actual;
- actual = target.GetLastAccessTimeUtc(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for GetLastAccessTime
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetLastAccessTimeTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
- DateTime actual;
- actual = target.GetLastAccessTime(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for GetAttributes
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetAttributesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- SftpFileAttributes expected = null; // TODO: Initialize to an appropriate value
- SftpFileAttributes actual;
- actual = target.GetAttributes(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for Get
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- ISftpFile expected = null; // TODO: Initialize to an appropriate value
- ISftpFile actual;
- actual = target.Get(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for Exists
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ExistsTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- bool expected = false; // TODO: Initialize to an appropriate value
- bool actual;
- actual = target.Exists(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for EndUploadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void EndUploadFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
- target.EndUploadFile(asyncResult);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for GetLastWriteTimeUtc
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetLastWriteTimeUtcTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
- DateTime actual;
- actual = target.GetLastWriteTimeUtc(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for GetLastWriteTime
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetLastWriteTimeTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
- DateTime actual;
- actual = target.GetLastWriteTime(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for GetStatus
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void GetStatusTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- SftpFileSytemInformation expected = null; // TODO: Initialize to an appropriate value
- SftpFileSytemInformation actual;
- actual = target.GetStatus(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ListDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ListDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Action<int> listCallback = null; // TODO: Initialize to an appropriate value
- IEnumerable<ISftpFile> expected = null; // TODO: Initialize to an appropriate value
- IEnumerable<ISftpFile> actual;
- actual = target.ListDirectory(path, listCallback);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for Open
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void OpenTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- FileMode mode = new FileMode(); // TODO: Initialize to an appropriate value
- SftpFileStream expected = null; // TODO: Initialize to an appropriate value
- SftpFileStream actual;
- actual = target.Open(path, mode);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for Open
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void OpenTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- FileMode mode = new FileMode(); // TODO: Initialize to an appropriate value
- FileAccess access = new FileAccess(); // TODO: Initialize to an appropriate value
- SftpFileStream expected = null; // TODO: Initialize to an appropriate value
- SftpFileStream actual;
- actual = target.Open(path, mode, access);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for OpenRead
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void OpenReadTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- SftpFileStream expected = null; // TODO: Initialize to an appropriate value
- SftpFileStream actual;
- actual = target.OpenRead(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for OpenText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void OpenTextTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- StreamReader expected = null; // TODO: Initialize to an appropriate value
- StreamReader actual;
- actual = target.OpenText(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for OpenWrite
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void OpenWriteTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- SftpFileStream expected = null; // TODO: Initialize to an appropriate value
- SftpFileStream actual;
- actual = target.OpenWrite(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadAllBytes
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadAllBytesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- byte[] expected = null; // TODO: Initialize to an appropriate value
- byte[] actual;
- actual = target.ReadAllBytes(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadAllLinesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- string[] expected = null; // TODO: Initialize to an appropriate value
- string[] actual;
- actual = target.ReadAllLines(path, encoding);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadAllLinesTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string[] expected = null; // TODO: Initialize to an appropriate value
- string[] actual;
- actual = target.ReadAllLines(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadAllText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadAllTextTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- string expected = string.Empty; // TODO: Initialize to an appropriate value
- string actual;
- actual = target.ReadAllText(path, encoding);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadAllText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadAllTextTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string expected = string.Empty; // TODO: Initialize to an appropriate value
- string actual;
- actual = target.ReadAllText(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadLinesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- IEnumerable<string> expected = null; // TODO: Initialize to an appropriate value
- IEnumerable<string> actual;
- actual = target.ReadLines(path);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for ReadLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void ReadLinesTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- IEnumerable<string> expected = null; // TODO: Initialize to an appropriate value
- IEnumerable<string> actual;
- actual = target.ReadLines(path, encoding);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for RenameFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void RenameFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string oldPath = string.Empty; // TODO: Initialize to an appropriate value
- string newPath = string.Empty; // TODO: Initialize to an appropriate value
- target.RenameFile(oldPath, newPath);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for RenameFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void RenameFileTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string oldPath = string.Empty; // TODO: Initialize to an appropriate value
- string newPath = string.Empty; // TODO: Initialize to an appropriate value
- bool isPosix = false; // TODO: Initialize to an appropriate value
- target.RenameFile(oldPath, newPath, isPosix);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SetAttributes
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SetAttributesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- SftpFileAttributes fileAttributes = null; // TODO: Initialize to an appropriate value
- target.SetAttributes(path, fileAttributes);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SetLastAccessTime
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SetLastAccessTimeTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime lastAccessTime = new DateTime(); // TODO: Initialize to an appropriate value
- #pragma warning disable CS0618 // Type or member is obsolete
- target.SetLastAccessTime(path, lastAccessTime);
- #pragma warning restore CS0618 // Type or member is obsolete
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SetLastAccessTimeUtc
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SetLastAccessTimeUtcTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime lastAccessTimeUtc = new DateTime(); // TODO: Initialize to an appropriate value
- #pragma warning disable CS0618 // Type or member is obsolete
- target.SetLastAccessTimeUtc(path, lastAccessTimeUtc);
- #pragma warning restore CS0618 // Type or member is obsolete
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SetLastWriteTime
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SetLastWriteTimeTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime lastWriteTime = new DateTime(); // TODO: Initialize to an appropriate value
- #pragma warning disable CS0618 // Type or member is obsolete
- target.SetLastWriteTime(path, lastWriteTime);
- #pragma warning restore CS0618 // Type or member is obsolete
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SetLastWriteTimeUtc
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SetLastWriteTimeUtcTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- DateTime lastWriteTimeUtc = new DateTime(); // TODO: Initialize to an appropriate value
- #pragma warning disable CS0618 // Type or member is obsolete
- target.SetLastWriteTimeUtc(path, lastWriteTimeUtc);
- #pragma warning restore CS0618 // Type or member is obsolete
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SymbolicLink
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SymbolicLinkTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string linkPath = string.Empty; // TODO: Initialize to an appropriate value
- target.SymbolicLink(path, linkPath);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for SynchronizeDirectories
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void SynchronizeDirectoriesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string sourcePath = string.Empty; // TODO: Initialize to an appropriate value
- string destinationPath = string.Empty; // TODO: Initialize to an appropriate value
- string searchPattern = string.Empty; // TODO: Initialize to an appropriate value
- IEnumerable<FileInfo> expected = null; // TODO: Initialize to an appropriate value
- IEnumerable<FileInfo> actual;
- actual = target.SynchronizeDirectories(sourcePath, destinationPath, searchPattern);
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for UploadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void UploadFileTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- Stream input = null; // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
- target.UploadFile(input, path, uploadCallback);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for UploadFile
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void UploadFileTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- Stream input = null; // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- bool canOverride = false; // TODO: Initialize to an appropriate value
- Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
- target.UploadFile(input, path, canOverride, uploadCallback);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllBytes
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllBytesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- byte[] bytes = null; // TODO: Initialize to an appropriate value
- target.WriteAllBytes(path, bytes);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllLinesTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
- target.WriteAllLines(path, contents);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllLinesTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string[] contents = null; // TODO: Initialize to an appropriate value
- target.WriteAllLines(path, contents);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllLinesTest2()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- target.WriteAllLines(path, contents, encoding);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllLines
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllLinesTest3()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string[] contents = null; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- target.WriteAllLines(path, contents, encoding);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllTextTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string contents = string.Empty; // TODO: Initialize to an appropriate value
- target.WriteAllText(path, contents);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for WriteAllText
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WriteAllTextTest1()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string path = string.Empty; // TODO: Initialize to an appropriate value
- string contents = string.Empty; // TODO: Initialize to an appropriate value
- Encoding encoding = null; // TODO: Initialize to an appropriate value
- target.WriteAllText(path, contents, encoding);
- Assert.Inconclusive("A method that does not return a value cannot be verified.");
- }
- /// <summary>
- ///A test for BufferSize
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void BufferSizeTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- uint expected = 0; // TODO: Initialize to an appropriate value
- uint actual;
- target.BufferSize = expected;
- actual = target.BufferSize;
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for OperationTimeout
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void OperationTimeoutTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- TimeSpan expected = new TimeSpan(); // TODO: Initialize to an appropriate value
- TimeSpan actual;
- target.OperationTimeout = expected;
- actual = target.OperationTimeout;
- Assert.AreEqual(expected, actual);
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- /// <summary>
- ///A test for WorkingDirectory
- ///</summary>
- [TestMethod]
- [Ignore] // placeholder for actual test
- public void WorkingDirectoryTest()
- {
- ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
- SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
- string actual;
- actual = target.WorkingDirectory;
- Assert.Inconclusive("Verify the correctness of this test method.");
- }
- protected static string CalculateMD5(string fileName)
- {
- using (FileStream file = new FileStream(fileName, FileMode.Open))
- {
- MD5 md5 = new MD5CryptoServiceProvider();
- byte[] retVal = md5.ComputeHash(file);
- file.Close();
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < retVal.Length; i++)
- {
- sb.Append(retVal[i].ToString("x2"));
- }
- return sb.ToString();
- }
- }
- private static void RemoveAllFiles()
- {
- using (var client = new SshClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
- {
- client.Connect();
- client.RunCommand("rm -rf *");
- client.Disconnect();
- }
- }
- /// <summary>
- /// Helper class to help with upload and download testing
- /// </summary>
- private class TestInfo
- {
- public string RemoteFileName { get; set; }
- public string UploadedFileName { get; set; }
- public string DownloadedFileName { get; set; }
- //public ulong UploadedBytes { get; set; }
- //public ulong DownloadedBytes { get; set; }
- public FileStream UploadedFile { get; set; }
- public FileStream DownloadedFile { get; set; }
- public string UploadedHash { get; set; }
- public string DownloadedHash { get; set; }
- public SftpUploadAsyncResult UploadResult { get; set; }
- public SftpDownloadAsyncResult DownloadResult { get; set; }
- }
- }
- }
|