Example #1
0
        public FtpClientIntegrationTest()
        {
            _ftpUriConfigDetails = new UriBuilder(ConfigurationManager.AppSettings[uriConfigKey]);

            _ftpFileContainer   = FTPFile.UnityContainerFactory();
            _ftpFolderContainer = FTPFolder.UnityContainerFactory();
        }
Example #2
0
        public void FTPFolderConstructors()
        {
            var FTPFolder1 = new FTPFolder(_ftpUriConfigDetails.Uri.AbsoluteUri, _ftpUriConfigDetails.UserName, _ftpUriConfigDetails.Password);

            Assert.IsTrue(!string.IsNullOrEmpty(FTPFolder1.GetParentDirectory()));
            Assert.IsTrue(FTPFolder1 != null);

            var FTPFolder2 = new FTPFolder(_ftpUriConfigDetails.Uri.AbsoluteUri, _ftpUriConfigDetails.UserName, _ftpUriConfigDetails.Password);

            Assert.IsTrue(!string.IsNullOrEmpty(FTPFolder2.GetParentDirectory()));
            Assert.IsTrue(FTPFolder2 != null);
        }
Example #3
0
        public void ListDirectoryNotExists()
        {
            Setup();
            var folderName = string.Empty;
            var folderList = new List <string>();
            var fileList   = new List <string>();
            var ftpFolder  = new FTPFolder(string.Format(@"{0}/Crasy", _ftpFolder.FtpUri));

            ftpFolder.IsBubbleUpException = true;
            ftpFolder.ListDirectory(out folderList, out fileList, folderName);
            Assert.AreEqual(0, folderList.Count);
            Assert.AreEqual(0, fileList.Count);
        }
Example #4
0
        public void CompareTest()
        {
            var tempUri1 = string.Format(@"{0}/{1}_1", _ftpUriConfigDetails.Uri.AbsoluteUri, TempsubFolderName);
            var tempUri2 = string.Format(@"{0}/{1}_2", _ftpUriConfigDetails.Uri.AbsoluteUri, TempsubFolderName);
            var ftpFile1 = new FTPFile();
            var ftpFile2 = new FTPFile();

            ftpFile1.Initialize(tempUri1);
            ftpFile2.Initialize(tempUri1);
            Assert.AreEqual(1, ftpFile1.CompareTo(ftpFile2));
            ftpFile2.Initialize(tempUri2);
            Assert.AreEqual(0, ftpFile1.CompareTo(ftpFile2));
            var ftpTFolder1 = new FTPFolder();
            var ftpTFolder2 = new FTPFolder();

            ftpTFolder1.Initialize(tempUri1);
            ftpTFolder2.Initialize(tempUri1);
            Assert.AreEqual(1, ftpTFolder1.CompareTo(ftpTFolder2));
            ftpTFolder2.Initialize(tempUri2);
            Assert.AreEqual(0, ftpTFolder1.CompareTo(ftpTFolder2));
        }
Example #5
0
        public void CheckNotExistsFolder()
        {
            var ftpFolder = new FTPFolder(string.Format(@"{0}/Engine", _ftpUriConfigDetails.Uri.AbsoluteUri));

            Assert.IsFalse(ftpFolder.Exists);
        }
Example #6
0
        public void CheckExistsFolder()
        {
            var ftpFolder = new FTPFolder(string.Format(@"{0}/Foo", _ftpUriConfigDetails.Uri.AbsoluteUri));

            Assert.IsTrue(ftpFolder.Exists);
        }