Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fileignoreconfig:
- filename: Contentstack.Core/ContentstackClient.cs
checksum: 687dc0a5f20037509731cfe540dcec9c3cc2b6cf50373cd183ece4f3249dc88e
- filename: Contentstack.Core/Models/AssetLibrary.cs
checksum: 92ff3feaf730b57c50bb8429f08dd4cddedb42cd89f2507e9746f8237b65fb11
checksum: 7e05fd0bbb43b15e6b7f387d746cc64d709e17e0e8e26a7495a99025077ff507
- filename: Contentstack.Core/Models/Asset.cs
checksum: d192718723e6cb2aa8f08f873d3a7ea7268c89cc15da3bdeea4c16fd304c410e
- filename: Contentstack.Core/Models/Query.cs
Expand All @@ -20,3 +20,5 @@ fileignoreconfig:
checksum: 53ba4ce874c4d2362ad00deb23f5a6ec219318860352f997b945e9161a580651
- filename: Contentstack.Core.Tests/ContentstackClientTest.cs
checksum: b63897181a8cb5993d1305248cfc3e711c4039b5677b6c1e4e2a639e4ecb391b
- filename: Contentstack.Core.Tests/AssetTest.cs
checksum: 3e7bf50c7223c458561f0217484d5e70cf3770490c569e0a7083b0a12af9ab86
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Version: 2.23.0
#### Date: Aug-05-2025

##### Feat:
- Fetch Assets using tags

### Version: 2.22.2
#### Date: July-14-2025

Expand Down
74 changes: 74 additions & 0 deletions Contentstack.Core.Tests/AssetTagsBasicTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;
using Xunit;
using Contentstack.Core.Models;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;

namespace Contentstack.Core.Tests
{
public class AssetTagsBasicTest
{
ContentstackClient client = StackConfig.GetStack();

[Fact]
public async Task AssetTags_BasicFunctionality_Test()
{
AssetLibrary assetLibrary = client.AssetLibrary();

assetLibrary.Tags(new string[] { "test" });

Assert.NotNull(assetLibrary);

assetLibrary.Tags(new string[] { "tag1", "tag2", "tag3" });
Assert.NotNull(assetLibrary);
}

[Fact]
public async Task AssetTags_ChainWithOtherMethods_Test()
{
AssetLibrary assetLibrary = client.AssetLibrary();

var chainedLibrary = assetLibrary
.Tags(new string[] { "test" })
.Limit(1)
.Skip(0);

Assert.NotNull(chainedLibrary);
}

[Fact]
public async Task AssetTags_NullAndEmptyHandling_Test()
{
AssetLibrary assetLibrary = client.AssetLibrary();

assetLibrary.Tags(null);
Assert.NotNull(assetLibrary);

assetLibrary.Tags(new string[] { });
Assert.NotNull(assetLibrary);
}

[Fact]
public void AssetTags_MethodExists_Test()
{
AssetLibrary assetLibrary = client.AssetLibrary();

var result = assetLibrary.Tags(new string[] { "test" });

Assert.IsType<AssetLibrary>(result);
}

[Fact]
public void AssetTags_MultipleCalls_ShouldNotThrowException_Test()
{
AssetLibrary assetLibrary = client.AssetLibrary();

assetLibrary.Tags(new string[] { "tag1", "tag2" });
assetLibrary.Tags(new string[] { "tag3", "tag4" });
assetLibrary.Tags(new string[] { "newtag1", "newtag2", "newtag3" });

Assert.IsType<AssetLibrary>(assetLibrary);
}
}
}
Loading
Loading