Beispiel #1
0
        public void Setup()
        {
            var parameters = new ParametersCollection(";", "=");

            parameters.AddValue("type", "i");
            _url = new FtpUrl("ftp://temp.uri/whatever/path;type=i", "ftp", null, null, "temp.uri", 21, "/whatever/path", parameters, "whatever", "path");
        }
Beispiel #2
0
        private string CreateUrl(string fileName)
        {
            string path;

            var url = FtpUrl.EndsWith("/") ? FtpUrl.Remove(FtpUrl.Length - 1) : FtpUrl;

            if (Dir.StartsWith("/") || Dir.EndsWith("/"))
            {
                path = Dir;

                if (path.StartsWith("/"))
                {
                    path = Dir.Substring(1);
                }

                if (path.EndsWith("/"))
                {
                    path = path.Remove(path.Length - 1);
                }
            }
            else
            {
                path = Dir;
            }

            return("ftp://" + url + ":" + Port.ToString() + "/" + path + "/" + fileName);
        }
Beispiel #3
0
 /// <summary>Exposes the <see cref="System.Security.Policy.Url" /> assertions extension.</summary>
 /// <param name="url">The subject URL.</param>
 /// <returns>Assertions for a given <paramref name="url" />.</returns>
 public static FtpUrlAssertions Should(this FtpUrl url)
 {
     return(new FtpUrlAssertions(url));
 }
Beispiel #4
0
 public void Teardown()
 {
     _url = null;
 }
Beispiel #5
0
 public void Teardown()
 {
     _url = null;
 }
Beispiel #6
0
 public void Setup()
 {
     var parameters = new ParametersCollection(";", "=");
     parameters.AddValue("type", "i");
     _url = new FtpUrl("ftp://temp.uri/whatever/path;type=i", "ftp", null, null, "temp.uri", 21, "/whatever/path", parameters, "whatever", "path");
 }