public void Validate_GivenAllPropertiesAreValid_ExpectValidationSuccess()
        {
            var cmd       = new RevokeAuthenticatorDeviceCommand(TestVariables.AuthenticatorDeviceId, "password");
            var validator = new RevokeAuthenticatorDeviceCommandValidator();
            var result    = validator.Validate(cmd);

            Assert.True(result.IsValid);
        }
        public void Validate_GivenPasswordIsNull_ExpectValidationFailure()
        {
            var cmd       = new RevokeAuthenticatorDeviceCommand(TestVariables.AuthenticatorDeviceId, null);
            var validator = new RevokeAuthenticatorDeviceCommandValidator();
            var result    = validator.Validate(cmd);

            Assert.False(result.IsValid);
            Assert.Contains(
                result.Errors,
                failure => failure.ErrorCode.Equals(ValidationCodes.FieldIsRequired) &&
                failure.PropertyName == "Password");
        }
        public void Validate_GivenDeviceIdIsEmpty_ExpectValidationFailure()
        {
            var cmd       = new RevokeAuthenticatorDeviceCommand(Guid.Empty, "password");
            var validator = new RevokeAuthenticatorDeviceCommandValidator();
            var result    = validator.Validate(cmd);

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