File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
CloudinaryDotNet.IntegrationTests/UploadApi Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -83,5 +83,35 @@ public void TestContext()
83
83
Assert . AreEqual ( "value" , res ? . Context [ "custom" ] ? [ "key" ] ? . ToString ( ) , res . Error ? . Message ) ;
84
84
Assert . AreEqual ( "value2" , res ? . Context [ "custom" ] ? [ "key2" ] ? . ToString ( ) ) ;
85
85
}
86
+
87
+ [ Test , RetryWithDelay ]
88
+ public void TestAddVideoContext ( )
89
+ {
90
+ var publicId = GetUniquePublicId ( ) ;
91
+
92
+ var uploadParams = new VideoUploadParams
93
+ {
94
+ File = new FileDescription ( m_testVideoPath ) ,
95
+ PublicId = publicId ,
96
+ Overwrite = true ,
97
+ Type = STORAGE_TYPE_UPLOAD ,
98
+ Tags = m_apiTag
99
+ } ;
100
+
101
+ m_cloudinary . Upload ( uploadParams ) ;
102
+
103
+ List < string > pIds = new List < string > { publicId } ;
104
+
105
+ ContextResult contextResult = m_cloudinary . Context ( new ContextParams ( )
106
+ {
107
+ Command = ContextCommand . Add ,
108
+ PublicIds = pIds ,
109
+ Type = STORAGE_TYPE_UPLOAD ,
110
+ Context = "TestContext" ,
111
+ ResourceType = ResourceType . Video
112
+ } ) ;
113
+
114
+ Assert . True ( contextResult . PublicIds . Length > 0 , contextResult . Error ? . Message ) ;
115
+ }
86
116
}
87
117
}
Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ public TagResult Tag(TagParams parameters)
468
468
/// <returns>Results of contexts management.</returns>
469
469
public Task < ContextResult > ContextAsync ( ContextParams parameters , CancellationToken ? cancellationToken = null )
470
470
{
471
- string uri = m_api . ApiUrlImgUpV . Action ( Constants . CONTEXT_MANAGMENT ) . BuildUrl ( ) ;
471
+ string uri = m_api . ApiUrlImgUpV . ResourceType ( ApiShared . GetCloudinaryParam ( parameters . ResourceType ) ) . Action ( Constants . CONTEXT_MANAGMENT ) . BuildUrl ( ) ;
472
472
473
473
return CallUploadApiAsync < ContextResult > (
474
474
HttpMethod . POST ,
You can’t perform that action at this time.
0 commit comments