This folder contains unit tests for Azure AD B2C predicates. For more information, check out the Predicates and PredicateValidations article.
The IncludesCharacters method checks whether a date claim value is between a range of minimum and maximum parameters specified. To test the experience of the predicate, follow these steps:
- Run the B2C_1A_Predicate_IncludesCharacters policy.
- In the textbox type
123
, orabc
and select continue. You should get an error message. The string must contain a combination of a lower case, upper case, a number and a symbol. - Type a string that contains all the required characters, such as
Passw0rd!
and select continue. This time you should not get any error message.
Live demo
Quick deploy
Policy
Documentation
The IsDateRange method checks whether a string claim value contains a character set. To test the experience of the predicate, follow these steps:
- Run the B2C_1A_Predicate_IsDateRange policy.
- Select a date that is greater than today, and select continue. You should get an error message.
- Select a valid date and select continue. This time you will not get any error.
Live demo
Quick deploy
Policy
Documentation
The IncludesCharacters method checks whether the length of a string claim value is within the range of minimum and maximum parameters specified. To test the experience of the predicate, follow these steps:
- Run the B2C_1A_Predicate_IsLengthRange policy.
- In the textbox type a short value, such as
abc
and select continue. You should get an error message. - Add more characters to meet the predicate requirement and select continue. This time you should not get any error message.
Live demo
Quick deploy
Policy
Documentation
The MatchesRegex method whether a string claim value matches a regular expression. To test the experience of the predicate, follow these steps:
- Run the B2C_1A_Predicate_MatchesRegex policy.
- In the textbox type one or more spaces
- Remote the spaces and select continue. This time you should not get any error message.