Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v1
with:
dotnet-version: "7.0.x"
dotnet-version: "10.0.x"

- name: Run Dotnet Restore
run: dotnet restore
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Setup .NET 7.0
- name: Setup .NET
uses: actions/setup-dotnet@v4.3.0
with:
dotnet-version: '7.0.x'
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore Contentstack.Net.sln
- name: Build solution
Expand Down
10 changes: 1 addition & 9 deletions Contentstack.Core.Tests/Contentstack.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>

<IsPackable>false</IsPackable>
<ReleaseVersion>$(Version)</ReleaseVersion>
Expand All @@ -27,17 +27,9 @@
<DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="4.2.10" />
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>

<ItemGroup>
<Reference Include="Contentstack.Core">
<HintPath>..\Contentstack.Core\bin\Debug\Contentstack.Core.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Remove="SingletoneTest.cs" />
<Compile Remove="EmptyClass.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Core.Tests/Helpers/EntryFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public async Task<ContentstackCollection<Entry>> FetchFirstEntryAsync(string con
/// </summary>
/// <param name="contentTypeUid">Content type UID</param>
/// <returns>Count result</returns>
public async Task<Newtonsoft.Json.Linq.JObject> CountEntriesAsync(string contentTypeUid)
public async Task<System.Text.Json.Nodes.JsonObject> CountEntriesAsync(string contentTypeUid)
{
return await CreateQuery(contentTypeUid).Count();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public async Task Asset_Tags_Available()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public async Task Metadata_Performance_WithOwner()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public async Task Cache_DifferentProjections_IndependentCache()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public ContentstackClientTest(ITestOutputHelper output) : base(output)
{
}

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Contentstack.Core.Tests.Helpers;
using Newtonsoft.Json.Linq;
using System.Text.Json.Nodes;
using System.Collections;
using Xunit.Abstractions;

Expand Down Expand Up @@ -165,10 +165,10 @@ public async Task ContentType_FetchSingleContentType_ReturnsSchema()
LogAssert("Verifying response");

TestAssert.NotNull(schema);
TestAssert.IsType<JObject>(schema);
TestAssert.IsType<JsonObject>(schema);
// Schema should contain uid
TestAssert.True(schema.ContainsKey("uid"));
TestAssert.Equal(TestDataHelper.SimpleContentTypeUid, schema["uid"]?.ToString());
TestAssert.Equal(TestDataHelper.SimpleContentTypeUid, schema["uid"]?.GetValue<string>());
}

[Fact(DisplayName = "Content Type - Content Type Fetch With Global Fields Includes Global Field Schema")]
Expand All @@ -194,7 +194,7 @@ public async Task ContentType_FetchWithGlobalFields_IncludesGlobalFieldSchema()
LogAssert("Verifying response");

TestAssert.NotNull(schema);
TestAssert.IsType<JObject>(schema);
TestAssert.IsType<JsonObject>(schema);
}

[Fact(DisplayName = "Content Type - Content Type Fetch Complex Type Contains Expected Fields")]
Expand All @@ -216,7 +216,7 @@ public async Task ContentType_FetchComplexType_ContainsExpectedFields()
LogAssert("Verifying response");

TestAssert.NotNull(schema);
TestAssert.IsType<JObject>(schema);
TestAssert.IsType<JsonObject>(schema);
// Should have schema field
TestAssert.True(schema.ContainsKey("schema"));
}
Expand Down Expand Up @@ -287,7 +287,7 @@ public async Task ContentType_Schema_ContainsUid()

TestAssert.NotNull(schema);
TestAssert.True(schema.ContainsKey("uid"));
TestAssert.Equal(TestDataHelper.MediumContentTypeUid, schema["uid"].ToString());
TestAssert.Equal(TestDataHelper.MediumContentTypeUid, schema["uid"]?.GetValue<string>());
}

[Fact(DisplayName = "Content Type - Content Type Schema Contains Schema Definition")]
Expand All @@ -310,7 +310,7 @@ public async Task ContentType_Schema_ContainsSchemaDefinition()

TestAssert.NotNull(schema);
TestAssert.True(schema.ContainsKey("schema"));
var schemaArray = schema["schema"] as JArray;
var schemaArray = schema["schema"] as JsonArray;
TestAssert.NotNull(schemaArray);
TestAssert.True(schemaArray.Count > 0, "Schema should contain field definitions");
}
Expand Down Expand Up @@ -402,7 +402,7 @@ public async Task ContentType_MultipleContentTypes_AllFetchSuccessfully()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Contentstack.Core.Tests.Helpers;
using Newtonsoft.Json.Linq;
using System.Text.Json.Nodes;
using Xunit.Abstractions;

namespace Contentstack.Core.Tests.Integration.ContentTypeTests
Expand Down Expand Up @@ -117,7 +117,7 @@ public async Task ContentTypeQuery_SchemaValidation_IsValidJObject()
LogAssert("Verifying response");

