diff --git a/docs/snippets/Snippets.NUnit/Constraints/ConstraintExamples.cs b/docs/snippets/Snippets.NUnit/Constraints/ConstraintExamples.cs index e1588ade4..7824664ee 100644 --- a/docs/snippets/Snippets.NUnit/Constraints/ConstraintExamples.cs +++ b/docs/snippets/Snippets.NUnit/Constraints/ConstraintExamples.cs @@ -60,6 +60,9 @@ public void AnyOfCanDetectIfAnItemMatchesAnArrayOfParams() public void AnyOfCanUseCustomComparisons() { var testValue = "NUnit"; + + // NOTE: Here we cast our comparison to IComparer, because StringComparer implements + // multiple interfaces that NUnit custom comparisons supports. Assert.That(testValue, Is.AnyOf("hello", "world", "nunit").Using((IComparer)StringComparer.InvariantCultureIgnoreCase)); } #endregion