1+ using System ;
2+ using Xunit ;
3+ using Contentstack . Core . Models ;
4+ using System . Threading . Tasks ;
5+ using System . Collections . Generic ;
6+ using System . Linq ;
7+
8+ namespace Contentstack . Core . Tests
9+ {
10+ public class AssetTagsBasicTest
11+ {
12+ ContentstackClient client = StackConfig . GetStack ( ) ;
13+
14+ [ Fact ]
15+ public async Task AssetTags_BasicFunctionality_Test ( )
16+ {
17+ AssetLibrary assetLibrary = client . AssetLibrary ( ) ;
18+
19+ assetLibrary . Tags ( new string [ ] { "test" } ) ;
20+
21+ Assert . NotNull ( assetLibrary ) ;
22+
23+ assetLibrary . Tags ( new string [ ] { "tag1" , "tag2" , "tag3" } ) ;
24+ Assert . NotNull ( assetLibrary ) ;
25+ }
26+
27+ [ Fact ]
28+ public async Task AssetTags_ChainWithOtherMethods_Test ( )
29+ {
30+ AssetLibrary assetLibrary = client . AssetLibrary ( ) ;
31+
32+ var chainedLibrary = assetLibrary
33+ . Tags ( new string [ ] { "test" } )
34+ . Limit ( 1 )
35+ . Skip ( 0 ) ;
36+
37+ Assert . NotNull ( chainedLibrary ) ;
38+ }
39+
40+ [ Fact ]
41+ public async Task AssetTags_NullAndEmptyHandling_Test ( )
42+ {
43+ AssetLibrary assetLibrary = client . AssetLibrary ( ) ;
44+
45+ assetLibrary . Tags ( null ) ;
46+ Assert . NotNull ( assetLibrary ) ;
47+
48+ assetLibrary . Tags ( new string [ ] { } ) ;
49+ Assert . NotNull ( assetLibrary ) ;
50+ }
51+
52+ [ Fact ]
53+ public void AssetTags_MethodExists_Test ( )
54+ {
55+ AssetLibrary assetLibrary = client . AssetLibrary ( ) ;
56+
57+ var result = assetLibrary . Tags ( new string [ ] { "test" } ) ;
58+
59+ Assert . IsType < AssetLibrary > ( result ) ;
60+ }
61+
62+ [ Fact ]
63+ public void AssetTags_MultipleCalls_ShouldNotThrowException_Test ( )
64+ {
65+ AssetLibrary assetLibrary = client . AssetLibrary ( ) ;
66+
67+ assetLibrary . Tags ( new string [ ] { "tag1" , "tag2" } ) ;
68+ assetLibrary . Tags ( new string [ ] { "tag3" , "tag4" } ) ;
69+ assetLibrary . Tags ( new string [ ] { "newtag1" , "newtag2" , "newtag3" } ) ;
70+
71+ Assert . IsType < AssetLibrary > ( assetLibrary ) ;
72+ }
73+ }
74+ }
0 commit comments