Tutorial: Excel Unit Testing with VBA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'' | |
' Validate the password length so that it's between 8-16 characters long | |
' | |
' Returns: | |
' | |
' TRUE - Password matches the lenght requirement | |
' FALSE - Password doesn't match the length requirement | |
Function ValidatePasswordLength(password As String) As Boolean | |
Dim success As Boolean: success = False | |
' Validate the password is of correct length (between 8-16 characters) | |
Dim length As Long: length = Len(password) | |
If (length >= 8 And length <= 16) Then | |
success = True | |
End If | |
ValidatePasswordLength = success | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for writing about Rubberduck's unit test feature. You have a typo on line 8 the h and t in length are transposed.