@@ -40,7 +40,6 @@ public void PutPolicyTest(){
4040
4141
4242 policy = new PutPolicy ( "bucket" ) ;
43- policy . AsyncOps = "" ;
4443 policy . CallBackBody = "uid=123" ;
4544 policy . CallBackUrl = "www.qiniu.com" ;
4645 policy . DetectMime = 1 ;
@@ -50,11 +49,11 @@ public void PutPolicyTest(){
5049 policy . PersistentOps = "avthumb/m3u8/preset/video_16x9_440k" ;
5150 try {
5251 string result = policy . ToString ( ) ;
53- string expect = "{\" scope\" :\" bucket\" ,\" callBackUrl\" :\" www.qiniu.com\" ,\" callBackBody\" :\" uid=123\" ,\" asyncOps \" : \" \" , \" deadline\" :0,\" insertOnly\" :1,\" detectMime\" :1,\" fsizeLimit\" :4096,\" persistentNotifyUrl\" :\" www.yourdomain.com/persistentNotifyUrl\" ,\" persistentOps\" :\" avthumb/m3u8/preset/video_16x9_440k\" }" ;
52+ string expect = "{\" scope\" :\" bucket\" ,\" callBackUrl\" :\" www.qiniu.com\" ,\" callBackBody\" :\" uid=123\" ,\" deadline\" :0,\" insertOnly\" :1,\" detectMime\" :1,\" fsizeLimit\" :4096,\" persistentNotifyUrl\" :\" www.yourdomain.com/persistentNotifyUrl\" ,\" persistentOps\" :\" avthumb/m3u8/preset/video_16x9_440k\" }" ;
5453 Assert . IsTrue ( result == expect , "PutPolicyTest Failure" ) ;
5554 } catch ( Exception ee ) {
5655 Assert . IsTrue ( false , "PutPolicyTest Failure" ) ;
57- }
56+ }
5857
5958 }
6059
@@ -65,7 +64,7 @@ public void PutPolicyTest(){
6564 public void PutFileTest ( )
6665 {
6766
68- IOClient target = new IOClient ( ) ;
67+ IOClient target = new IOClient ( ) ;
6968 string key = NewKey ;
7069 PrintLn ( key ) ;
7170 PutExtra extra = new PutExtra ( ) ; // TODO: 初始化为适当的值
@@ -96,7 +95,7 @@ public void PutFileTest()
9695 public void PutFileWithoutKeyTest ( )
9796 {
9897
99- IOClient target = new IOClient ( ) ;
98+ IOClient target = new IOClient ( ) ;
10099 string key = NewKey ;
101100 PrintLn ( key ) ;
102101 PutExtra extra = new PutExtra ( ) ; // TODO: 初始化为适当的值
@@ -119,31 +118,31 @@ public void PutFileWithoutKeyTest()
119118 //target.PutFile("error", "error", "error", null);
120119 Assert . IsTrue ( ret . OK , "PutFileTest Failure" ) ;
121120
122- }
123- [ Test ]
124- public void PutTest ( )
125- {
126- IOClient target = new IOClient ( ) ;
127- string key = NewKey ;
128- PrintLn ( key ) ;
129- PutExtra extra = new PutExtra ( ) ; // TODO: 初始化为适当的值
130- extra . MimeType = "text/plain" ;
131- extra . Crc32 = 123 ;
132- extra . CheckCrc = CheckCrcType . CHECK ;
133- extra . Params = new System . Collections . Generic . Dictionary < string , string > ( ) ;
134- PutPolicy put = new PutPolicy ( Bucket ) ;
135- target . PutFinished += new EventHandler < PutRet > ( ( o , e ) =>
136- {
137- if ( e . OK )
138- {
139- RSHelper . RSDel ( Bucket , key ) ;
140- }
141- } ) ;
142- string token = put . Token ( ) ;
143- PutRet ret = target . Put ( put . Token ( ) , key , StreamEx . ToStream ( "Hello, Qiniu Cloud!" ) , extra ) ;
144-
145- Assert . IsTrue ( ret . OK , "PutFileTest Failure" ) ;
146-
121+ }
122+ [ Test ]
123+ public void PutTest ( )
124+ {
125+ IOClient target = new IOClient ( ) ;
126+ string key = NewKey ;
127+ PrintLn ( key ) ;
128+ PutExtra extra = new PutExtra ( ) ; // TODO: 初始化为适当的值
129+ extra . MimeType = "text/plain" ;
130+ extra . Crc32 = 123 ;
131+ extra . CheckCrc = CheckCrcType . CHECK ;
132+ extra . Params = new System . Collections . Generic . Dictionary < string , string > ( ) ;
133+ PutPolicy put = new PutPolicy ( Bucket ) ;
134+ target . PutFinished += new EventHandler < PutRet > ( ( o , e ) =>
135+ {
136+ if ( e . OK )
137+ {
138+ RSHelper . RSDel ( Bucket , key ) ;
139+ }
140+ } ) ;
141+ string token = put . Token ( ) ;
142+ PutRet ret = target . Put ( put . Token ( ) , key , StreamEx . ToStream ( "Hello, Qiniu Cloud!" ) , extra ) ;
143+
144+ Assert . IsTrue ( ret . OK , "PutFileTest Failure" ) ;
145+
147146 }
148147 [ Test ]
149148 public void PutWithoutKeyTest ( )
0 commit comments