Skip to content

Instantly share code, notes, and snippets.

@etaubman
Created May 11, 2014 22:11
Show Gist options
  • Save etaubman/9ec85b19394d2a2143d9 to your computer and use it in GitHub Desktop.
Save etaubman/9ec85b19394d2a2143d9 to your computer and use it in GitHub Desktop.
Public Const DEVELOPMENT_MODE As Boolean = True
Public Sub Assert(ByRef bConditional As Boolean, _
Optional ByRef TestName As String)
If DEVELOPMENT_MODE Then
Debug.Print bConditional, TestName
End If
End Sub
Public Sub AssertNot(ByRef bConditional As Boolean, _
Optional ByRef TestName As String)
Call Assert(Not bConditional, TestName)
End Sub
Public Sub AssertEqual(ByRef vFoo As Variant, ByRef vBar As Variant, _
Optional ByRef TestName As String)
Assert vFoo = vBar, TestName
End Sub
Public Sub AssertNotEqual(ByRef vFoo As Variant, ByRef vBar As Variant, _
Optional ByRef TestName As String)
AssertNot vFoo = vBar, TestName
End Sub
Public Sub AssertNumeric(ByRef vFoo As Variant, _
Optional ByRef TestName As String)
Assert IsNumeric(vFoo), TestName
End Sub
Public Sub AssertString(ByRef vFoo As Variant, _
Optional ByRef TestName As String)
Assert TypeName(vFoo) = "String", TestName
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment