Exemplo n.º 1
0
 public void should_submit_office_success()
 {
     var nvc = new NameValueCollection {{"userId", Guid.NewGuid().ToString()},
                                        {"userName", "admin"}};
     var fileUploader = new FormUploader("http://192.168.1.29:2001/api/Document/Add");
     fileUploader.Upload("office.xlsx", nvc);
 }
Exemplo n.º 2
0
        public void AddData()
        {
            var fileName = Environment.CurrentDirectory + "\\TestFiles\\test.rtf";
            var nvc = new NameValueCollection {{"userId", Guid.NewGuid().ToString()},
                                               {"userName", "admin"}};
            FormUploader _formUploader = new FormUploader("http://192.168.1.29:2001/api/Document/Add");
            var result = _formUploader.Upload(fileName, nvc);

            ListViewItem[] p = new ListViewItem[1];
            p[0] = new ListViewItem(new string[] { "上传", fileName });

            this.UploadListview.Items.AddRange(p);
        }