<-- Previous || Up || Next -->

Percent Of Total Verify Function
Math Reals Class

Private Function PercentOfTotalVerify()
    ' Test the PercentOfTotal function.

    Debug.Assert PercentOfTotal(50, 100) = 50
    Debug.Assert PercentOfTotal(5, 100) = 5
    Debug.Assert PercentOfTotal(0, 100) = 0
    Debug.Assert PercentOfTotal(-5, 100) = -5
    Debug.Assert PercentOfTotal(-50, 100) = -50
    
    Debug.Assert IsNull(PercentOfTotal(50, 0))

    Debug.Assert PercentOfTotal(50, 10) = 500
    Debug.Assert PercentOfTotal(5, 10) = 50
    Debug.Assert PercentOfTotal(0, 10) = 0
    Debug.Assert PercentOfTotal(-5, 10) = -50
    Debug.Assert PercentOfTotal(-50, 10) = -500

    Debug.Assert PercentOfTotal(50, -100) = -50
    Debug.Assert PercentOfTotal(5, -100) = -5
    Debug.Assert PercentOfTotal(0, -100) = 0
    Debug.Assert PercentOfTotal(-5, -100) = 5
    Debug.Assert PercentOfTotal(-50, -100) = 50

    Debug.Assert IsNull(PercentOfTotal(Null, 3))
    Debug.Assert IsNull(PercentOfTotal("Joe", 3))
    Debug.Assert IsNull(PercentOfTotal(3, Null))
    Debug.Assert IsNull(PercentOfTotal(3, "Joe"))

End Function

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.