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

Principal Payment Verify Sub
Math Financial Class

Private Sub PrincipalPaymentVerify()
    'Verify that the PrincipalPayment function works correctly.

    Debug.Assert Approx(PrincipalPayment(0.1, 1, 5, 10000, 0, 0), -1637.97480794745)
    Debug.Assert Approx(PrincipalPayment(0.1, 2, 5, 10000, 0, 0), -1801.7722887422)
    Debug.Assert Approx(PrincipalPayment(0.1, 3, 5, 10000, 0, 0), -1981.94951761642)
    Debug.Assert Approx(PrincipalPayment(0.1, 4, 5, 10000, 0, 0), -2180.14446937806)
    Debug.Assert Approx(PrincipalPayment(0.1, 5, 5, 10000, 0, 0), -2398.15891631587)

    Debug.Assert Approx(PrincipalPayment(0.1, 1, 5, 10000, 0, 1), -2398.15891631587)
    Debug.Assert Approx(PrincipalPayment(0.1, 2, 5, 10000, 0, 1), -1637.97480794745)
    Debug.Assert Approx(PrincipalPayment(0.1, 3, 5, 10000, 0, 1), -1801.7722887422)
    Debug.Assert Approx(PrincipalPayment(0.1, 4, 5, 10000, 0, 1), -1981.94951761642)
    Debug.Assert Approx(PrincipalPayment(0.1, 5, 5, 10000, 0, 1), -2180.14446937806)

    Debug.Assert Approx(PrincipalPayment(0.1, 1, 5, 10000, 2000, 0), -1965.56976953694)
    Debug.Assert Approx(PrincipalPayment(0.1, 2, 5, 10000, 2000, 0), -2162.12674649064)
    Debug.Assert Approx(PrincipalPayment(0.1, 3, 5, 10000, 2000, 0), -2378.3394211397)
    Debug.Assert Approx(PrincipalPayment(0.1, 4, 5, 10000, 2000, 0), -2616.17336325367)
    Debug.Assert Approx(PrincipalPayment(0.1, 5, 5, 10000, 2000, 0), -2877.79069957904)

    Debug.Assert Approx(PrincipalPayment(0.1, 1, 5, 10000, 2000, 1), -2695.97251776086)
    Debug.Assert Approx(PrincipalPayment(0.1, 2, 5, 10000, 2000, 1), -1965.56976953694)
    Debug.Assert Approx(PrincipalPayment(0.1, 3, 5, 10000, 2000, 1), -2162.12674649064)
    Debug.Assert Approx(PrincipalPayment(0.1, 4, 5, 10000, 2000, 1), -2378.3394211397)
    Debug.Assert Approx(PrincipalPayment(0.1, 5, 5, 10000, 2000, 1), -2616.17336325367)
    
    Debug.Assert Approx(PrincipalPayment(0, 1, 5, 10000, 0, 0), -2000)
    Debug.Assert Approx(PrincipalPayment(0, 3, 5, 10000, 0, 0), -2000)
    Debug.Assert Approx(PrincipalPayment(0, 5, 5, 10000, 0, 0), -2000)
    
    Debug.Assert Approx(PrincipalPayment(0, 1, 5, 10000, 0, 1), -2000)
    Debug.Assert Approx(PrincipalPayment(0, 3, 5, 10000, 0, 1), -2000)
    Debug.Assert Approx(PrincipalPayment(0, 5, 5, 10000, 0, 1), -2000)
    
    Debug.Assert Approx(PrincipalPayment(0, 1, 5, 10000, 2000, 0), -2400)
    Debug.Assert Approx(PrincipalPayment(0, 3, 5, 10000, 2000, 0), -2400)
    Debug.Assert Approx(PrincipalPayment(0, 5, 5, 10000, 2000, 0), -2400)
    
    Debug.Assert Approx(PrincipalPayment(0, 1, 5, 10000, 2000, 1), -2400)
    Debug.Assert Approx(PrincipalPayment(0, 3, 5, 10000, 2000, 1), -2400)
    Debug.Assert Approx(PrincipalPayment(0, 5, 5, 10000, 2000, 1), -2400)

End Sub

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