-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyFTPTest.cs
101 lines (90 loc) · 4.4 KB
/
myFTPTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using FtpUtil;
namespace FTPUtilTest
{
[TestClass]
public class myFTPTest
{
[TestMethod]
public void ChangeFolder_FolderRaizVacioConFolderRelativoVacio_RegresaVacio() {
var folderRaiz = "";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("", currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizVacioConFolderRelativo_RegresaFolderRelativo() {
var folderRaiz = "";
var folderRelativo = "boo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
ftp.ChangeFolder(folderRelativo);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRelativo, currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizSimpleSinFolderRelativo_RegresaVacio() {
var folderRaiz = "/";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("", currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizSimpleConFolderRelativo_RegresaFolderRelativo() {
var folderRaiz = "/";
var folderRelativo = "boo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
ftp.ChangeFolder(folderRelativo);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRelativo, currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizCompletoSinDiagonalInicialSinFolderRelativo_RegresaFolderRaizConDiagonalInicial() {
var folderRaiz = "foo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRaiz, currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizCompletoSinDiagonalInicialConFolderRelativo_RegresaFolderRaizConDiagonalInicialYConFolderRelativo() {
var folderRaiz = "foo";
var folderRelativo = "boo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
ftp.ChangeFolder(folderRelativo);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRaiz + "/" + folderRelativo, currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizCompletoConDiagonalInicialSinFolderRelativo_RegresaFolderRaizConDiagonalInicial() {
var folderRaiz = "/foo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRaiz.Replace("/", ""), currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizCompletoConDiagonalInicialConFolderRelativo_RegresaFolderRaizConDiagonalInicialYConFolderRelativo() {
var folderRaiz = "/foo";
var folderRelativo = "boo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
ftp.ChangeFolder(folderRelativo);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRaiz.Replace("/", "") + "/" + folderRelativo, currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizCompletoConDiagonalInicialYFinalSinFolderRelativo_RegresaFolderRaizConDiagonalInicialSinDiagonalFinal() {
var folderRaiz = "/foo/";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRaiz.Replace("/", ""), currentFolder);
}
[TestMethod]
public void ChangeFolder_FolderRaizCompletoConDiagonalInicialYFinalConFolderRelativo_RegresaFolderRaizConDiagonalInicialYConFolderRelativo() {
var folderRaiz = "/foo/";
var folderRelativo = "boo";
var ftp = new myFTP("ftp://example.com", "", "", folderRaiz);
ftp.ChangeFolder(folderRelativo);
var currentFolder = ftp.GetCurrentFolder();
Assert.AreEqual("/" + folderRaiz.Replace("/", "") + "/" + folderRelativo, currentFolder);
}
}
}