Attribute VB_Name = "DevHelper"
Option Explicit

Public Const TEST_FOLDER = "testTemp"

Public Function Dev_PrepareSkeleton()
  ' Do nothing
End Function

Public Sub Dev_ManualRunTest()
  Dim sSuite$: sSuite = "s_Database"
  Dim sTest$: sTest = "t_RenameLawFile"
  Dim sMsg$: sMsg = Dev_RunTestDebug(sSuite, sTest)
  Debug.Print sMsg
  Call MsgBox(sMsg)
End Sub

Public Function Dev_GetTestSuite(sName$) As Object
  Select Case sName
    Case "s_ActiveStateExporter": Set Dev_GetTestSuite = New s_ActiveStateExporter
    Case "s_Database": Set Dev_GetTestSuite = New s_Database
    Case "s_DatabaseManager": Set Dev_GetTestSuite = New s_DatabaseManager
    Case "s_IteratorLaw": Set Dev_GetTestSuite = New s_IteratorLaw
    Case "s_IteratorLinkAll": Set Dev_GetTestSuite = New s_IteratorLinkAll
  End Select
End Function

Public Function GetDummyData() As ItemLaw
  Set GetDummyData = New ItemLaw
  With GetDummyData
    .gid_ = GenerateGID
    .status_ = T_LAWS_FULL
    .type_ = T_LAW_05_CODEX
    .fileName_ = "fileName" & CStr(.gid_) & ".docx"
    .title_ = "title_"
    .typeTxt_ = "typeTxt_"
    .creator_ = "creator_"
    .date_ = "date_"
    .number_ = "number_"
    .header_ = "header_"
    .attach_ = "attach_"
    .isScoped_ = True
    .isDummy_ = False
  End With
End Function

Public Function GenerateLinks(Optional nCount& = 0) As String()
  Dim lnkCount&: lnkCount = nCount
  If lnkCount = 0 Then _
    lnkCount = Int((19 * Rnd) + 1)
  Dim linksData() As String
  ReDim linksData(1 To lnkCount, LinkTransferStruct.[_First] To LinkTransferStruct.[_Last])
  
  Dim nItem&
  For nItem = 1 To lnkCount Step 1
    linksData(nItem, S_TL_DESTINATION_ID) = CStr(GenerateGID)
    linksData(nItem, S_TL_DESTINATION_SUB) = GenerateSub
    linksData(nItem, S_TL_SOURCE_SUB) = GenerateSub
  Next nItem
  
  GenerateLinks = linksData
End Function

Public Function GenerateGID() As Long
  GenerateGID = Int(9999 * Rnd) + 1000000
End Function

Public Function GenerateSub() As String
  GenerateSub = "sub_" & Int(Rnd * 100)
End Function

