You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When testing the Eidsca CR04 in a tenant, the test returns a value of 5 days for RequestDurationInDays, which is clearly below the 30-day threshold. However, the test incorrectly reports that the duration is not 30 days or less. The issue is caused by an unnecessary and incorrect typecasting to a string, leading to a faulty comparison.
fix: remove unnecessary string casting and improve tenant value checks in admin consent policy test
Previously, the test for "policies/adminConsentRequestPolicy" incorrectly cast the RequestDurationInDays value to a string, resulting in faulty comparisons. This change removes the string cast, allowing for proper numeric comparison, and improves the handling of unset tenant values using [string]::IsNullOrEmpty() and a check for a zero value.
- Removed casting of RequestDurationInDays to string.
- Compared tenantValue directly against the integer 30.
- Updated tenantValueNotSet logic to reliably detect unset or default values.
- Ensured the testResultMarkdown messages remain consistent with the new logic.
Description:
When testing the Eidsca CR04 in a tenant, the test returns a value of
5
days forRequestDurationInDays
, which is clearly below the 30-day threshold. However, the test incorrectly reports that the duration is not 30 days or less. The issue is caused by an unnecessary and incorrect typecasting to a string, leading to a faulty comparison.Failing code:
Steps to Reproduce:
(Get-MgPolicyAdminConsentRequestPolicy).RequestDurationInDays.gettype()
The property is already an integer, which means that the cast to a string is unnecessary.
Expected Behavior
5
should be recognized as less than or equal to30
.Actual Behavior
Suggested Fix
Source
Test-MtEidscaCR04
The text was updated successfully, but these errors were encountered: