Skip to content

Commit

Permalink
Print groups if augmentation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed Oct 28, 2024
1 parent 4cdd290 commit 0febf5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Yvand.LDAPCPSE.Tests/ClaimsProviderTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,11 @@ protected void TestAugmentationOperation(string claimValue, bool shouldBeMemberO

if (shouldBeMemberOfTheGroupTested)
{

Assert.That(groupFound, Is.True, $"Entity \"{claimValue}\" should be member of group \"{groupClaimValueToTest}\", but this group was not found in the claims returned by the claims provider.");
Assert.That(groupFound, Is.True, $"Entity \"{claimValue}\" should be member of group \"{groupClaimValueToTest}\", but this group was not found in the claims returned by the claims provider. It returned {(groups != null ? groups.Count().ToString() : "null")} groups: \"{String.Join(", ", groups.Select(x => x.Value))}\"");
}
else
{
Assert.That(groupFound, Is.False, $"Entity \"{claimValue}\" should NOT be member of group \"{groupClaimValueToTest}\", but this group was found in the claims returned by the claims provider.");
Assert.That(groupFound, Is.False, $"Entity \"{claimValue}\" should NOT be member of group \"{groupClaimValueToTest}\", but this group was found in the claims returned by the claims provider. It returned {(groups != null ? groups.Count().ToString() : "null")} groups: \"{String.Join(", ", groups.Select(x => x.Value))}\"");
}
timer.Stop();
Trace.TraceInformation($"{DateTime.Now:s} [{this.GetType().Name}] TestAugmentationOperation finished in {timer.ElapsedMilliseconds} ms. Parameters: claimType: '{claimType}', claimValue: '{claimValue}', isMemberOfTrustedGroup: '{shouldBeMemberOfTheGroupTested}'.");
Expand Down

0 comments on commit 0febf5e

Please sign in to comment.