public void DownloadFileTest() { var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect(Host, Port); var operationPerformer = new OperationPerformer(socket); operationPerformer.OmitWelcomeResponse(); operationPerformer.LogIn(Username, Password); operationPerformer.ActiveMode = false; operationPerformer.DownloadFile("FTP.txt", "G:\\hp\\Desktop\\test1.txt"); operationPerformer.ActiveMode = true; operationPerformer.DownloadFile("FTP.txt", "G:\\hp\\Desktop\\test2.txt"); operationPerformer.LogOut(); Assert.IsTrue(true); }
public void RenameFileTest() { var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect(Host, Port); var operationPerformer = new OperationPerformer(socket); operationPerformer.OmitWelcomeResponse(); operationPerformer.LogIn(Username, Password); operationPerformer.DownloadFile("FTP.txt", "haha.txt"); operationPerformer.UploadFile("haha.txt", "haha.txt"); operationPerformer.RenameFile("haha.txt", "hehe.txt"); Assert.IsTrue(true); }