Esempio n. 1
0
        public void Validate_GivenAllPropertiesAreValid_ExpectValidationSuccess()
        {
            var cmd       = new ValidateDeviceMfaAgainstCurrentUserCommand(new AuthenticatorAssertionRawResponse(), new AssertionOptions());
            var validator = new ValidateDeviceMfaAgainstCurrentUserCommandValidator();
            var result    = validator.Validate(cmd);

            Assert.True(result.IsValid);
        }
Esempio n. 2
0
        public void Validate_GivenAssertionOptionsIsNull_ExpectValidationFailure()
        {
            var cmd       = new ValidateDeviceMfaAgainstCurrentUserCommand(new AuthenticatorAssertionRawResponse(), null);
            var validator = new ValidateDeviceMfaAgainstCurrentUserCommandValidator();
            var result    = validator.Validate(cmd);

            Assert.False(result.IsValid);
            Assert.Contains(
                result.Errors,
                failure => failure.ErrorCode.Equals(ValidationCodes.FieldIsRequired) &&
                failure.PropertyName == "AssertionOptions");
        }