TestAssert.NotNull(schema);
TestAssert.IsType<JObject>(schema);
TestAssert.IsType<JsonObject>(schema);
}

#endregion
Expand Down Expand Up @@ -360,7 +360,7 @@ await TestAssert.ThrowsAnyAsync<Exception>(async () =>

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public async Task EntryInclude_Performance_MultipleIncludes()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public async Task Entry_AddParam_CustomParamIsApplied()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Contentstack.Core.Models;
using Contentstack.Core.Tests.Helpers;
using Contentstack.Core.Tests.Models;
using Newtonsoft.Json.Linq;
using Xunit.Abstractions;

namespace Contentstack.Core.Tests.Integration.EntryTests
Expand Down Expand Up @@ -619,7 +618,7 @@ public async Task ReferenceQuery_WithOwner_IncludesOwnerInformation()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Contentstack.Core.Tests.Helpers;
using Newtonsoft.Json.Linq;
using System.Text.Json.Nodes;
using Xunit.Abstractions;

namespace Contentstack.Core.Tests.Integration.GlobalFieldsTests
Expand Down Expand Up @@ -412,7 +412,7 @@ public async Task GlobalFields_SchemaValidation_IsValidJObject()
LogAssert("Verifying response");

TestAssert.NotNull(schema);
TestAssert.IsType<JObject>(schema);
TestAssert.IsType<JsonObject>(schema);
}

#endregion
Expand Down Expand Up @@ -505,7 +505,7 @@ public async Task GlobalFields_EmptyGlobalField_ReturnsValidEntry()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Contentstack.Core.Tests.Helpers;
using Newtonsoft.Json.Linq;
using System.Text.Json.Nodes;
using Xunit.Abstractions;

namespace Contentstack.Core.Tests.Integration.GlobalFieldsTests
Expand Down Expand Up @@ -386,7 +386,7 @@ public async Task NestedGlobal_SchemaValidation_IsValidJObject()
LogAssert("Verifying response");

TestAssert.NotNull(schema);
TestAssert.IsType<JObject>(schema);
TestAssert.IsType<JsonObject>(schema);
}

#endregion
Expand Down Expand Up @@ -425,7 +425,7 @@ public async Task NestedGlobal_Performance_DeepNesting()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public async Task Header_RequestLevel_IndependentRequests()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public async Task ImageDelivery_Performance_MultipleAssets()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task JsonRte_BasicFetch_ReturnsEntry()
var blocks = entry.Get("json_rte_field");
if (blocks != null)
{
var blocksArray = blocks as Newtonsoft.Json.Linq.JArray;
var blocksArray = blocks as System.Collections.IList;
if (blocksArray != null && blocksArray.Count > 0)
{
TestAssert.True(blocksArray.Count > 0, "Modular blocks should have content");
Expand Down Expand Up @@ -90,7 +90,7 @@ public async Task JsonRte_WithEmbeddedItems_IncludesEmbedded()
var blocks = entry.Get("json_rte_field");
if (blocks != null)
{
var blocksArray = blocks as Newtonsoft.Json.Linq.JArray;
var blocksArray = blocks as System.Collections.IList;
if (blocksArray != null && blocksArray.Count > 0)
{
TestAssert.True(blocksArray.Count > 0, "Modular blocks should have content");
Expand Down Expand Up @@ -132,7 +132,7 @@ public async Task JsonRte_EmbeddedEntry_SingleLevel()
var blocks = entry.Get("json_rte_field");
if (blocks != null)
{
var blocksArray = blocks as Newtonsoft.Json.Linq.JArray;
var blocksArray = blocks as System.Collections.IList;
if (blocksArray != null && blocksArray.Count > 0)
{
TestAssert.True(blocksArray.Count > 0, "Modular blocks should have content");
Expand Down Expand Up @@ -426,7 +426,7 @@ public async Task JsonRte_EmptyRte_HandlesGracefully()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public async Task Fallback_NoTranslation_FallsBackCompletely()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public async Task LocaleExtended_MultipleLocaleRequests_Independent()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task ModularBlocks_BasicFetch_ReturnsEntry()
var blocks = entry.Get("modular_blocks");
if (blocks != null)
{
var blocksArray = blocks as Newtonsoft.Json.Linq.JArray;
var blocksArray = blocks as System.Collections.IList;
if (blocksArray != null && blocksArray.Count > 0)
{
TestAssert.True(blocksArray.Count > 0, "Modular blocks should have content");
Expand Down Expand Up @@ -418,7 +418,7 @@ public async Task ModularBlocks_EmptyBlocks_HandlesGracefully()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public async Task Pagination_LargeSkip_HandlesGracefully()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public async Task Performance_CachedVsUncached_Consistency()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ public async Task Encoding_MixedCharacterSet_AllTypesEncoded()

#region Helper Methods

private ContentstackClient CreateClient()
private new ContentstackClient CreateClient()
{
var options = new ContentstackOptions()
{
Expand Down
Loading
Loading