Skip to content

Commit 987b8af

Browse files
committed
refactor: update WorkflowTest assertions to use GetValue for JSON properties
1 parent 10ec355 commit 987b8af

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@
5858
<Compile Remove="IntegrationTest\Contentstack004_ReleaseTest.cs" />
5959
<Compile Remove="IntegrationTest\Contentstack012b_ContentTypeExpandedIntegrationTest.cs" />
6060

61-
<Compile Remove="IntegrationTest\Contentstack016_DeliveryTokenTest.cs" />
62-
<Compile Remove="IntegrationTest\Contentstack017_TaxonomyTest.cs" />
6361
<Compile Remove="IntegrationTest\Contentstack019_RoleTest.cs" />
64-
<Compile Remove="IntegrationTest\Contentstack020_WorkflowTest.cs" />
6562
</ItemGroup>
6663
</Project>

Contentstack.Management.Core.Tests/IntegrationTest/Contentstack020_WorkflowTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ public void Test005_Should_Update_Workflow_Properties()
13261326
AssertLogger.IsTrue(response.IsSuccessStatusCode, $"Workflow update failed with status {(int)response.StatusCode}", "workflowUpdateSuccess");
13271327
AssertLogger.IsNotNull(responseJson["workflow"], "workflowObject");
13281328
AssertLogger.AreEqual(updatedName, responseJson["workflow"]["name"]?.ToString(), "updatedWorkflowName");
1329-
AssertLogger.AreEqual(false, responseJson["workflow"]["enabled"]?.Value<bool>(), "updatedEnabledStatus");
1329+
AssertLogger.AreEqual(false, responseJson["workflow"]["enabled"]?.GetValue<bool>(), "updatedEnabledStatus");
13301330

13311331
TestOutputLogger.LogContext("UpdatedWorkflowUid", workflowUid);
13321332
}
@@ -1600,7 +1600,7 @@ public async Task Test012_Should_Update_Publish_Rule()
16001600
// Assert
16011601
AssertLogger.IsNotNull(response, "publishRuleUpdateResponse");
16021602
AssertLogger.IsTrue(response.IsSuccessStatusCode, $"Publish rule update failed with status {(int)response.StatusCode}", "publishRuleUpdateSuccess");
1603-
AssertLogger.AreEqual(true, responseJson["publishing_rule"]["disable_approver_publishing"]?.Value<bool>(), "updatedDisableApproval");
1603+
AssertLogger.AreEqual(true, responseJson["publishing_rule"]["disable_approver_publishing"]?.GetValue<bool>(), "updatedDisableApproval");
16041604

16051605
TestOutputLogger.LogContext("UpdatedPublishRuleUid", publishRuleUid);
16061606
}

0 commit comments

Comments
 (0)