Sveučilište u Zagrebu  |  Filozofski fakultet  |  Služba za informatiku  |  Kutak za korisnike  |  Teme

Testing program for OIBs, JMBGs and JMBAGs

testing functions

Module Module1

    Sub Main()

        jmbags_test()
        jmbgs_test()
        oibs_test()

        Console.ReadLine()

    End Sub

    Sub oibs_test()

        Console.WriteLine("Testing " & oibs_for_test.Count & " OIBs...")
        For Each oib In oibs_for_test
            If Ojj.oib_test(oib) Then
                Console.WriteLine(oib & " OK")
            Else
                Console.WriteLine(oib & " fail " & Ojj.Oib_get_CD(oib))
            End If
        Next

    End Sub

    Sub jmbgs_test()

        Console.WriteLine("Testing " & jmbgs_for_test.Count & " JMBGs...")
        For Each jmbg In jmbgs_for_test
            If Ojj.Jmbg_test_HR(jmbg) Then
                Console.WriteLine(jmbg & " OK " & Ojj.Jmbg_age(jmbg))
            Else
                Console.WriteLine(jmbg & " fail " & Ojj.Jmbg_get_CD(jmbg) & " " & Ojj.Jmbg_age(jmbg))
            End If
        Next

    End Sub

    Sub jmbags_test()

        Console.WriteLine("Testing " & jmbags_for_test.Count & " JMBAGs...")
        For Each jmbag In jmbags_for_test
            If Ojj.Jmbag_test(jmbag) Then
                Console.WriteLine(jmbag & " OK")
            Else
                Console.WriteLine(jmbag & " fail " & Ojj.Jmbag_get_CD(jmbag))
            End If
        Next

    End Sub

    Dim jmbags_for_test() As String = {
        }  ' put your jmbags for testing

    Dim jmbgs_for_test() As String = {
        }  ' put your jmbgs for testing

    Dim oibs_for_test() As String = {
        }  ' put your oibs for testing

End Module

 

komentare molim ovdje