Skip to content

Commit d9efbde

Browse files
Merge pull request #124 from contentstack/staging
DX | 28-07-2025 | Release
2 parents 73c0244 + 1ffae0d commit d9efbde

File tree

7 files changed

+534
-4
lines changed

7 files changed

+534
-4
lines changed

.talismanrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fileignoreconfig:
99
- filename: Contentstack.Core/ContentstackClient.cs
1010
checksum: 687dc0a5f20037509731cfe540dcec9c3cc2b6cf50373cd183ece4f3249dc88e
1111
- filename: Contentstack.Core/Models/AssetLibrary.cs
12-
checksum: 92ff3feaf730b57c50bb8429f08dd4cddedb42cd89f2507e9746f8237b65fb11
12+
checksum: 7e05fd0bbb43b15e6b7f387d746cc64d709e17e0e8e26a7495a99025077ff507
1313
- filename: Contentstack.Core/Models/Asset.cs
1414
checksum: d192718723e6cb2aa8f08f873d3a7ea7268c89cc15da3bdeea4c16fd304c410e
1515
- filename: Contentstack.Core/Models/Query.cs
@@ -20,3 +20,5 @@ fileignoreconfig:
2020
checksum: 53ba4ce874c4d2362ad00deb23f5a6ec219318860352f997b945e9161a580651
2121
- filename: Contentstack.Core.Tests/ContentstackClientTest.cs
2222
checksum: b63897181a8cb5993d1305248cfc3e711c4039b5677b6c1e4e2a639e4ecb391b
23+
- filename: Contentstack.Core.Tests/AssetTest.cs
24+
checksum: 3e7bf50c7223c458561f0217484d5e70cf3770490c569e0a7083b0a12af9ab86

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### Version: 2.23.0
2+
#### Date: Aug-05-2025
3+
4+
##### Feat:
5+
- Fetch Assets using tags
6+
17
### Version: 2.22.2
28
#### Date: July-14-2025
39

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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

Comments
 (0)