@@ -40,7 +40,6 @@ public void PutPolicyTest(){
40
40
41
41
42
42
policy = new PutPolicy ( "bucket" ) ;
43
- policy . AsyncOps = "" ;
44
43
policy . CallBackBody = "uid=123" ;
45
44
policy . CallBackUrl = "www.qiniu.com" ;
46
45
policy . DetectMime = 1 ;
@@ -50,11 +49,11 @@ public void PutPolicyTest(){
50
49
policy . PersistentOps = "avthumb/m3u8/preset/video_16x9_440k" ;
51
50
try {
52
51
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\" }" ;
54
53
Assert . IsTrue ( result == expect , "PutPolicyTest Failure" ) ;
55
54
} catch ( Exception ee ) {
56
55
Assert . IsTrue ( false , "PutPolicyTest Failure" ) ;
57
- }
56
+ }
58
57
59
58
}
60
59
@@ -65,7 +64,7 @@ public void PutPolicyTest(){
65
64
public void PutFileTest ( )
66
65
{
67
66
68
- IOClient target = new IOClient ( ) ;
67
+ IOClient target = new IOClient ( ) ;
69
68
string key = NewKey ;
70
69
PrintLn ( key ) ;
71
70
PutExtra extra = new PutExtra ( ) ; // TODO: 初始化为适当的值
@@ -96,7 +95,7 @@ public void PutFileTest()
96
95
public void PutFileWithoutKeyTest ( )
97
96
{
98
97
99
- IOClient target = new IOClient ( ) ;
98
+ IOClient target = new IOClient ( ) ;
100
99
string key = NewKey ;
101
100
PrintLn ( key ) ;
102
101
PutExtra extra = new PutExtra ( ) ; // TODO: 初始化为适当的值
@@ -119,31 +118,31 @@ public void PutFileWithoutKeyTest()
119
118
//target.PutFile("error", "error", "error", null);
120
119
Assert . IsTrue ( ret . OK , "PutFileTest Failure" ) ;
121
120
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
+
147
146
}
148
147
[ Test ]
149
148
public void PutWithoutKeyTest ( )
0 commit comments